Google AI Mode API
Google's conversational AI Mode answer with citation pills, places, shopping cards and videos.
Price
$2.06 per 1,000 requests on every plan, deducted from your prepaid USD balance.
Endpoint
POST /v1/monitor/aimode
Countries
213 countries, down to the city.
Request
curl -X POST "https://api.answerline.dev/v1/monitor/aimode" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"Family-friendly hotels in Lisbon","country":"PT","hl":"en"}'
import { Client } from "@answerline/sdk";
const client = new Client({ apiKey: process.env.API_KEY! });
const answer = await client.monitor.aimode({
"prompt": "Family-friendly hotels in Lisbon",
"country": "PT",
"hl": "en"
});
import os
from answerline import Client
with Client(os.environ["API_KEY"]) as client:
answer = client.monitor.aimode(
prompt="Family-friendly hotels in Lisbon",
country="PT",
hl="en",
)
What you get back
Field in result | Type | Description |
|---|---|---|
text | string | Text of the AI Mode answer |
markdown | string | The AI Mode answer rendered as Markdown (present when include.markdown is true) |
links | object[] | The links in the answer's text, in the order a reader meets them: one entry per web (http or https) link the answer shows, images and code aside, with the words it shows (text), where it goes (url), its domain and its 1-based position. Sources cited by pills are in citationPills; links to the same page appear in both when the answer does both. Empty when the text links nowhere. |
sources | object[] | Sources the response cites |
citationPills | object[] | Citation pills that appear inline in the AI Mode answer. Every element pairs one pill with one source: a pill backed by N sources (Google's [Label +N] chips) yields N elements with the same citationPillId, each holding that source's own label, url and domain. Grouping by citationPillId rebuilds the pills. Empty when the answer has no pills. |
places | object[] | Place cards embedded inline in the response |
shoppingCards | object[] | Shopping-related product details parsed from the response |
inlineProducts | object[] | Product cards that appear inside the AI answer text |
videos | object[] | Video cards shown inline within the AI response (YouTube for now) |
map | object[] | Locations pulled from the response, enriched with GPS coordinates |
ads | object | Section of sponsored ads parsed from the response |
AI Mode answers versus Google’s developer APIs
Google AI Mode is Google Search’s conversational answer surface. This endpoint returns that answer for a prompt, market, city and language, with citation pills, places, map pins, shopping cards, videos and, when Google shows sponsored products, ads as structured fields. inlineProducts is in the schema and comes back empty: Google shows an inline product mention without a name or price.
Google’s long-standing developer route to search results is the Custom Search JSON API. Its overview (checked 2026-09-17, developers.google.com) says it returns web and image results from a Programmable Search Engine, offers 100 free queries per day and $5 per 1,000 beyond that up to 10,000 per day, is closed to new customers, and gives existing customers until January 1, 2027 to transition. Its cse.list reference (checked 2026-09-17, developers.google.com) documents gl, hl, cr and lr parameters and does not mention AI Overviews, ads, local packs or knowledge panels.
In AI Mode users read a composed response instead of scanning ten links, so whether your brand is named, and in which sentence, is the visibility metric. Citations appear as [Label +N] chips that bundle several sources; citationPills records every source behind every chip, so you can measure both “cited at all” and “cited first in a chip”. Products (shoppingCards), sponsored products (ads), local businesses (places, map) and videos sit inside the answer and vary by location and device.
An annotated response
The excerpt follows the result schema for POST /v1/monitor/aimode. Values are illustrative.
{
"success": true,
"result": {
"text": "For families, look for hotels near the riverfront with interconnecting rooms...",
"sources": [
{
"position": 1,
"url": "https://www.example-travel.com/lisbon/family-hotels",
"label": "Best family hotels in Lisbon",
"description": "Rooms for four, pools and quiet streets..."
}
],
// One entry per (chip, source). citationPillId is 1-based; position points
// into result.sources. redirectLink appears only when Google served a /goto link.
"citationPills": [
{
"label": "Best family hotels in Lisbon",
"citationPillId": 1,
"url": "https://www.example-travel.com/lisbon/family-hotels",
"domain": "example-travel.com",
"position": 1
}
],
"places": [
{
"title": "Example Riverside Hotel",
"link": "https://www.google.com/viewer/place?example",
"placeId": "ChIJexampleLisbon",
"index": 0,
"rating": 4.6,
"reviews": 2140,
"type": "Hotel",
"priceLevel": "€€€",
"address": "Rua Exemplo 10, Lisboa"
}
],
"map": [
{
"title": "Example Riverside Hotel",
"placeId": "ChIJexampleLisbon",
"gps_coordinates": { "latitude": 38.707, "longitude": -9.136 },
"rating": 4.6
}
],
// position is 0-indexed within the shopping carousel.
"shoppingCards": [],
// ads is an object: a section title plus the ads in it.
"ads": { "title": "Sponsored", "ads": [] },
"videos": [
{
"title": "Lisbon with kids: where to stay",
"link": "https://www.youtube.com/watch?v=example",
"platform": "YouTube",
"channel": "Example Family Travel",
"duration": "12:04"
}
]
}
}
Notes for this engine
Geo and language targeting
| Field | Values | Notes |
|---|---|---|
country or gl |
ISO 3166-1 alpha-2, either case for gl |
One is required; sending both with different values is a 400. GET /v1/countries?model=aimode lists codes. |
hl |
Google interface language, e.g. en, de, pt-BR |
Overrides the language derived from the country. |
location |
Google canonical name, City,Region,Country |
City-level precision; the names come from Google Ads geotargets. Not with uule. Without it, Google is localized to the requested country. |
uule |
Pre-encoded UULE string | Alternative to location. |
device |
desktop, mobile |
Default desktop. |
For a region or city below the country, use location (for example Texas,United States). A US state is accepted and answered for the whole US; only ChatGPT and Gemini answer from inside a state (states).
Handling the results
adsis an object withtitleandads[], not an array, andnullwhen the answer shows no sponsored products. Each ad hastitle,url,positionandstore.shoppingCards[].positionis 0-indexed;inlineProducts[].positionis 1-indexed. Prices are objects:price.valueis numeric, andprice.rawkeeps the displayed string on shopping cards.reviewsis a string on shopping cards and ads, but an integer onplacesandmap.redirectLinksits beside resolved links on sources, pills, snippet links, ads and videos. Resolve one yourself withPOST /v1/monitor/google/goto, which is free and runs at most 4 calls per account at once.include.googleGotois deprecated and ignored; redirect links are returned without it.
location expects Google’s canonical City,Region,Country names from the Google Ads geotargets list. Copy names from that list instead of typing them, and keep a vetted list per client.
hl overrides the language derived from the country. When comparing markets, set hl explicitly; see multilingual AI answers.
shoppingCards[].position starts at 0 and inlineProducts[].position at 1. Normalize before storing ranks.
A city grid grows fast: 2 prompts × 3 cities is 6 tasks per day before repeated samples, and answers vary enough between runs that you want several per combination (AI answer volatility).
Related: the best AI Mode scrapers compared, the AI Mode API post, every request field, AI visibility tracking, local rank tracking, rank tracking, competitor analysis, monitoring Google AI Overviews.
Questions
How much does a Google AI Mode request cost?
A request is $2.06 per 1,000 on every tier.
Can I target a US state in AI Mode?
AI Mode accepts state, which implies country US, and answers for the whole US, the same as without it. For a place inside the US, send location instead, for example Texas,United States. See /docs/coverage#states.
Can I target a city in AI Mode?
Yes. Send country (or gl) plus location as a Google canonical location name such as Austin,Texas,United States, or a pre-encoded uule instead of location. location and uule are mutually exclusive.
What is redirectLink in AI Mode results?
When Google serves a link as a /goto redirect, the link field holds the resolved destination and redirectLink holds Google's redirect. POST /v1/monitor/google/goto resolves a redirect link on its own and is free.
Can I set the interface language separately from the country?
Yes. hl sets Google's interface language, for example en or pt-BR, and overrides the language derived from the country, so language and result geography can differ.
Is a failed AI Mode request charged?
No. A failed request is charged nothing and its reservation is released. A completed request is charged the base price.
From the blog
Best Google AI Mode scraper APIs for 2027: fields and prices
How to get Google AI Mode answers as JSON
Best AI Overview tracking tools for 2027: SEO and GEO teams
Docs
- Quickstart
- API reference
- Engine features
- Async tasks and batches
- Webhooks
- Coverage
- Pricing and failures
- Rate limits