AI Mode
Learn how you can extract AI Mode data with Web Scraper API.
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:
Europe
France, Turkey
Asia
China, Iran, North Korea, Syria
Americas
Cuba
Google AI Mode feature is continuously rolling out with more countries included over time.
Request samples
The following code examples demonstrate how to retrieve a Google AI Mode response with parsed results.
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
}'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())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();https://realtime.oxylabs.io/v1/queries?source=google_ai_mode&query=best%20health%20trackers%20under%20$200&render=html&parse=true&access_token=12345abcde<?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);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))
}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);
}
}
}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();
}
}{
"source": "google_ai_mode",
"query": "best health trackers under $200",
"render": "html",
"parse": true
}Our examples use synchronous Realtime integration method. If you would like to use Proxy Endpoint or asynchronous Push-Pull integration, refer to the integration methods section.
Request parameter values
Basic setup and customization options for retrieving Google AI Mode responses.
source
Sets the scraper.
google_ai_mode
query
The prompt or question to submit to Google AI Mode. Must be less than 400 symbols.
-
parse
Returns parsed data when set to true.
false
geo_location
The geographical location that the result should be adapted for. For more information, read about our suggested geo_location parameter structures here.
-
- 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.
The composition of elements may vary depending on whether the query was made from a desktop or mobile device.
Output data dictionary
HTML example

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.
url
The URL of Google AI Mode.
string
page
Page number.
integer
content
An object containing the parsed Google AI Mode response data.
object
content.links
List of external links referenced in the response. Displayed in the box on the right side of the page.
array
content.prompt
Original prompt submitted to Google AI Mode.
string
content.citations
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.
array
content.response_text
Complete response text from Google AI Mode.
string
content.parse_status_code
Status code of the parsing operation.
integer
created_at
Timestamp when the scraping job was created.
timestamp
updated_at
Timestamp when the scraping job was finished.
timestamp
job_id
ID of the job associated with the scraping job.
string
status_code
Status code of the scraping job. You can see the scraper status codes described here.
integer
Last updated
Was this helpful?

