logo

AI Mode Endpoint

Get AI-generated answers with references and shopping results from Google AI Mode

Google AI Mode is a conversational search mode that returns a full AI-generated response as the primary content, rather than traditional search results. Instead of a list of links, you get structured text blocks with inline references, shopping results, and detailed answers.


Endpoint

GET https://api.scrape.do/plugin/google/search/ai-mode

Credit cost: 10 credits per request.


Request Parameters

Required

ParameterTypeDescription
tokenstringYour Scrape.do API authentication token
qstringSearch query. URL-encode spaces and special characters. best+noise+cancelling+headphones+2025

General

ParameterTypeDefaultDescription
devicestringdesktopDevice type. Accepted values: desktop, mobile
include_htmlbooleanfalseWhen true, the raw HTML is included in the response html field

Localization & Geo-targeting

ParameterTypeDefaultDescription
hlstringenHost Language. Controls the language of the Google UI. ISO 639-1 codes. Examples: tr, de, fr, ja. Full list →
glstringusGeo Location. Country perspective for results. ISO 3166-1 alpha-2 codes. Examples: tr, de, gb. Full list →
google_domainstringgoogle.comGoogle domain to query. Examples: google.com.tr, google.de, google.co.uk. Full list →
locationstring-Location name in Google's canonical format. Examples: Istanbul,Istanbul,Turkey, New York,New York,United States
uulestring-Google UULE-encoded location string. Auto-generated from location when not provided

Filtering

ParameterTypeDefaultDescription
safestring-SafeSearch. Send active to filter adult content

Example Usage

Step 1: Define Your Search Query

AI Mode works best with informational and research-oriented queries:

  • Product research: best noise cancelling headphones 2025
  • Explanations: how does mRNA vaccine work
  • Comparisons: python vs javascript for beginners

For this example, we'll search for "best noise cancelling headphones 2025":

Step 2: Send the API Request

curl --location --request GET 'https://api.scrape.do/plugin/google/search/ai-mode?token=<SDO-token>&q=best+noise+cancelling+headphones+2025'
import requests
import json

token = "<SDO-token>"
query = "best+noise+cancelling+headphones+2025"

url = f"https://api.scrape.do/plugin/google/search/ai-mode?token={token}&q={query}"

response = requests.request("GET", url)

print(json.dumps(response.json(), indent=2))
const axios = require('axios');

const token = "<SDO-token>";
const query = "best+noise+cancelling+headphones+2025";

const url = `https://api.scrape.do/plugin/google/search/ai-mode?token=${token}&q=${query}`;

axios.get(url)
  .then(response => {
    console.log(JSON.stringify(response.data, null, 2));
  })
  .catch(error => {
    console.error(error);
  });
package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	token := "<SDO-token>"
	query := "best+noise+cancelling+headphones+2025"

	url := fmt.Sprintf(
		"https://api.scrape.do/plugin/google/search/ai-mode?token=%s&q=%s",
		token, query,
	)

	resp, err := http.Get(url)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, _ := ioutil.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require 'net/http'
require 'json'

token = "<SDO-token>"
query = "best+noise+cancelling+headphones+2025"

url = URI("https://api.scrape.do/plugin/google/search/ai-mode?token=#{token}&q=#{query}")

response = Net::HTTP.get(url)

puts JSON.pretty_generate(JSON.parse(response))
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class GoogleAIMode {
    public static void main(String[] args) throws Exception {
        String token = "<SDO-token>";
        String query = "best+noise+cancelling+headphones+2025";

        String url = String.format(
            "https://api.scrape.do/plugin/google/search/ai-mode?token=%s&q=%s",
            token, query
        );

        HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
        conn.setRequestMethod("GET");

        BufferedReader reader = new BufferedReader(
            new InputStreamReader(conn.getInputStream())
        );
        String line;
        StringBuilder response = new StringBuilder();
        while ((line = reader.readLine()) != null) {
            response.append(line);
        }
        reader.close();

        System.out.println(response.toString());
    }
}
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        string token = "<SDO-token>";
        string query = "best+noise+cancelling+headphones+2025";

        string url = $"https://api.scrape.do/plugin/google/search/ai-mode?token={token}&q={query}";

        using HttpClient client = new HttpClient();
        string response = await client.GetStringAsync(url);

        Console.WriteLine(response);
    }
}
<?php
$token = "<SDO-token>";
$query = "best+noise+cancelling+headphones+2025";

$url = "https://api.scrape.do/plugin/google/search/ai-mode?token={$token}&q={$query}";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
?>

Step 3: Receive AI-Generated Results

The API returns a JSON object with the AI-generated response structured into text blocks, references, and optional shopping results:

{
  "search_parameters": {
    "q": "best noise cancelling headphones 2025",
    "hl": "en",
    "gl": "us",
    "device": "desktop",
    "google_domain": "google.com"
  },
  "text_blocks": [
    {
      "type": "paragraph",
      "snippet": "For 2025, the noise-cancelling headphone market is dominated by the Sony WH-1000XM6, which launched in May 2025 as the new industry leader.",
      "snippet_links": [
        { "text": "Sony WH-1000XM6", "link": "https://example.com/sony" }
      ],
      "reference_indexes": [0, 1, 2]
    },
    {
      "type": "heading",
      "snippet": "Top Over-Ear Recommendations",
      "level": 3
    },
    {
      "type": "list",
      "list": [
        {
          "snippet": "Sony WH-1000XM6 — best overall noise cancellation",
          "reference_indexes": [0]
        },
        {
          "snippet": "Bose QuietComfort Ultra — best comfort for long wear",
          "reference_indexes": [1]
        }
      ]
    }
  ],
  "references": [
    {
      "title": "Sony WH-1000XM6 Review",
      "link": "https://example.com/sony-review",
      "snippet": "The XM6 offers industry-leading ANC...",
      "source": "TechRadar",
      "source_icon": "https://example.com/techradar-icon.png",
      "index": 0
    },
    {
      "title": "Bose QC Ultra Review",
      "link": "https://example.com/bose-review",
      "snippet": "Bose's latest flagship...",
      "source": "RTINGS",
      "index": 1
    }
  ],
  "shopping_results": [
    {
      "title": "Sony WH-1000XM6",
      "product_link": "https://example.com/buy-sony",
      "thumbnail": "https://example.com/sony.jpg",
      "price": "$399.99",
      "extracted_price": 399.99,
      "old_price": "$460.00",
      "extracted_old_price": 460.00,
      "source": "Sony",
      "rating": 4.7,
      "reviews": 5300,
      "index": 0
    }
  ]
}

Response Structure

Top-Level Fields

FieldTypeWhen EmptyDescription
search_parametersobjectalways presentEcho of the request parameters
text_blocksarray[]AI-generated content blocks (paragraphs, headings, lists, reference cards)
referencesarray[]Sources cited by the AI response
shopping_resultsarray[]Product results with pricing (when relevant)
htmlstringomittedRaw HTML. Only present when include_html=true

text_blocks[]

The AI response is structured as an ordered array of content blocks. Each block has a type that determines which fields are present.

FieldTypeDescription
typestring"heading", "paragraph", "list", "ordered_list", or "reference_cards"
snippetstringText content (for headings and paragraphs)
levelintegerHeading level, e.g. 3 (only when type=heading)
snippet_linksarrayInline links within the snippet (optional)
listarrayList items when type=list or type=ordered_list (optional)
cardsarrayReference preview cards when type=reference_cards (optional)
reference_indexesarray of intIndexes into the references array (optional)

ListItem Object

FieldTypeDescription
snippetstringItem text
snippet_linksarrayInline links (optional)
shopping_resultobjectEmbedded shopping result (optional)
listarrayNested sub-items (optional, recursive)
reference_indexesarray of intIndexes into the references array (optional)
FieldTypeDescription
textstringLink text
linkstringURL

ReferenceCard Object

FieldTypeDescription
titlestringCard title
linkstringURL
snippetstringPreview text (optional)

references[]

Sources cited by the AI-generated response. Each reference has an index that text blocks point to via reference_indexes.

FieldTypeDescription
titlestringPage title
linkstringURL
snippetstringDescription excerpt
sourcestringDomain or site name
source_iconstringFavicon URL (optional)
thumbnailstringPreview image URL (optional)
indexintegerPosition index

shopping_results[]

Product results with pricing and ratings. Present when the query has commercial intent.

FieldTypeDescription
titlestringProduct name
product_linkstringProduct URL
thumbnailstringImage URL (optional)
pricestringDisplay price, e.g. "$399.99" (optional)
extracted_pricefloatNumeric price (optional)
old_pricestringOriginal price before discount (optional)
extracted_old_pricefloatNumeric old price (optional)
sourcestringRetailer name (optional)
ratingfloatStar rating (optional)
reviewsintegerReview count (optional)
indexintegerPosition index

Differences from AI Overview

AI OverviewAI Mode
TriggerAutomatic on regular SERPDedicated endpoint
Endpoint/plugin/google/search/plugin/google/search/ai-mode
ContentOptional panel within SERP resultsFull AI response (primary content)
Shopping resultsNoYes (when relevant)
HeadingsNoYes (type=heading)
Ordered listsNoYes (type=ordered_list)
Reference cardsNoYes (type=reference_cards)
CreditsSame as SERP (or 5 for deferred follow-up)10

Example Requests

Basic AI Mode search:

/plugin/google/search/ai-mode?token=TOKEN&q=best+noise+cancelling+headphones+2025

Turkish results from Turkey:

/plugin/google/search/ai-mode?token=TOKEN&q=en+iyi+kulaklık&hl=tr&gl=tr&google_domain=google.com.tr

Location-targeted search:

/plugin/google/search/ai-mode?token=TOKEN&q=best+restaurants&location=New+York,New+York,United+States

Mobile device:

/plugin/google/search/ai-mode?token=TOKEN&q=python+vs+javascript&device=mobile

Search queries must be URL-encoded. The response is gzip compressed with a minimum size of 2KB.

On this page