Skip to main content

How I automate keyword research with Claude and DataForSEO (the €0 Ahrefs alternative)

June 23, 2026
7 min read
ai-automationclaude-codekeyword-research-aiseo-automationdataforseo

Ahrefs sits at €449/month for the entry plan I'd actually use. Semrush is €459. For a solo operator that's almost a thousand euros a month in tools before you've written a single brief.

Here's the workflow that replaced both for me. Claude Code drives it, DataForSEO supplies the data, and the total cost lands around €8–15/month for the volume of research a one-person shop actually does. Game-changing Not magic. Just the right pieces in the right order.

What this workflow actually does

End-to-end, in one Claude Code session:

  1. Seed → expansion. Feed it a topic ("ai keyword research"). It pulls 200–500 related keywords from DataForSEO's keywords_for_keywords endpoint.
  2. Volume + difficulty. Hits search_volume and keyword_difficulty, batched. Costs about €0.0006 per keyword.
  3. SERP feature read. For the top 30, it pulls serp/organic/live/advanced to see which ones have AI Overviews, People Also Ask, featured snippets, video carousels.
  4. Clustering. Claude reads the SERP overlap matrix and groups keywords that share top-10 results — those are siblings that one post can target.
  5. Brief output. One Markdown file per cluster with primary keyword, supporting keywords, search intent, SERP features, suggested H2s, and FAQ candidates.

Total run time: 8–12 minutes for a 200-keyword expansion. Total cost: usually under €0.20 per topic.

The setup (one-time, 20 minutes)

You need three things:

  • Claude Code installed (or any agent harness that runs MCP servers — Cursor works, so does the API directly).
  • A DataForSEO account. Pay-per-call, no subscription. Sign up, top up €10, you're done for the month.
  • The DataForSEO MCP server. Official one, runs locally, reads your API key from env.

Config block for ~/.config/claude/mcp.json:

{
  "mcpServers": {
    "dataforseo": {
      "command": "npx",
      "args": ["@dataforseo/mcp-server"],
      "env": {
        "DATAFORSEO_LOGIN": "your-login",
        "DATAFORSEO_PASSWORD": "your-password"
      }
    }
  }
}

Restart Claude Code. Type /mcp. If dataforseo shows up in the list with green tools, you're set.

The actual prompt

This is the version I'm running today. Tweaked over about ten iterations. Copy it and adjust the persona block to match your voice.

Topic: "{topic}"
Country: "United States"
Language: "en"

Your job: produce a clustered keyword research deliverable.

Step 1: Call dataforseo.keywords_for_keywords with the topic.
  - Set limit to 300.
  - Return only keywords with monthly search volume >= 10.

Step 2: For the top 100 by volume, call dataforseo.search_volume
  to confirm volumes. Cache results.

Step 3: For the top 30 by volume, call dataforseo.serp.organic.live.advanced.

Record: top 10 organic URLs, presence of AI Overview, PAA, featured snippet,
  video pack.

Step 4: Cluster the top 30 by SERP URL overlap. Two keywords are siblings
  if they share 4+ URLs in their top 10.

Step 5: For each cluster (max 5 clusters), output a Markdown brief with:
  - Primary keyword (highest volume in cluster)
  - 4-8 secondary keywords
  - Search intent (informational / navigational / commercial / transactional)
  - SERP features present
  - 5 suggested H2s based on PAA + top-ranking H2 patterns
  - 5 FAQ candidates lifted from PAA

Write all output to ./briefs/{topic-slug}/

No summary. No "here's what I did." Just the files.

That last line matters. Without it, Claude wraps the output in 400 words of "I've successfully completed the analysis and would be happy to provide further insights." Cut it.

What the output actually looks like

Run it on a topic like "content briefs" and you get something like this in briefs/content-briefs/cluster-1.md:

# Cluster 1: AI content briefs

Primary: ai content brief (210/mo, KD 32)
Secondary:
  - content brief template ai (90/mo, KD 28)
  - claude content brief (40/mo, KD 18)
  - automate content briefs (30/mo, KD 22)
  - ai brief generator (180/mo, KD 35)

Intent: informational + commercial
SERP features: AI Overview (3/5 queries), PAA (5/5), Featured Snippet (2/5)

Suggested H2s:
  - What goes in an AI-generated content brief
  - How AI content briefs compare to agency briefs
  - Tools that generate content briefs (and what they miss)
  - The prompt structure that actually works
  - Where AI content briefs still fail

FAQ candidates (lifted from PAA):
  - What is an AI content brief?
  - Can ChatGPT write a content brief?
  - How long should a content brief be?
  - Is an AI content brief as good as a human one?
  - How much does an AI content brief cost?

That brief is what I hand to the writing stage. The H2s aren't gospel — they're a starting point informed by what's actually ranking. The FAQ candidates lift directly into FAQ schema for the post.

What it costs in real numbers

Running the workflow on five topics this past week:

TopicKeywords processedAPI callsCost
content briefs247~340€0.18
internal linking198~290€0.16
llms.txt62~95€0.06
schema markup312~410€0.22
canonical urls184~265€0.14

Total for five briefs: €0.76. Ahrefs would have charged me a flat €449 for the month. The math isn't subtle.

Where it breaks

Three things to watch:

1. DataForSEO's keyword_difficulty is approximate. It's a 0–100 score, fine for relative comparisons inside a cluster, less reliable as an absolute. I treat it as "easy / medium / hard" buckets, not a precise number.

2. SERP feature detection lags. AI Overviews especially — they appear and disappear from results. If the rank check ran an hour ago, the AI Overview flag might already be stale. I re-check anything I'm targeting within 48 hours of writing.

3. The clustering is only as good as the SERP overlap window. Two siblings might share zero URLs at top 10 but have huge intent overlap at positions 11–30. I sometimes manually merge clusters when I read the briefs. The script is a draft, not the final cut.

Why this beats the SaaS option for a solo operator

It's not because the SaaS is bad. Ahrefs has a better UI than Claude Code will ever have for this. It's that the SaaS sells you the whole tool when you only need the pieces. For me, that's keyword expansion + SERP read + clustering.

The €449/mo plan also gives me backlink data, site audits, content explorer, rank tracking, alerts, and team seats — all of which I don't need, but I'm paying for.

The Claude + DataForSEO setup costs me about €15/month at my current research volume. That's a savings of roughly €430/month, or €5,160/year. That's a freelance hire's monthly retainer. It's not nothing.

And if I scale up — start running daily SERP monitoring for 200 keywords, doing competitor backlink pulls, the whole thing — DataForSEO's pay-per-call model scales with usage, not with seat count. The break-even is somewhere around 50,000 keyword lookups per month, which is several full-time SEO operators' worth of work.

The next steps in the pipeline

This is one piece. The next post in this pillar (W5 — coming soon) covers the content brief pipeline that consumes the output of this workflow. After that: schema generation, internal link audits, monitoring. Each piece replaces a SaaS subscription with a Claude prompt and an API key.

If you want the actual prompt file (cleaner than the snippet above, with the error handling I learned to add), it lives in the Brain Dumps queue — drop me a line via contact and I'll send it directly. No email gate, just a normal reply.

FAQ

Is Claude good enough for SEO keyword research?

For the analysis layer, yes. Claude doesn't know search volumes — it can't, that data isn't in its training set in a fresh-enough way. But it's excellent at the steps DataForSEO doesn't help with: clustering, intent classification, lifting FAQ candidates, drafting briefs. You need both.

How much does DataForSEO actually cost per query?

Pricing varies by endpoint. search_volume is around €0.0001 per keyword. serp/organic/live/advanced is around €0.002 per query. A typical 300-keyword expansion costs €0.10–€0.30 end-to-end.

Can I do this without an API key (free)?

You can do parts of it. Claude can scrape Google directly with WebFetch, but it's slow, unreliable, and against Google's TOS at scale. For 5–10 keywords on a one-off, sure. For an actual workflow, get the API key.

Does Claude hallucinate keywords?

It can — but only if you let it. The structure of the prompt above forces it to call DataForSEO before doing anything else, so the keyword list is grounded in real API data. The clustering and intent steps are interpretive and can drift, which is why the output is a draft, not a final brief.

What about Ahrefs API as the data source instead?

Ahrefs has an API and it's excellent. It also requires a minimum €450/month plan. The whole point of this workflow is to avoid that. DataForSEO is the cheapest reliable alternative I've found for SEO data.

How is this different from just using ChatGPT?

The big one: this workflow gives Claude tools (MCP servers) so it can pull real data. ChatGPT can do similar things with custom GPTs and Actions, but the MCP setup with Claude Code is more flexible — you can chain multiple servers, run them locally, and inspect every API call in the terminal. For a workflow you'll run weekly, that visibility matters.

Topics:ai-automationclaude-codekeyword-research-aiseo-automationdataforseo

Found This Useful?

Share it with someone who might learn from my mistakes!