As makers, we want scalable, passive income. But building a news or content aggregator hits two walls: the full-stack plumbing (FastAPI, Vue) and the content itself. How do you automate thousands of high-quality articles without getting flagged for AI-generated or duplicate content? The answer is a heavily constrained, multi-step prompt.
I’m sharing the core prompt structure I developed for the AI News Aggregator Full-Stack Template that solves the unique content problem using the Gemini API.
Section 1: The Necessity of Strict Output Format
An LLM must be a predictable machine. To reliably parse the response in Python (FastAPI), I had to force the Gemini API to adhere to a rigid plain text format. This is the most critical step for the backend to function. We mandate the entire output to be returned in a specified plain text format using non-negotiable tags.
This structured output is critical because our FastAPI backend relies on these tags to correctly extract the components. The format includes:
[START_TITLE] / [END_TITLE]: Your new primary keyword-optimized title.
[START_KEYWORD] / [END_KEYWORD]: The single primary keyword you extracted.
[START_OPINION] / [END_OPINION]: A concise, 1-2 sentence 'My Opinion' summary.
[START_BODY_HTML] / [END_BODY_HTML]: The full rewritten article as a clean HTML string.
Section 2: The Rules of SEO-Agnostic Content Generation
This is where the content is guaranteed to be 100% original and pass AI detection. The prompt acts as a quality control layer, ensuring the article is structured for maximum on-page SEO without sounding robotic.
Rule 1: Forced Primary Keyword Placement
The single primary keyword you extract MUST appear in five specific locations to maximize relevance:
The [START_TITLE] section.
The first
tag inside [START_BODY_HTML].
The first
tag inside [START_BODY_HTML].
At least two
subheadings.
Naturally 4-6 times throughout the body.
Rule 2: Integrating Secondary/LSI Keywords
To broaden the topic relevance and improve long-tail search performance, the prompt demands the natural integration of Latent Semantic Indexing (LSI) terms where relevant. For a crypto news aggregator, these include terms like "digital assets," "blockchain technology," "cryptocurrency market," "crypto regulation," and "investment strategy".
Rule 3: Clean HTML Structure Constraint
We forbid the model from including full web page tags (,
subheadings.
Section 3: The Maker’s Insight (My Opinion)
The final constraint is the My Opinion Summary. We instruct the model to provide a 1-2 sentence, insightful summary. By demanding this opinion, we inject a unique, human-like editorial voice into the database, which adds editorial value and helps differentiate the content from pure aggregation. This summary is used for the [START_OPINION] section.
Conclusion & Call to Action (Soft Pitch)
Prompt engineering ensures the content is unique and passes AI detection. But that’s only half the battle—the other half is the full-stack app that handles user authentication, data fetching, and deployment.
If you're ready to stop writing boilerplate code and just focus on growth, you can grab the complete, production-ready AI News Aggregator Full-Stack Template (FastAPI + Vue 3) with this exact prompt baked in, ready to deploy.
Link to the template here: https://talha-ghayas-khan.itch.io/ai-news-aggregator-full-stack-template
Top comments (0)