Skip to content

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

MethodEndpoint
Live AdvancedPOST /v3/serp/google/ai_mode/live/advanced
Live HTMLPOST /v3/serp/google/ai_mode/live/html
Standard Task POSTPOST /v3/serp/google/ai_mode/task_post
Standard Task GET AdvancedGET /v3/serp/google/ai_mode/task_get/advanced/{id}
Standard Task GET HTMLGET /v3/serp/google/ai_mode/task_get/html/{id}
Tasks ReadyGET /v3/serp/google/ai_mode/tasks_ready

Device Support

DeviceAvailable OS
DesktopWindows, macOS
MobileAndroid, iOS

Live Advanced Endpoint

The primary endpoint for real-time AI Mode results.

POST https://api.dataforseo.com/v3/serp/google/ai_mode/live/advanced

Each Live call can contain only one task. Charged per request.

Parameters

Required

FieldTypeDescription
keywordstringSearch query. Max 700 characters. URL-encode % as %25, + as %2B.
location_codeintegerLocation code. Required if location_name not set. Check country availability for AI Mode.
language_codestringLanguage code. Required if language_name not set. See /v3/serp/google/ai_mode/languages for available values.

Optional

FieldTypeDefaultDescription
devicestringdesktopdesktop or mobile
osstringwindows / androidDesktop: windows, macos. Mobile: android, ios.
depthintegerNumber of results. Billed per 20 results (desktop) or per 10 results (mobile).
tagstringCustom task identifier (max 255 chars)
postback_urlstringReceive results via POST when complete
pingback_urlstringNotify this URL on completion
location_namestringFull location name (alternative to location_code)
language_namestringFull language name (alternative to language_code)
calculate_rectanglesbooleanfalseReturn pixel positions for SERP elements. Multiplies cost by 2.
browser_screen_widthinteger1920 (desktop) / 360 (mobile)Custom screen width in pixels (range: 240–9999). Requires calculate_rectangles: true.
browser_screen_heightinteger1080 (desktop) / 640 (mobile)Custom screen height in pixels (range: 240–9999). Requires calculate_rectangles: true.
browser_screen_resolution_ratiointegerScreen 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 ready

PHP

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

FieldTypeDescription
typestringItem type — see element types table below
rank_groupintegerPosition within the element group
rank_absoluteintegerAbsolute position across all items
textstringAI-generated response text (ai_mode_response items)
sourcesarrayCited source objects within an AI response block
titlestringPage title for source items or follow-up query text
urlstringSource URL
domainstringRoot domain of the source
descriptionstringSnippet or description text
check_urlstringGoogle URL to verify the AI Mode results in browser

AI Mode Element Types

TypeDescription
ai_mode_responseThe primary AI-generated answer block
ai_mode_sourceA source citation listed below the AI response
ai_mode_follow_up_querySuggested follow-up questions from the AI
ai_mode_productProduct card shown within an AI Mode response
ai_mode_localLocal 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: true multiplies cost by 2
  • Depth is billed per 20 results (desktop) or 10 results (mobile)

Internal SOP reference — not affiliated with DataForSEO.