DataForSEO SERP Collection Starter Notebook
Almost every SERP-based workflow I teach starts the same way: you need the search results for a list of keywords, in a table you can actually analyse. This free Google Colab notebook is that first step. It connects to the DataForSEO SERP API with Python, pulls Google results for your keywords and flattens the JSON into tidy tables: organic results, SERP features, People Also Ask questions, AI Overview citations and related searches.
Who it’s for
SEOs and marketers who are new to SERP APIs, and anyone who wants a clean, reusable data layer for clustering, intent classification or AI Overview tracking without paying for another SaaS seat.
How to use it
- Open the notebook in Colab and run it once with
USE_SAMPLE = True. It replays three real SERPs, so you can see every output before spending anything. - Choose your settings: Live mode (results in seconds) or Standard mode (queued, under a third of the price), plus location, language, device and a spend cap.
- Paste your keywords or load a CSV. The notebook trims, lower-cases and removes duplicates so you never pay twice for the same SERP.
- Check the cost estimate, which is a worst-case figure for the whole run.
- Add your DataForSEO login and API password as Colab secrets (your API credentials are read at runtime and never saved in the notebook), set
USE_SAMPLE = Falseand run the collection. - Review the tables and download the CSVs or the Excel workbook for Google Sheets.
What you get
organic.csvwith organic position, absolute position, domain, URL, title and snippet- A keyword-by-feature table showing which SERPs have AI Overviews, People Also Ask, videos and more
paa.csvandai_overview_citations.csv, ready for question mining and citation analysis- A cost log with the price DataForSEO charged for every call
dataforseo_serp.py, a small commented helper you can reuse in your own scripts
Costs and limits
You need a DataForSEO account. At October 2026 list prices, Live mode costs about $0.002 per keyword for the top 10 and Standard mode about $0.0006, plus a small AI Overview surcharge that is refunded when there’s nothing extra to load. So 100 keywords cost at most around $0.40 in Live mode. The notebook refuses any paid call that could take the run over your spend cap.
A SERP is one snapshot for one location, language and device, so treat a single pull as a starting point and track over time before drawing conclusions. Prices change, so check DataForSEO’s pricing page before a large run.
Next, track AI Overviews for your own domain with the companion AI Overview Tracker, or take the SERP data further in the Semantic AI-powered SEO Keyword Research course.
What’s included
- Live Advanced or Standard (task_post + task_get) collection with DataForSEO API v3
- Worst-case cost estimate before you run, a spend cap checked before every paid call, and a per-call cost log
- Flattens the JSON into organic, SERP features, People Also Ask, AI Overview citations and related searches
- Runs end to end on three real saved SERPs with no API key
- Exports CSVs plus a Google Sheets-ready Excel workbook
Where this resource is used on MLforSEO
Walkthroughs on the blog
Concepts behind it
More keyword research resources
- No-Code TemplateTopical Map Template and Generator Based on the EAV Model (Google Sheets)
- No-Code TemplateKeyword Mapping Template with Intent and Cannibalisation Flags (Google Sheets)
- Coding Script or NotebookFree Keyword Clustering Tool (SERP-Overlap + Embeddings Hybrid)
- Coding Script or NotebookYouTube Keyword and Tag Research Notebook (Autocomplete + Competitor Tags)
- No-Code TemplateGoogle Sheets Formulas for SEO Keyword Research and Content Analysis (Copyable, Tested)
- Coding Script or NotebookMulti-Dimension Query Classifier: Rule-Based Colab Notebook and Google Sheets Template
See all 22 keyword research resources →See all 17 content analysis resources →See all 42 coding script or notebook resources →


