DataForSEO Google SERP Advanced Live
Fetches live Google organic search results with full SERP feature extraction.
Quick Start
python scripts/fetch.py --keyword "your keyword" --location 2276 --language de
Script Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--keyword |
Yes | - | Search query (max 700 chars) |
--location |
* | - | Location code (e.g., 2276 for Germany) |
--location-name |
* | - | Location name (e.g., "Germany") |
--language |
No | en | Language code (e.g., de, en, fr) |
--language-name |
No | - | Language name (e.g., "German") |
--device |
No | desktop | desktop or mobile |
--os |
No | windows | windows/macos (desktop) or android/ios (mobile) |
--depth |
No | 10 | Results to fetch (max 200) |
--target |
No | - | Filter to target domain (e.g., "example.com*") |
--se-domain |
No | - | Custom SE domain (e.g., "google.de") |
--tag |
No | - | Task identifier (max 255 chars) |
--max-crawl-pages |
No | - | Page crawl limit (max 100) |
--ai-overview |
No | false | Load AI overview (extra $0.002) |
--paa-depth |
No | 0 | People Also Ask click depth (1-4, extra charge) |
--output |
No | auto | Custom output path |
*Either --location or --location-name required (code preferred if both given).
Common Location Codes
| Country | Code |
|---|---|
| Germany | 2276 |
| United States | 2840 |
| United Kingdom | 2826 |
| France | 2250 |
| Spain | 2724 |
| Italy | 2380 |
| Austria | 2040 |
| Switzerland | 2756 |
Examples
Using codes:
python scripts/fetch.py --keyword "beste laufschuhe" --location 2276 --language de
Using names:
python scripts/fetch.py --keyword "best running shoes" --location-name "Germany" --language-name "German"
Mobile SERP with depth:
python scripts/fetch.py --keyword "weather forecast" --location-name "United States" --device mobile --depth 50
Custom output path:
python scripts/fetch.py --keyword "seo tools" --location 2276 --language de --output output/serp_seo_tools.json
Target filtering (find your domain's rankings):
python scripts/fetch.py --keyword "seo software" --location 2840 --target "example.com*" --depth 100
Custom search engine domain:
python scripts/fetch.py --keyword "schuhe kaufen" --location 2276 --se-domain "google.de"
Target Patterns
| Pattern | Description |
|---|---|
example.com |
Home page only |
example.com* |
Entire domain (all pages) |
*example.com* |
Domain + all subdomains |
*example.com |
Home page on any subdomain |
example.com/page* |
URLs starting with path |
Output
Returns JSON with:
keyword,location_code,language_codese_results_count- Total results founditem_types- SERP features present (organic, featured_snippet, people_also_ask, etc.)items- Array of SERP elements with type, position, title, url, description, etc.
Pricing Notes
- Base cost per SERP (up to 10 results)
- Extra charges: depth >10, special operators (site:, filetype:), people_also_ask clicks
- Rate limit: 2000 calls/minute
Environment Variables
Requires in .env:
DATAFORSEO_LOGIN=your_login
DATAFORSEO_PASSWORD=your_password