DEV Community

dodou
dodou

Posted on

Mine people_also_ask and related_searches for Free Content Ideas

Every SERP you fetch for a client or a report comes with free homework attached: the People Also Ask box and the Related searches strip at the bottom. Most pipelines throw both away. They shouldn't — one is Google telling you exactly which questions its users ask around your topic, the other is a list of adjacent queries worth ranking for. This post adds a small mining layer to an existing SERP pipeline.

What the API gives you

Alongside organic, a search response may carry two optional modules: people_also_ask — an array of question/answer/source entries — and related_searches — a plain array of query strings. Their presence varies per query, so treat both as "maybe there": check before iterating, and when in doubt, store the raw JSON first and model later. Shapes and conditions are defined in the SerpBase search endpoint docs.

The miner

import json, pathlib, requests

API = "https://api.serpbase.dev/google/search"
KEY = "你的 API Key"
SEEDS = ["mechanical keyboard", "mechanical keyboard vs membrane",
         "quiet keyboard for office"]

def fetch(q: str) -> dict:
    resp = requests.post(API,
        headers={"X-API-Key": KEY, "Content-Type": "application/json"},
        json={"q": q, "hl": "en", "gl": "us"}, timeout=30)
    data = resp.json()
    if data.get("status") != 0:
        raise RuntimeError(f"{q}: {data.get('error')}")
    return data

paa, related = {}, set()
for q in SEEDS:
    data = fetch(q)
    # PAA 条目字段以实际返回为准:先原样存,再按需读取 question/title
    paa[q] = data.get("people_also_ask", [])
    for s in data.get("related_searches", []):
        related.add(s.strip().lower())
    print(f"{q}: paa={len(paa[q])} related={len(data.get('related_searches', []))}")

pathlib.Path("paa_raw.json").write_text(
    json.dumps(paa, ensure_ascii=False, indent=1), encoding="utf-8")
pathlib.Path("related.txt").write_text("\n".join(sorted(related)), encoding="utf-8")
print(f"去重后相关搜索 {len(related)}")
Enter fullscreen mode Exit fullscreen mode

The raw PAA dump is deliberate: item fields aren't frozen in the docs, so saving the JSON as-is means schema drift costs you a re-read, not a re-crawl. Second-round seeds come straight from related.txt — each fetched query hands you the next three.

Two outputs, two uses

Output What it is Feed it into
paa_raw.json Real questions users ask, with context FAQ sections, headings, "answering the next question" internal links
related.txt Adjacent queries Google associates with your seeds Keyword clustering, gap analysis seeds, topic clusters

The two compose: cluster the related queries first (they define the topic space), then place PAA questions as sub-headings inside each cluster's page. A page that answers the cluster's main query and the three questions under it earns sitelinks-sized coverage from one URL.

Cost discipline

One fetch per seed = 1 credit. Ten seeds plus a second round of ten = 20 credits — a rounding error at pack prices ($0.50/1k entry, $0.30/1k at the top tier; the $3/month Starter Boost's 10,000 searches would fund 500 rounds). The 100-search free trial covers this entire workflow several times over.

Two mistakes to avoid

  1. PAA from page 1 only. Results shift between pages and hl/gl settings; if your audience is multilingual, mine each market separately — the questions genuinely differ.
  2. Treating related searches as long-tail gold without filtering. They include navigational junk (brand names, "login", "download") and near-duplicates. Dedupe, drop anything containing your competitors' brands, and cluster what survives.

FAQ

Do PAA answers come from my competitors? Often, yes — the source links point at pages Google trusts for that question. That's competitive intel: note who answers what, and where their answer is thin.

How often should I re-mine? PAA rotates faster than organic rankings. Monthly for stable topics; before starting any new content cluster, always.

Can I fetch PAA for a page instead of a query? No — modules attach to queries. Pick the query your page targets, not the page itself.

Run ten seeds tonight and you'll have a month of FAQ headings queued — from Google, for the price of a coffee refill.

Top comments (0)