Google Search Ai Mode avatar

Google Search Ai Mode

Pricing

from $1.90 / 1,000 results

Go to Apify Store
Google Search Ai Mode

Google Search Ai Mode

Fetch AI-generated answers from Google AI Mode. The actor returns structured text blocks, inline references, and shopping results as clean JSON pushed to an Apify Dataset.

Pricing

from $1.90 / 1,000 results

Rating

0.0

(0)

Developer

Fabio Borsotti

Fabio Borsotti

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

8 hours ago

Last modified

Categories

Share

Google Search AI Mode — Apify Actor

Fetch AI-generated answers from Google AI Mode. The actor returns structured text blocks, inline references, and shopping results as clean JSON pushed to an Apify Dataset.

Google AI Mode is a conversational search surface that returns a full AI-generated response as the primary content — instead of a traditional list of blue links. The response includes paragraphs, headings, ordered/unordered lists, reference cards, cited sources, and (when relevant) shopping product cards with pricing.


Input Parameters

ParameterTypeRequiredDefaultDescription
qstringYes—Search query. URL-encode spaces and special characters. Example: best+noise+cancelling+headphones+2025
devicestringNodesktopDevice type. Accepted values: desktop, mobile.
include_htmlbooleanNofalseWhen true, the raw async HTML is included in the response html field.
hlstringNoenHost Language. Controls the language of the Google UI. ISO 639-1 codes. Examples: tr, de, fr, ja.
glstringNousGeo Location. Country perspective for results. ISO 3166-1 alpha-2 codes. Examples: tr, de, gb.
google_domainstringNogoogle.comGoogle domain to query. Examples: google.com.tr, google.de, google.co.uk.
locationstringNo—Location name in Google's canonical format. Examples: Istanbul,Istanbul,Turkey, New York,New York,United States.
uulestringNo—Google UULE-encoded location string. Auto-generated from location when not provided.
safestringNo""SafeSearch. Accepted values: "" (disabled / not set), "active" (filter adult content).

Example Input

{
"q": "best noise cancelling headphones 2025",
"device": "desktop",
"hl": "en",
"gl": "us",
"google_domain": "google.com"
}

Output Structure

The actor pushes the full JSON response to the Apify Dataset. The top-level structure is:

Top-Level Fields

FieldTypeWhen EmptyDescription
search_parametersobjectAlways presentEcho of the request parameters used for the search.
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.

Note: When Google has no AI Mode content for a query, the endpoint returns 200 with empty text_blocks, references, and shopping_results. This is not treated as an error.


search_parameters Object

FieldTypeDescription
qstringThe search query that was used.
hlstringHost language code.
glstringGeo location code.
devicestringDevice type used (desktop or mobile).
google_domainstringGoogle domain queried.

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).
FieldTypeDescription
textstringLink anchor text.
linkstringURL.

ListItem Object

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

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.

Example Output

{
"search_parameters": {
"q": "what is an MCP server for AI?",
"hl": "en",
"gl": "us",
"device": "mobile",
"google_domain": "google.com"
},
"text_blocks": [
{
"type": "paragraph",
"snippet": "AI Mode reply for what is an MCP server for AI?"
},
{
"type": "paragraph",
"snippet": "An MCP (Model Context Protocol) server is a software program that acts as a universal adapter for artificial intelligence..."
},
{
"type": "heading",
"snippet": "How the MCP architecture works",
"level": 3
},
{
"type": "list",
"list": [
{
"snippet": "The AI Host: The application the user interacts with directly.",
"snippet_links": [
{ "text": "Cursor IDE", "link": "/goto?url=..." },
{ "text": "Microsoft Copilot", "link": "/goto?url=..." }
]
},
{
"snippet": "The MCP Client: The component integrated within the AI app."
},
{
"snippet": "The MCP Server: The service that translates external-world data."
}
],
"reference_indexes": [0]
}
],
"references": [
{
"title": "What is the Model Context Protocol?",
"link": "https://cloud.google.com/discover/what-is-model-context-protocol",
"snippet": "Uses JSON-RPC 2.0 messages to communicate between client and server...",
"source": "Google Cloud",
"source_icon": "https://encrypted-tbn0.gstatic.com/faviconV2?url=https://cloud.google.com&...",
"index": 0
},
{
"title": "What is the Model Context Protocol (MCP)?",
"link": "https://www.redhat.com/en/topics/ai/what-is-model-context-protocol-mcp",
"snippet": "",
"source": "Red Hat",
"index": 1
}
],
"shopping_results": []
}

Error Handling

The actor fails with a descriptive message when:

ConditionActor Behavior
q input parameter missing or emptyActor fails immediately with a validation error.
device not desktop or mobileActor fails immediately with a validation error.
Scrape.do API returns HTTP 4xx/5xxActor fails with the HTTP status and response body preview.
Network timeout or errorActor fails with the network error details.
Invalid JSON responseActor fails with a parse error message.

Scrape.do API Error Codes

StatusBodyCause
400{ "error": "q (search query) is required" }Missing q parameter.
400{ "error": "device must be one of: desktop, mobile" }Invalid device value.
400{ "error": "invalid google_domain" }Unsupported Google domain.
502{ "error": "request failed" }Transient upstream Google failure after retries. Not charged.
502{ "error": "folwr request failed" }Transient follow-up fetch failure after retries. Not charged.
500{ "error": "failed to parse AI Mode results" }Parser error. Retry the request.