Appearance
Google AI Mode SERP Fresh
Google AI Mode is Google's AI-powered search experience that replaces the traditional SERP with a conversational, AI-generated response. The DataForSEO AI Mode SERP API scrapes these results, giving you structured access to the AI-generated content, source citations, and follow-up query suggestions.
Availability
AI Mode is only available in certain countries. Check Google Search Help for the current list of supported countries before setting tasks. If a task is submitted for a country where AI Mode is unavailable, the task may return no results or an error.
Endpoint Summary
| Method | Endpoint |
|---|---|
| Live Advanced | POST /v3/serp/google/ai_mode/live/advanced |
| Live HTML | POST /v3/serp/google/ai_mode/live/html |
| Standard Task POST | POST /v3/serp/google/ai_mode/task_post |
| Standard Task GET Advanced | GET /v3/serp/google/ai_mode/task_get/advanced/{id} |
| Standard Task GET HTML | GET /v3/serp/google/ai_mode/task_get/html/{id} |
| Tasks Ready | GET /v3/serp/google/ai_mode/tasks_ready |
Device Support
| Device | Available OS |
|---|---|
| Desktop | Windows, macOS |
| Mobile | Android, iOS |
Live Advanced Endpoint
The primary endpoint for real-time AI Mode results.
POST https://api.dataforseo.com/v3/serp/google/ai_mode/live/advancedEach Live call can contain only one task. Charged per request.
Parameters
Required
| Field | Type | Description |
|---|---|---|
keyword | string | Search query. Max 700 characters. URL-encode % as %25, + as %2B. |
location_code | integer | Location code. Required if location_name not set. Check country availability for AI Mode. |
language_code | string | Language code. Required if language_name not set. See /v3/serp/google/ai_mode/languages for available values. |
Optional
| Field | Type | Default | Description |
|---|---|---|---|
device | string | desktop | desktop or mobile |
os | string | windows / android | Desktop: windows, macos. Mobile: android, ios. |
depth | integer | — | Number of results. Billed per 20 results (desktop) or per 10 results (mobile). |
tag | string | — | Custom task identifier (max 255 chars) |
postback_url | string | — | Receive results via POST when complete |
pingback_url | string | — | Notify this URL on completion |
location_name | string | — | Full location name (alternative to location_code) |
language_name | string | — | Full language name (alternative to language_code) |
calculate_rectangles | boolean | false | Return pixel positions for SERP elements. Multiplies cost by 2. |
browser_screen_width | integer | 1920 (desktop) / 360 (mobile) | Custom screen width in pixels (range: 240–9999). Requires calculate_rectangles: true. |
browser_screen_height | integer | 1080 (desktop) / 640 (mobile) | Custom screen height in pixels (range: 240–9999). Requires calculate_rectangles: true. |
browser_screen_resolution_ratio | integer | — | Screen resolution ratio. Requires calculate_rectangles: true. |
Depth Billing
AI Mode bills differently from standard organic SERP:
- Desktop: billed per 20 results
- Mobile: billed per 10 results
Example Requests
curl
bash
login="your_login"
password="your_password"
cred="$(printf ${login}:${password} | base64)"
curl --location --request POST \
"https://api.dataforseo.com/v3/serp/google/ai_mode/live/advanced" \
--header "Authorization: Basic ${cred}" \
--header "Content-Type: application/json" \
--data '[{
"keyword": "best roofing contractor near me",
"location_code": 2840,
"language_code": "en",
"device": "desktop"
}]'Python
python
import requests
from requests.auth import HTTPBasicAuth
import json
login = "your_login"
password = "your_password"
url = "https://api.dataforseo.com/v3/serp/google/ai_mode/live/advanced"
payload = [{
"keyword": "best roofing contractor near me",
"location_code": 2840,
"language_code": "en",
"device": "desktop"
}]
response = requests.post(
url,
auth=HTTPBasicAuth(login, password),
json=payload
)
result = response.json()
for task in result.get("tasks", []):
for res in task.get("result", []):
print("AI Mode items:")
for item in res.get("items", []):
item_type = item.get("type")
print(f" type: {item_type}")
if item_type == "ai_mode_response":
print(f" text: {item.get('text', '')[:300]}")
if item_type == "ai_mode_source":
print(f" source: {item.get('title')} — {item.get('url')}")Standard Method with Callback (Python)
python
import requests
from requests.auth import HTTPBasicAuth
login = "your_login"
password = "your_password"
url = "https://api.dataforseo.com/v3/serp/google/ai_mode/task_post"
payload = [{
"keyword": "emergency roof repair",
"location_code": 2840,
"language_code": "en",
"device": "desktop",
"postback_url": "https://yourserver.com/webhooks/dataforseo",
"postback_data": "advanced"
}]
response = requests.post(
url,
auth=HTTPBasicAuth(login, password),
json=payload
)
task_id = response.json()["tasks"][0]["id"]
print(f"Task set: {task_id}")
# Results will be POSTed to postback_url when readyPHP
php
<?php
$client = new RestClient('https://api.dataforseo.com/', null, 'your_login', 'your_password');
$post_array = [[
'keyword' => 'best roofing contractor near me',
'location_code' => 2840,
'language_code' => 'en',
'device' => 'desktop'
]];
$result = $client->post('/v3/serp/google/ai_mode/live/advanced', $post_array);
print_r($result);
?>Response Structure
json
{
"tasks": [
{
"id": "01010101-0101-0101-0101-010101010101",
"status_code": 20000,
"status_message": "Ok.",
"result": [
{
"keyword": "best roofing contractor near me",
"type": "ai_mode",
"se_domain": "google.com",
"location_code": 2840,
"language_code": "en",
"device": "desktop",
"check_url": "https://www.google.com/search?q=best+roofing+contractor+near+me&udm=50&...",
"items_count": 5,
"items": [
{
"type": "ai_mode_response",
"rank_group": 1,
"rank_absolute": 1,
"text": "When looking for a roofing contractor near you, it's important to...",
"sources": [
{
"title": "How to Choose a Roofing Contractor",
"url": "https://example.com/roofing-tips",
"domain": "example.com"
}
]
},
{
"type": "ai_mode_source",
"rank_group": 1,
"rank_absolute": 2,
"title": "Top-Rated Roofing Companies Near You",
"url": "https://contractor-directory.com/roofing",
"domain": "contractor-directory.com",
"description": "Find licensed and insured roofing contractors..."
},
{
"type": "ai_mode_follow_up_query",
"rank_group": 1,
"rank_absolute": 5,
"title": "How much does roof replacement cost?"
}
]
}
]
}
]
}Key Response Fields
| Field | Type | Description |
|---|---|---|
type | string | Item type — see element types table below |
rank_group | integer | Position within the element group |
rank_absolute | integer | Absolute position across all items |
text | string | AI-generated response text (ai_mode_response items) |
sources | array | Cited source objects within an AI response block |
title | string | Page title for source items or follow-up query text |
url | string | Source URL |
domain | string | Root domain of the source |
description | string | Snippet or description text |
check_url | string | Google URL to verify the AI Mode results in browser |
AI Mode Element Types
| Type | Description |
|---|---|
ai_mode_response | The primary AI-generated answer block |
ai_mode_source | A source citation listed below the AI response |
ai_mode_follow_up_query | Suggested follow-up questions from the AI |
ai_mode_product | Product card shown within an AI Mode response |
ai_mode_local | Local business shown within an AI Mode response |
Cost Notes
- AI Mode costs vary from standard organic SERP — check the pricing page for current rates
calculate_rectangles: truemultiplies cost by 2- Depth is billed per 20 results (desktop) or 10 results (mobile)