Tutorial

How to Build a Content Ideation Agent with Search

Learn how to build an AI agent that researches trending topics across Google, Reddit, and YouTube to generate content ideas backed by real demand signals.

Content ideation based on guesswork produces mediocre topics. An ideation agent that searches live data across multiple platforms finds topics with proven demand: questions people are asking on Reddit, gaps in Google results, and trending topics on YouTube. This tutorial builds an agent that queries three platforms for a topic area and synthesizes the findings into actionable content ideas.

Prerequisites

  • Python 3.8+ installed
  • requests library installed
  • A Scavio API key from scavio.dev
  • An OpenAI or Anthropic API key for LLM synthesis

Walkthrough

Step 1: Define the research function

Search Google, Reddit, and YouTube for a topic to find demand signals.

Python
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}

def research_topic(topic: str) -> dict:
    data = {}
    for platform in ['google', 'reddit', 'youtube']:
        resp = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
            json={'platform': platform, 'query': topic}, timeout=10)
        data[platform] = resp.json().get('organic', [])[:10]
    return data

Step 2: Extract demand signals

Parse the search results to find questions, gaps, and trending angles.

Python
def extract_signals(research: dict) -> dict:
    signals = {'questions': [], 'gaps': [], 'trending': []}
    # Google People Also Ask = questions with demand
    for r in research.get('google', []):
        if 'question' in r.get('type', ''):
            signals['questions'].append(r.get('title', ''))
    # Reddit threads with high engagement = proven interest
    for r in research.get('reddit', []):
        signals['questions'].append(r.get('title', ''))
    # YouTube results = visual content opportunities
    for r in research.get('youtube', []):
        signals['trending'].append(r.get('title', ''))
    return signals

Step 3: Synthesize with an LLM

Feed the demand signals into an LLM to generate structured content ideas.

Python
def generate_ideas(topic: str, signals: dict) -> str:
    prompt = f"""Based on these real demand signals for '{topic}':

Questions people are asking: {signals['questions'][:10]}
Trending content: {signals['trending'][:10]}

Generate 5 content ideas. Each must:
1. Address a specific question or gap from the signals
2. Have a concrete angle (not generic)
3. Include a suggested title and format (blog, tutorial, video, comparison)

Output as a numbered list."""
    # Call your preferred LLM here
    return prompt  # Replace with actual LLM call

Step 4: Run the full ideation pipeline

Combine research, signal extraction, and LLM synthesis.

Python
def ideate(topic: str) -> dict:
    print(f'Researching: {topic}')
    research = research_topic(topic)
    signals = extract_signals(research)
    print(f'Found {len(signals["questions"])} questions, {len(signals["trending"])} trending topics')
    ideas = generate_ideas(topic, signals)
    return {'topic': topic, 'signals': signals, 'ideas': ideas}

result = ideate('AI agent frameworks 2026')
print(result['ideas'])

Python Example

Python
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}

def ideation_research(topic):
    signals = []
    for p in ['google', 'reddit', 'youtube']:
        data = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
            json={'platform': p, 'query': topic}, timeout=10).json()
        signals.extend([{'platform': p, 'title': r['title']} for r in data.get('organic', [])[:5]])
    return signals

JavaScript Example

JavaScript
async function ideationResearch(topic) {
  const signals = [];
  for (const p of ['google', 'reddit', 'youtube']) {
    const data = await fetch('https://api.scavio.dev/api/v1/search', {
      method: 'POST', headers: {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'},
      body: JSON.stringify({platform: p, query: topic})
    }).then(r => r.json());
    signals.push(...(data.organic || []).slice(0, 5).map(r => ({platform: p, title: r.title})));
  }
  return signals;
}

Expected Output

JSON
Content ideas backed by real demand signals from Google, Reddit, and YouTube search data.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Python 3.8+ installed. requests library installed. A Scavio API key from scavio.dev. An OpenAI or Anthropic API key for LLM synthesis. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Learn how to build an AI agent that researches trending topics across Google, Reddit, and YouTube to generate content ideas backed by real demand signals.