How to Track People Also Ask and SERP Features with Python
People also ask gives you questions, never answers. Here is a Python tracker that snapshots those questions, the knowledge panel, ads and videos daily with the JustSERP API, then diffs two days.
People also ask looks like a list of answers, but the API only gives you the questions. Google loads the answers when a searcher clicks one open, so there is nothing to scrape until then. That turns out to be fine, because the questions are the part worth tracking: they show what searchers want next, and they change more often than your rankings do. Here is a Python tracker that snapshots those questions, the knowledge panel, the ads and the video carousel every day, then diffs two days.

Why track SERP features
A new "People also ask" question is a content idea handed to you for free. A knowledge panel appearing for your brand is worth knowing about the day it happens. A new advertiser, or a video carousel pushing organic results down the page, changes the traffic you can expect from the same position. A plain rank tracker misses all of this, but it is all in the JSON the JustSERP API returns.
One detail makes the comparison fair: we always ask Google for unfiltered, non-personalised results (filter=0 and pws=0). You see the full list without "similar results omitted", and your own search history cannot change what shows up. Two snapshots taken a day apart differ because Google changed the page, not because of who asked.
What you need
- Python 3.9 or newer and the
requestspackage (pip install requests). - A JustSERP API key. Sign up and copy it from your dashboard.
export JUSTSERP_API_KEY="your-key-here"Run the tracker on a server, a laptop or a scheduled job, never in browser code, so the key stays private.
How the tracker works
Once a day the script sends one request per keyword. From each response it keeps only the parts that matter, saves them to a dated JSON file, and compares that file with the previous one.

Each request that returns results uses one API call, so tracking 50 keywords daily costs 50 calls a day. Every search is a fresh fetch from Google. Nothing is served from a cache on our side, so two runs a minute apart really are two looks at the page.
Which fields to watch

Every block below only appears when Google showed it for that search, so the code always falls back to an empty value. An empty list on one day is real information: the feature was not there. Four details save you from misreading the data:
related_questionsis a list of question texts. There are no answers and no links behind them.paid_adsis one list in page order. There is no flag that says whether an ad sat above or below the results, so track who is in the list, not where on the page it was.knowledge_graphcan be present with an empty title, so we store the title and treat an empty one as "no panel".inline_videosandtotalResultsare never returned for mobile searches. If you track mobile, a missing video block is not the same as a video carousel that went away.
| Response field | What it tells you | What we store |
|---|---|---|
related_questions | The "People also ask" questions | The list of questions |
knowledge_graph | The knowledge panel | Its title |
paid_ads | Advertisers on the page, in page order | The ad links |
inline_videos | The video carousel (desktop only) | The video sources |
organic_results | The ranking pages | The top 10 links, in order |
Taking a snapshot
First, a helper that calls the API, and a function that boils a response down to a compact record. The timeout is 90 seconds on purpose. When Google pushes back, we retry the fetch before giving up, so a hard query can take well over 30 seconds. If your client hangs up first, the call is still counted and you lose the answer.
import os
import requests
API_URL = "https://api.justserp.com/v1/search"
API_KEY = os.environ["JUSTSERP_API_KEY"]
def search(keyword, **options):
response = requests.post(
API_URL,
headers={"X-API-Key": API_KEY},
json={"keyword": keyword, **options},
timeout=90,
)
response.raise_for_status()
return response.json()
def summarize(data):
knowledge = data.get("knowledge_graph") or {}
return {
"related_questions": data.get("related_questions") or [],
"knowledge_graph": knowledge.get("title") or None,
"paid_ads": [ad.get("link") for ad in data.get("paid_ads") or []],
"inline_videos": [v.get("source") for v in data.get("inline_videos") or []],
"organic_top10": [r.get("link") for r in (data.get("organic_results") or [])[:10]],
}
Next, run it for the whole keyword list and write one file per day. A small thread pool keeps it fast. Five workers is a safe choice, well below the 10 requests in flight that the Free and Personal plans allow.
import json
from concurrent.futures import ThreadPoolExecutor
from datetime import date
from pathlib import Path
SNAPSHOT_DIR = Path("snapshots")
KEYWORDS = ["project management software", "crm for small business", "invoice app"]
def snapshot_one(keyword):
try:
return keyword, summarize(search(keyword))
except requests.RequestException as err:
print(f"skipped {keyword!r}: {err}")
return keyword, None
def take_snapshot(keywords, **options):
SNAPSHOT_DIR.mkdir(exist_ok=True)
with ThreadPoolExecutor(max_workers=5) as pool:
pairs = list(pool.map(snapshot_one, keywords))
snap = {keyword: record for keyword, record in pairs if record is not None}
path = SNAPSHOT_DIR / f"{date.today().isoformat()}.json"
path.write_text(json.dumps(snap, indent=2, ensure_ascii=False), encoding="utf-8")
return path
Failed keywords are skipped rather than stored as empty records, so a network hiccup is never mistaken for "the features disappeared". A 500 response does not use a call, so you can simply run the script again.
Diffing two days
Because every snapshot is plain JSON, comparing two days is set arithmetic. Questions and links are compared as sets; the top 10 is also checked as an ordered list. Remember that position restarts at 1 on every results page. This tracker only reads page one, so the order of the list is the rank, but if you ever fetch page 2, the absolute rank is (page - 1) * 10 + position.
def load(path):
return json.loads(Path(path).read_text(encoding="utf-8"))
def diff_lists(old, new):
return sorted(set(new) - set(old)), sorted(set(old) - set(new))
def diff_snapshots(old_snap, new_snap):
for keyword, new in new_snap.items():
old = old_snap.get(keyword)
if old is None:
continue # first time we see this keyword
lines = []
for field in ("related_questions", "paid_ads", "inline_videos"):
added, removed = diff_lists(old[field], new[field])
lines += [f" + {field}: {item}" for item in added]
lines += [f" - {field}: {item}" for item in removed]
if old["knowledge_graph"] != new["knowledge_graph"]:
lines.append(f" knowledge panel: {old['knowledge_graph']} -> {new['knowledge_graph']}")
if old["organic_top10"] != new["organic_top10"]:
entered, left = diff_lists(old["organic_top10"], new["organic_top10"])
lines += [f" + entered top 10: {link}" for link in entered]
lines += [f" - left top 10: {link}" for link in left]
if lines:
print(keyword)
print("\n".join(lines))
Running it every day
Tie the two halves together: take today's snapshot, find the newest earlier file, and print the differences.
if __name__ == "__main__":
today = take_snapshot(KEYWORDS)
earlier = sorted(p for p in SNAPSHOT_DIR.glob("*.json") if p != today)
if earlier:
diff_snapshots(load(earlier[-1]), load(today))
else:
print("First snapshot saved. Run again tomorrow to see changes.")
Schedule it with cron (0 7 * * * python3 /path/to/tracker.py) or Windows Task Scheduler. A typical diff looks like this:
crm for small business
+ related_questions: Is a CRM worth it for a small business?
- paid_ads: https://example-ads.com/crm
+ inline_videos: YouTubeTracking a specific market or device
Features differ by place and device, so pass the same options to take_snapshot. Country and language take full English names, for example take_snapshot(KEYWORDS, country="Canada") or country="United Kingdom", language="English". Codes such as "UK" or "de" are not recognised. An unrecognised name quietly falls back to United States and English, and the request still uses a call. When results look wrong for a market, check meta.googleURL in the response to see what we actually asked Google for.
Use device="mobile" to watch phone results, and location (for example "Austin,Texas,United States") for city-level features such as local ads. Location is not validated. A misspelled place name is not rejected, Google just ignores it and you get non-local results, and the call is used. Stick to Google's canonical "City,Region,Country" form. If you track several variations, put them in the snapshot file name, or one will overwrite the other.
Turning the diffs into decisions
A report is only useful if it leads to action. A few patterns are worth acting on:
- A new question appears in several keywords. It is a content gap. Answer it on a page of your own, with a clear heading that repeats the question. You will have to write the answer yourself, since the box only gives you the question.
- A video carousel appears for a keyword you rank for. Organic results sit lower on the page, so expect a change in clicks, and consider whether a video of your own makes sense.
- A new advertiser shows up. Check which keywords it targets and whether your own page still holds its position.
- A knowledge panel appears or changes. Make sure the facts it shows about your brand or product are correct.
You can also send the diff output to email or a chat channel from the same script, so the people who care read it without opening a file.
Habits that keep the data clean
- Snapshot once a day at a fixed hour. Comparing a morning run with an evening run adds noise.
- Treat an empty block as data, not an error. Google shows these features only when it chooses to.
- Keep the raw files. A folder of JSON snapshots lets you answer questions later that you did not plan for, such as how long a question stayed in the box.
- Expect some churn. People also ask changes often, so look at trends over weeks rather than reacting to one day.
- Keep the key in an environment variable and out of your repository.
Next steps
You now have a daily record of the SERP features that matter for your keywords. Create a free account for 2,000 free requests, no credit card needed, and see the pricing when you want to track more keywords. New to the API? Start with the Python guide to the JustSERP API.