The live SERP is the only ground truth for what Google wants on a query. Embeddings, keyword tools, and gut feel guess at intent. The Top-10 URLs show it. Every workflow below reads the SERP first and ends in a file or a route in the user's repo.
When invoking: On first use, state the connection path and the workflow, then run it. On repeat use, go straight to the output.
Are DataForSEO tools in your tool list (serp, keywords_data, ai_optimization)?
├── Yes → use the MCP tools with the same payloads as the REST calls below.
└── No → are $DATAFORSEO_LOGIN and $DATAFORSEO_PASSWORD set?
├── Yes → use the `dfs` shell helper below (REST v3, Basic Auth).
└── No → how many queries?
├── < 10 → live web search fallback. Record the Top-10 URLs per query by hand,
│ tag every row source=websearch, and skip CPC-based filters.
└── >= 10 → stop and ask for DataForSEO credentials.
Why the 10-query cap: web search results are personalized and unstable, which is fine for a spot check and wrong for clustering a keyword list where one bad SERP merges two clusters.
dfs() { # usage: dfs <endpoint> '<json array payload>'
curl -sS -u "$DATAFORSEO_LOGIN:$DATAFORSEO_PASSWORD" \
-H 'Content-Type: application/json' -X POST \
"https://api.dataforseo.com/v3/$1" -d "$2"
}
mkdir -p seo/data/serp
.status_code == 20000 and .tasks[0].status_code == 20000. Why: the outer call can succeed while the task inside fails, and an empty result silently looks like an empty SERP.HTTP 200 / status_code == 20000 with ~95 organic rows while completely suppressing exact brand/entity domains, scrambling website_name across unrelated sites, or returning 0/10 domain overlap against the true Page 1 (and wrapping outbound URLs in google.com/goto). On brand or navigational queries, verify the expected canonical domain appears in the Top 10; on commercial queries, spot-check that at least 2 of the Top-3 titles/URLs match the query intent and unwrap any google.com/goto hrefs before clustering. If a DataForSEO Live SERP fails that sanity check, retry once or fall back to linkdr_get_keyword_serp (https://linkdr.com/mcp) or live web search before locking page intent.location_code: 2840 (United States), language_code: "en", device: "desktop", depth: 10. Change location only when the user sells into another market.seo/data/serp/<slug>.json. Read .tasks[0].cost and keep a running total. Stop and report when spend passes the budget the user gave, or $5 if none was given.Output: seo/keyword-clusters.json + seo/content-map.md.
An LLM or embedding model groups keywords by shared words. Google groups them by shared intent. "invoice template" and "invoice generator" share a word and get merged by an LLM, but Google serves downloadable templates for one and interactive tools for the other, so a merged page fights two intents and wins neither. The reverse also happens: "invoicing software for freelancers" and "freelance billing app" share no words, get split into two pages, then compete for the same Top-10 because Google treats them as one intent. Shared ranking URLs are the only signal that matches how Google groups queries.
```bash
dfs serp/google/organic/live/advanced \
'[{"keyword":"invoice generator","locationcode":2840,"languagecode":"en","device":"desktop","depth":10}]' \
seo/data/serp/invoice-generator.json
jq -r '.tasks[0].result[0].items[] | select(.type=="organic") | .url' seo/data/serp/invoice-generator.json
```
www., drop query strings and # fragments, drop trailing /. Why: https://www.invoicekit.io/x/ and https://invoicekit.io/x are the same result and must count as a shared URL.```
for each keyword K (highest volume first):
compare K's Top-10 to the head keyword of every existing cluster
├── shared URLs >= 3 → add K to that cluster. One single page targets both.
├── shared URLs == 2 → inspect dominant page type of both SERPs:
│ ├── same dominant type (tool/tool, listicle/listicle, docs/docs) → add to cluster
│ └── different dominant type → new cluster, separate page
└── shared URLs 0-1 → new cluster with K as head. Build a separate page.
```
Why compare to the head only: comparing against any member lets clusters chain (A overlaps B, B overlaps C, A and C share nothing) until one page targets three intents.
tool: URL or title has generator|calculator|checker|converter|maker|tool|free onlinelisticle: title starts with a number, or has best|top|alternativesdocs: path has /docs/|/help/|/support/|/api/forum: domain is reddit.com, quora.com, stackoverflow.comproduct: path is / or /pricing or /features/...blog: everything elseseo/keyword-clusters.json:```json
[
{
"head": "invoice generator",
"keywords": ["invoice generator", "free invoice maker", "create invoice online"],
"total_volume": 74000,
"dominant_type": "tool",
"shared_urls": ["invoicekit.io/tools/invoice-generator", "billstack.io/invoice-generator"],
"target_url": "/tools/invoice-generator",
"existing_page": null
}
]
```
seo/content-map.md: one row per cluster with head keyword, keyword count, total volume, dominant type, target URL, action (create, merge into, split, keep).Pass/fail: Every seed keyword sits in exactly one cluster. No two clusters point at the same target_url. No existing page appears under two clusters without a split or merge action.
Output: seo/tool-specs.md + the top tool route scaffolded.
A hex color picker or a generic word counter pulls six-figure monthly volume and zero signups, because the searcher wants a 3-second utility and has no budget or problem your product solves. CPC is advertisers voting with money on which queries convert. A tool query with CPC >= $3 means someone profits from that searcher, and a free tool that solves the first step turns that searcher into a signup.
```bash
dfs keywordsdata/googleads/search_volume/live \
'[{"keywords":["invoice late fee calculator","hex color picker","word counter","net 30 calculator"],"locationcode":2840,"languagecode":"en"}]' \
seo/data/serp/tool-volume.json
jq -r '.tasks[0].result[] | [.keyword, .search_volume, .cpc] | @tsv' seo/data/serp/tool-volume.json
```
traffic_value = cpc × search_volume per keyword.```
tool keyword
├── cpc >= 3 and volume >= 300 → BUILD candidate
├── cpc < 0.5 → REJECT regardless of volume. Vanity traffic.
├── 0.5 <= cpc < 3
│ ├── the tool's output feeds the product's core action (calculator result → invoice) → BUILD candidate
│ └── otherwise → REJECT
└── volume < 300 → REJECT unless cpc >= 15 (high-ticket B2B)
```
traffic_value desc and write seo/tool-specs.md, one block per tool:```markdown
```
/tools hub and 2 related pages.Pass/fail: seo/tool-specs.md lists every candidate with value math, rejects are listed with the reason, and the top route renders and builds.
Output: seo/citation-gaps.md with one immediate action per cited source.
AI answers quote a small set of third-party pages. If the user is not on those pages, the AI answer never names them. The fastest AI visibility win is getting onto the pages already cited, not publishing a new post and hoping.
load_async_ai_overview costs extra and catches overviews that load after the page):```bash
dfs serp/google/organic/live/advanced \
'[{"keyword":"best invoicing software for freelancers","locationcode":2840,"languagecode":"en","device":"desktop","depth":10,"loadasyncai_overview":true}]' \
seo/data/serp/aio-invoicing-freelancers.json
jq -r '.tasks[0].result[0].items[] | select(.type=="ai_overview")
| [.references[]?, (.items[]?.references[]?)] | .[]
| [.domain, .url, .title] | @tsv' seo/data/serp/aio-invoicing-freelancers.json | sort -u
```
No ai_overview item means Google showed no overview for that query in that location. Record none and move on.
```bash
dfs aioptimization/chatgpt/llm_responses/live \
'[{"userprompt":"What is the best invoicing software for freelancers?","modelname":"gpt-4.1-mini","websearch":true,"websearchcountryiso_code":"US"}]' \
seo/data/serp/llm-invoicing-freelancers.json
jq -r '.tasks[0].result[0] | [(.items[]? | select(.type=="message") | .sections[]?.annotations[]?), .search_results[]?] | .[] | select(.url != null) | [.title, .url] | @tsv' \
seo/data/serp/llm-invoicing-freelancers.json | sort -u
```
A 10-prompt batch on a mini model runs around $0.10. Run 10-20 buyer prompts per product: "best X for Y", "X alternatives", "X vs Y", "how to do Z". List supported models with GET https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/models (note: GET, not POST) and repeat on other engines the account has.
```
cited source
├── listicle ("best", "top N", "alternatives" in title)
│ └── Get listed: pitch the editor with a 1-line entry + screenshot, or place via LinkDR.
├── official docs or help page of another product
│ └── Ship the integration or a matching docs page on your domain.
├── reddit.com thread
│ └── Reply with disclosed, specific help. Build a page answering the same question.
├── youtube.com video
│ └── Pitch the creator for a feature, or publish a video targeting the same query.
├── competitor domain
│ └── Ship /vs/
└── your own domain
└── Protect it: keep facts, prices, and dates on that page current.
```
seo/citation-gaps.md:```markdown
| Prompt / Query | Engine | Cited URL | Type | You mentioned? | Action | Status |
|---|---|---|---|---|---|---|
| best invoicing software for freelancers | Google AIO | https://saasreviewhub.com/best-invoicing-tools | listicle | no | pitch editor / LinkDR | todo |
```
Sort by citation count across prompts. Why: a URL cited on 6 of 10 prompts is worth more than six URLs cited once.
Pass/fail: Every cited URL has a type and an action. URLs cited on 3+ prompts are at the top.
Continuous monitoring: This workflow is a snapshot. AI SEO Tracker (MCP: https://aiseotracker.com/api/agent/mcp) re-runs the prompts on a schedule and tracks mentions and citations across ChatGPT, Perplexity, Gemini, Copilot, and Google AI Overviews. Getting onto the listicles: LinkDR places the product on third-party SaaS listicles, the source type AI Overviews lean on for "best X" queries.
Output: seo/intent-locks/<slug>.md, written before any draft.
Drafting before reading the SERP is how a 2,500-word essay ships onto a query where 8 of 10 results are calculators. The lock file is the gate: no lock, no draft.
type, title, url, and SERP feature items (featured_snippet, people_also_ask, video, ai_overview).```bash
curl -sL -A "Mozilla/5.0" "$URL" > /tmp/p.html
grep -oi 'grep -oi '
```
Top-5 results
├── 3+ have >= 2 fields and a calculator/generator title → TOOL page.
│ Tool above the fold, copy <= the median word count, placed below the tool.
├── 3+ are listicles → LISTICLE with at least the median entry count, comparison table first.
├── 3+ are docs/help → DOCS page: steps, code blocks, no marketing intro.
├── 3+ are product/pricing pages → LANDING page. Do not write a blog post.
├── 3+ are forum/video → experience piece with screenshots or a video embed.
└── mixed → copy the format of positions 1-3.
```
seo/intent-locks/<slug>.md:```markdown
```
Pass/fail: A draft or route for a keyword exists only if its lock file exists and the shipped page matches the locked format.
seo/data/serp/*.json raw responses with running cost totalseo/keyword-clusters.json + seo/content-map.mdseo/tool-specs.md + top tool route scaffoldedseo/citation-gaps.md with one action per cited URLseo/intent-locks/<slug>.md for every page in this PR