# AI Mode

The `google_ai_mode` source is designed to submit prompts and retrieve Google AI Mode conversational responses. It returns both the complete Google AI Mode response text along with its structured metadata.

## AI Mode regional availability

Google AI Mode is available in most countries worldwide **apart from these exceptions**:

<table><thead><tr><th width="96">Region</th><th>Countries</th></tr></thead><tbody><tr><td>Europe</td><td>France, Turkey</td></tr><tr><td>Asia</td><td>China, Iran, North Korea, Syria</td></tr><tr><td>Americas</td><td>Cuba</td></tr></tbody></table>

{% hint style="warning" %}
Google AI Mode feature is continuously rolling out with more countries included over time.
{% endhint %}

## Request samples

The following code examples demonstrate how to retrieve a Google AI Mode response with parsed results.

{% tabs %}
{% tab title="cURL" %}

```bash
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "google_ai_mode",
        "query": "best health trackers under $200",
        "render": "html",
        "parse": true
    }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from pprint import pprint


# Structure payload.
payload = {
    'source': 'google_ai_mode',
    'query': 'best health trackers under $200',
    'render': 'html',
    'parse': True
}


# Get response.
response = requests.request(
    'POST',
    'https://realtime.oxylabs.io/v1/queries',
    auth=('USERNAME', 'PASSWORD'),
    json=payload,
)

# Print prettified response to stdout.
pprint(response.json())
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const https = require("https");

const username = "USERNAME";
const password = "PASSWORD";
const body = {
    source: "google_ai_mode",
    query: "best health trackers under $200",
    render: "html",
    parse: true
};

const options = {
    hostname: "realtime.oxylabs.io",
    path: "/v1/queries",
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        Authorization:
            "Basic " + Buffer.from(`${username}:${password}`).toString("base64"),
    },
};

const request = https.request(options, (response) => {
    let data = "";

    response.on("data", (chunk) => {
        data += chunk;
    });

    response.on("end", () => {
        const responseData = JSON.parse(data);
        console.log(JSON.stringify(responseData, null, 2));
    });
});

request.on("error", (error) => {
    console.error("Error:", error);
});

request.write(JSON.stringify(body));
request.end();
```

{% endtab %}

{% tab title="HTTP" %}

```http
https://realtime.oxylabs.io/v1/queries?source=google_ai_mode&query=best%20health%20trackers%20under%20$200&render=html&parse=true&access_token=12345abcde
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$params = array(
    'source' => 'google_ai_mode',
    'query' => 'best health trackers under $200',
    'render' => 'html',
    'parse' => true
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "USERNAME" . ":" . "PASSWORD");


$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);
```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	const Username = "USERNAME"
	const Password = "PASSWORD"

  	payload := map[string]interface{}{
        	"source": "google_ai_mode",
        	"query": "best health trackers under $200",
        	"render": "html",
        	"parse":  true,
    	}

	jsonValue, _ := json.Marshal(payload)

	client := &http.Client{}
	request, _ := http.NewRequest("POST",
		"https://realtime.oxylabs.io/v1/queries",
		bytes.NewBuffer(jsonValue),
	)

	request.SetBasicAuth(Username, Password)
	response, _ := client.Do(request)

	responseText, _ := ioutil.ReadAll(response.Body)
	fmt.Println(string(responseText))
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;

namespace OxyApi
{
    class Program
    {
        static async Task Main()
        {
            const string Username = "USERNAME";
            const string Password = "PASSWORD";

            var parameters = new
            {
                source = "google_ai_mode",
                query = "best health trackers under $200",
                render = "html",
                parse = true
            };

            var client = new HttpClient();

            Uri baseUri = new Uri("https://realtime.oxylabs.io");
            client.BaseAddress = baseUri;

            var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/v1/queries");
            requestMessage.Content = JsonContent.Create(parameters);

            var authenticationString = $"{Username}:{Password}";
            var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString));
            requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString);

            var response = await client.SendAsync(requestMessage);
            var contents = await response.Content.ReadAsStringAsync();

            Console.WriteLine(contents);
        }
    }
}
```

{% endtab %}

{% tab title="Java" %}

```java
package org.example;

import okhttp3.*;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.concurrent.TimeUnit;

public class Main implements Runnable {
    private static final String AUTHORIZATION_HEADER = "Authorization";
    public static final String USERNAME = "USERNAME";
    public static final String PASSWORD = "PASSWORD";

    public void run() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("source", "google_ai_mode");
        jsonObject.put("query", "best health trackers under $200");
        jsonObject.put("render", "html");
        jsonObject.put("parse", true);

        Authenticator authenticator = (route, response) -> {
            String credential = Credentials.basic(USERNAME, PASSWORD);
            return response
                    .request()
                    .newBuilder()
                    .header(AUTHORIZATION_HEADER, credential)
                    .build();
        };

        var client = new OkHttpClient.Builder()
                .authenticator(authenticator)
                .readTimeout(180, TimeUnit.SECONDS)
                .build();

        var mediaType = MediaType.parse("application/json; charset=utf-8");
        var body = RequestBody.create(jsonObject.toString(), mediaType);
        var request = new Request.Builder()
                .url("https://realtime.oxylabs.io/v1/queries")
                .post(body)
                .build();

        try (var response = client.newCall(request).execute()) {
            if (response.body() != null) {
                try (var responseBody = response.body()) {
                    System.out.println(responseBody.string());
                }
            }
        } catch (Exception exception) {
            System.out.println("Error: " + exception.getMessage());
        }

        System.exit(0);
    }

    public static void main(String[] args) {
        new Thread(new Main()).start();
    }
}
```

{% endtab %}

{% tab title="JSON" %}

```json
{
        "source": "google_ai_mode",
        "query": "best health trackers under $200",
        "render": "html",
        "parse": true
}
```

{% endtab %}
{% endtabs %}

Our examples use synchronous [**Realtime**](https://developers.oxylabs.io/~/changes/1231/scraping-solutions/web-scraper-api/integration-methods/realtime) integration method. If you would like to use [**Proxy Endpoint**](https://developers.oxylabs.io/~/changes/1231/scraping-solutions/web-scraper-api/integration-methods/proxy-endpoint) or asynchronous [**Push-Pull**](https://developers.oxylabs.io/~/changes/1231/scraping-solutions/web-scraper-api/integration-methods/push-pull) integration, refer to the [**integration methods**](https://developers.oxylabs.io/~/changes/1231/scraping-solutions/web-scraper-api/integration-methods) section.

## Request parameter values

Basic setup and customization options for retrieving Google AI Mode responses.

<table><thead><tr><th width="222">Parameter</th><th width="350.3333333333333">Description</th><th>Default Value</th></tr></thead><tbody><tr><td><mark style="background-color:green;"><strong>source</strong></mark></td><td>Sets the scraper.</td><td><code>google_ai_mode</code></td></tr><tr><td><mark style="background-color:green;"><strong>query</strong></mark></td><td>The prompt or question to submit to Google AI Mode. Must be less than 400 symbols.</td><td>-</td></tr><tr><td><mark style="background-color:green;"><strong>render</strong></mark></td><td>Setting to <code>html</code> is required for this source. <a href="../../features/js-rendering-and-browser-control/javascript-rendering"><strong>More info</strong></a><strong>.</strong></td><td>-</td></tr><tr><td><code>parse</code></td><td>Returns parsed data when set to <code>true</code>.</td><td><code>false</code></td></tr><tr><td><code>geo_location</code></td><td>The geographical location that the result should be adapted for. For more information, read about our suggested <code>geo_location</code> parameter structures <a href="../../../features/localization/serp-localization#google"><strong>here</strong></a>.</td><td>-</td></tr><tr><td><code>callback_url</code></td><td>URL to your callback endpoint. <a href="../../../integration-methods/push-pull#callback"><strong>More info</strong></a>.</td><td>-</td></tr></tbody></table>

&#x20;    \- mandatory parameter

## Structured data

Web Scraper API returns either an HTML or JSON object of Google AI Mode output, containing structured data of the results page.

<details>

<summary><code>google_ai_mode</code> structured output</summary>

```json
{
    "results": [
        {
            "content": {
                "links": [
                    {
                        "url": "https://www.nytimes.com/wirecutter/reviews/the-best-fitness-trackers/#:~:text=%7C,Apple%20users:%20Apple%20Watch%20SE",
                        "text": "The 3 Best Fitness Trackers of 2025 | Reviews by Wirecutter"
                    },
                    {
                        "url": "https://www.wareable.com/fitness-trackers/the-best-fitness-tracker#:~:text=Fitbit%20Charge%206%20%E2%80%93%20the%20best,10%20%E2%80%93%20Best%20fitness%2Dtracking%20smartwatch",
                        "text": "Best fitness tracker 2025: Reviewed, tested and compared"
                    },
                    {
                        "url": "https://www.techradar.com/best/best-cheap-fitness-trackers",
                        "text": "The best cheap fitness trackers for 2025 - TechRadar"
                    },
                    {
                        "url": "https://www.livescience.com/best-budget-fitness-tracker",
                        "text": "Best budget fitness trackers 2025: Hand-picked by our expert reviewers"
                    },
                    {
                        "url": "https://www.garagegymreviews.com/best-budget-fitness-tracker",
                        "text": "Expert-Tested: Best Budget Fitness Tracker (2025)"
                    },
                    {
                        "url": "https://www.businessinsider.com/guides/tech/best-fitbit#:~:text=Our%20top%20recommendation%20is%20the,fitness%20tools%20for%20under%20%24100.",
                        "text": "The Best Fitbit in 2025 - Business Insider"
                    },
                    {
                        "url": "https://medium.com/@kellyshephard/best-smartwatches-under-200-5961cbc1a6f8#:~:text=The%20Apple%20Watch%20SE%20(2022)%20is%20the,it%20still%20performs%20well%20throughout%20the%20day.",
                        "text": "Best Smartwatches Under $200 in 2025: Tested and Approved"
                    },
                    {
                        "url": "https://www.gminsights.com/industry-analysis/smartwatch-market#:~:text=More%20advanced%20functions%20such%20as%20ECG%20monitoring%2C,Galaxy%20Watch%205%2C%20and%20Fitbit%20Sense%202.",
                        "text": "Smartwatch Market Share, Growth Analysis Report 2025-2034"
                    },
                    {
                        "url": "https://www.linkedin.com/pulse/best-smartwatches-law-enforcement-rugged-reliable-ready-samar-abbas-n1bif#:~:text=Q6:%20What's%20the%20best%20smartwatch%20for%20health,especially%20for%20VO2%20Max%20and%20stress%20levels.",
                        "text": "Best Smartwatches for Law Enforcement: Rugged, Reliable, and Ready for Duty"
                    },
                    {
                        "url": "https://gearjunkie.com/health-fitness/best-fitness-watch#:~:text=Technology%20for%20health%20tracking%20has%20advanced%20a,and%20infrared%20light)%20and%20Heart%20Rate%20Variability.",
                        "text": "The Best Fitness Watches of 2025"
                    }
                ],
                "prompt": "best health trackers under $200",
                "citations": [
                    {
                        "text": "Tracker",
                        "urls": [
                            "https://www.nytimes.com/wirecutter/reviews/the-best-fitness-trackers/#:~:text=%7C,Apple%20users:%20Apple%20Watch%20SE",
                            "https://www.livescience.com/best-budget-fitness-tracker",
                            "https://www.techradar.com/best/best-cheap-fitness-trackers"
                        ]
                    },
                    {
                        "text": "Tracking accuracy: Reputable brands like Fitbit and Garmin offer reliable accuracy for tracking heart rate, steps, and sleep. More advanced metrics like blood oxygen (SpO2) and stress are also available on many models. GPS: For runners and cyclists, having built-in GPS is crucial for mapping routes and tracking distance without carrying a phone. If you don't need this, or are comfortable relying on your phone's GPS, you can save money with a tracker that lacks this feature. Subscription services: Brands like Fitbit offer a premium membership to unlock more detailed insights and guided programs. However, all trackers on this list provide basic tracking for free. Battery life: Simpler trackers typically last a week or more on a single charge, while more complex smartwatches like the Apple Watch SE need daily charging . Design and comfort: Consider the size and style of the tracker. Some prefer the compact, lightweight design of a basic band, while others like the larger, more interactive display of a smartwatch.",
                        "urls": [
                            "https://www.nytimes.com/wirecutter/reviews/the-best-fitness-trackers/#:~:text=%7C,Apple%20users:%20Apple%20Watch%20SE",
                            "https://www.wareable.com/fitness-trackers/the-best-fitness-tracker#:~:text=Fitbit%20Charge%206%20%E2%80%93%20the%20best,10%20%E2%80%93%20Best%20fitness%2Dtracking%20smartwatch"
                        ]
                    }
                ],
                "response_text": "For under $200, the best health trackers include the Fitbit Inspire 3 for overall value, the Xiaomi Smart Band 9 as the best ultra-budget option, and the Apple Watch SE (2nd generation) for iPhone users. Other strong contenders include the more advanced Fitbit Charge 6 and the Garmin Vivosmart 5 . Comparison of best health trackers under $200 Tracker Best for Built-in GPS Features Pros Cons Fitbit Inspire 3 Best overall and for beginners No (uses phone GPS) 24/7 heart rate, SpO2, sleep tracking, Active Zone Minutes Excellent value , unobtrusive design, long battery life (up to 10 days) Subscription required for more detailed insights; small screen Fitbit Charge 6 More advanced tracking Yes Built-in GPS, ECG, stress tracking, EDA sensor for stress, Google Wallet/Maps Accurate heart rate tracking, includes useful Google integrations Requires a Google account ; some features are locked behind a subscription Xiaomi Smart Band 9 Best ultra-budget option No (uses phone GPS) Heart rate, SpO2, sleep tracking, 150+ workout modes Extremely affordable, large screen, excellent battery life (up to 21 days) Some users report patchy app connectivity and inconsistent accuracy Garmin Vivosmart 5 Best from Garmin No (uses phone GPS) Body Battery energy monitor, sleep tracking, SpO2, automatic activity tracking Lightweight and comfortable, particularly good sleep tracking Monochrome screen and no built-in GPS Apple Watch SE (2nd Gen) Best for iPhone users Yes Heart rate, Activity Rings, fall detection, app ecosystem Seamless integration with iPhone; vibrant screen Battery life is short (up to 18 hours); more expensive Fitbit Inspire 3 Health & Fitness Activity Tracker Black with Workout Intensity R$646.00 4.4 (5K+) XIAOMI SMART BAND 9 - Midnight Black R$237.07 (Rs\u00a012,499.00) 4.8 (7K+) Apple Watch SE GPS + Cellular 40mm Midnight Aluminium Case with Midnight Sport Band - M/L R$184.11/mo x 18 4.6 (9K+) Fitbit Charge 6 Activity and Fitness Tracker with Google apps R$832.34 ($156.00) 4.2 (5K+) Garmin Vivosmart 5, Black S/m (010-02645-00) R$800.27 ($149.99) 4.2 (2K+) See more Key features to consider Tracking accuracy: Reputable brands like Fitbit and Garmin offer reliable accuracy for tracking heart rate, steps, and sleep. More advanced metrics like blood oxygen (SpO2) and stress are also available on many models. GPS: For runners and cyclists, having built-in GPS is crucial for mapping routes and tracking distance without carrying a phone. If you don't need this, or are comfortable relying on your phone's GPS, you can save money with a tracker that lacks this feature. Subscription services: Brands like Fitbit offer a premium membership to unlock more detailed insights and guided programs. However, all trackers on this list provide basic tracking for free. Battery life: Simpler trackers typically last a week or more on a single charge, while more complex smartwatches like the Apple Watch SE need daily charging . Design and comfort: Consider the size and style of the tracker. Some prefer the compact, lightweight design of a basic band, while others like the larger, more interactive display of a smartwatch. Thank you Your feedback helps Google improve. See our Privacy Policy . Share more feedback Report a problem Close",
                "parse_status_code": 12000
            },
            "created_at": "2025-10-28 14:41:42",
            "updated_at": "2025-10-28 14:41:59",
            "page": 1,
            "url": "https://www.google.com/search?udm=50&q=best+health+trackers+under+$200&hl=en&sei=KtYAaaHbBZ_m1sQP0IOaqQg&mstk=AUtExfAUpaUCxnFayf6G4-kNkwNbm0bQCoQ9U98qUnjI2A0E7T5DCKi2lmolJe5o9X9h3tJVH-Cx91tGJrhIiDPrrcvO4kX8vex4rnW_IUsQA-b6EGmpCtqj2ocY-FWO95EcMcaYeOvsQhtFqGdYF4CChex2n6h4PeopuL0&csuir=1",
            "job_id": "7388948081053534209",
            "is_render_forced": false,
            "status_code": 200,
            "type": "parsed",
            "parser_type": "",
            "parser_preset": null
        }
    ],
    "job": {
        "callback_url": null,
        "client_id": 12345,
        "context": [
            {
                "key": "force_headers",
                "value": false
            },
            {
                "key": "force_cookies",
                "value": false
            },
            {
                "key": "hc_policy",
                "value": true
            },
            {
                "key": "successful_parse_status_codes",
                "value": []
            }
        ],
        "created_at": "2025-10-28 14:41:42",
        "domain": "com",
        "geo_location": null,
        "id": "7388948081053534209",
        "limit": 10,
        "locale": null,
        "pages": 1,
        "parse": true,
        "parser_type": null,
        "parser_preset": null,
        "parsing_instructions": null,
        "browser_instructions": null,
        "render": "html",
        "xhr": false,
        "markdown": false,
        "url": null,
        "query": "best health trackers under $200",
        "source": "google_ai_mode",
        "start_page": 1,
        "status": "done",
        "storage_type": null,
        "storage_url": null,
        "subdomain": "www",
        "content_encoding": "utf-8",
        "updated_at": "2025-10-28 14:41:59",
        "user_agent_type": "desktop",
        "session_info": null,
        "statuses": [],
        "client_notes": null,
        "_links": [
            {
                "rel": "self",
                "href": "http://data.oxylabs.io/v1/queries/7388948081053534209",
                "method": "GET"
            },
            {
                "rel": "results",
                "href": "http://data.oxylabs.io/v1/queries/7388948081053534209/results",
                "method": "GET"
            },
            {
                "rel": "results-content",
                "href_list": [
                    "http://data.oxylabs.io/v1/queries/7388948081053534209/results/1/content"
                ],
                "method": "GET"
            },
            {
                "rel": "results-html",
                "href": "http://data.oxylabs.io/v1/queries/7388948081053534209/results?type=raw",
                "method": "GET"
            },
            {
                "rel": "results-content-html",
                "href_list": [
                    "http://data.oxylabs.io/v1/queries/7388948081053534209/results/1/content?type=raw"
                ],
                "method": "GET"
            },
            {
                "rel": "results-parsed",
                "href": "http://data.oxylabs.io/v1/queries/7388948081053534209/results?type=parsed",
                "method": "GET"
            },
            {
                "rel": "results-content-parsed",
                "href_list": [
                    "http://data.oxylabs.io/v1/queries/7388948081053534209/results/1/content?type=parsed"
                ],
                "method": "GET"
            }
        ]
    }
}
```

</details>

{% hint style="warning" %}
The composition of elements may vary depending on whether the query was made from a **desktop** or **mobile** device.
{% endhint %}

## Output data dictionary

### HTML example

<figure><img src="https://63892162-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzrXw45naRpCZ0Ku9AjY1%2Fuploads%2FacWa2920VjxGz1qBS7sz%2Fgoogle_ai_mode_html.png?alt=media&#x26;token=cb6ef9cf-c796-4043-94f3-1a47d90be1fd" alt=""><figcaption></figcaption></figure>

### JSON structure

The structured `google_ai_mode` output includes fields like `URL`, `page`, `results`, and more. The table below presents a detailed list of each Google AI Mode element we parse, including description, data type, and relevant metadata.

{% hint style="info" %}
The number of items and fields for a specific result type may vary depending on the search query.
{% endhint %}

<table data-full-width="false"><thead><tr><th width="289">Key Name</th><th width="337.3333333333333">Description</th><th>Type</th></tr></thead><tbody><tr><td><code>url</code></td><td>The URL of Google AI Mode.</td><td>string</td></tr><tr><td><code>page</code></td><td>Page number.</td><td>integer</td></tr><tr><td><code>content</code></td><td>An object containing the parsed Google AI Mode response data.</td><td>object</td></tr><tr><td><code>content.links</code></td><td>List of external links referenced in the response. Displayed in the box on the right side of the page.</td><td>array</td></tr><tr><td><code>content.prompt</code></td><td>Original prompt submitted to Google AI Mode.</td><td>string</td></tr><tr><td><code>content.citations</code></td><td>List of citations with URLs and associated texts, as shown in the main block of the Google AI Mode response. Multiple URLs referencing the same text are grouped together into a list.</td><td>array</td></tr><tr><td><code>content.response_text</code></td><td>Complete response text from Google AI Mode.</td><td>string</td></tr><tr><td><code>content.parse_status_code</code></td><td>Status code of the parsing operation.</td><td>integer</td></tr><tr><td><code>created_at</code></td><td>Timestamp when the scraping job was created.</td><td>timestamp</td></tr><tr><td><code>updated_at</code></td><td>Timestamp when the scraping job was finished.</td><td>timestamp</td></tr><tr><td><code>job_id</code></td><td>ID of the job associated with the scraping job.</td><td>string</td></tr><tr><td><code>status_code</code></td><td>Status code of the scraping job. You can see the scraper status codes described <a href="../../response-codes"><strong>here</strong></a>.</td><td>integer</td></tr></tbody></table>
