The Autom Google AI Mode API returns Google's AI Mode answer and its cited sources as structured JSON.
- Google AI Mode API — Query Google AI Mode via API.
Use it to monitor how AI search talks about your brand (GEO), track cited sources or benchmark AI answers.
| Endpoint | Request | Credits |
|---|---|---|
| Google AI Mode API | GET /v1/google/search/ai |
3 |
- How it works
- Google AI Mode API
- Code examples in other languages
- Use cases
- Why Autom?
- FAQ
- Official SDKs
- Related repositories
- Support
- Create a Autom account and copy your API key from the dashboard.
- Call
https://api.autom.devwith the headerx-api-key: YOUR_API_KEY. - Use the result in your app — no infrastructure to run.
export AUTOM_API_KEY="your-api-key"
pip install requests # Python
# TypeScript: Node.js 18+ (native fetch), run with `npx tsx file.ts`Query Google AI Mode via API. JSON with text_blocks, references, and shopping_results.
GET https://api.autom.dev/v1/google/search/ai · 3 credits per request · API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
query |
query | string | ✅ | The question or search query you want Google AI Mode to answer (supports advanced operators like site:, inurl:, intitle:). |
location |
query | string | — | Human-readable location to originate the search from (e.g. New York, NY, Paris, France). If several locations match, the most popular one is used. Note: location and uule cannot be used together. |
uule |
query | string | — | Google encoded location parameter. Use for precise geo targeting. Note: uule and location cannot be used together. |
gl |
query | string | — | Country to use for the Google AI Mode search (two-letter country code, e.g. us, fr). |
hl |
query | string | — | Language to use for the Google AI Mode search (two-letter language code, e.g. en, fr). |
import os
import requests
API_KEY = os.environ["AUTOM_API_KEY"]
HEADERS = {"x-api-key": API_KEY}
response = requests.get(
"https://api.autom.dev/v1/google/search/ai",
headers=HEADERS,
params={
"query": "what is mozilla firefox",
},
timeout=120,
)
response.raise_for_status()
data = response.json()
print(data)type GoogleAiModeApi = {
references?: {
link?: string;
index?: number;
title?: string;
source?: string;
snippet?: string;
thumbnail?: string;
source_icon?: string;
}[];
text_blocks?: {
type?: string;
snippet?: string;
}[];
shopping_results?: unknown[];
search_parameters?: {
q?: string;
gl?: string;
hl?: string;
engine?: string;
};
reconstructed_markdown?: string;
};
const headers = { "x-api-key": process.env.AUTOM_API_KEY!, "Content-Type": "application/json" };
const params = new URLSearchParams({
"query": "what is mozilla firefox",
});
const response = await fetch(`https://api.autom.dev/v1/google/search/ai?${params}`, { headers });
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const data = (await response.json()) as GoogleAiModeApi;
console.log(data);Example response from the API reference, abridged.
{
"references": [
{
"link": "https://www.mozilla.org/firefox/",
"index": 0,
"title": "Firefox Browser",
"source": "mozilla.org",
"snippet": "Official Firefox download and overview.",
"thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcFirefoxThumb",
"source_icon": "https://www.google.com/s2/favicons?domain=mozilla.org&sz=128"
},
{
"link": "https://en.wikipedia.org/wiki/Firefox",
"index": 1,
"title": "Firefox - Wikipedia",
"source": "en.wikipedia.org"
}
],
"text_blocks": [
{
"type": "paragraph",
"snippet": "Mozilla Firefox is a free, open-source web browser developed by the Mozilla Foundation. It is available on desktop and mobile, supports e…"
},
{
"type": "heading",
"level": 3,
"snippet": "Key features"
}
],
"shopping_results": [],
"search_parameters": {
"q": "what is mozilla firefox",
"gl": "us",
"hl": "en",
"engine": "google_ai_mode"
},
"reconstructed_markdown": "Mozilla Firefox is a free, open-source web browser developed by the Mozilla Foundation. It is available on desktop and mobile, supports e…"
}| Field | Type | Description |
|---|---|---|
references[] |
object[] | |
references[].link |
string | |
references[].index |
integer | |
references[].title |
string | |
references[].source |
string | |
references[].snippet |
string | |
references[].thumbnail |
string | |
references[].source_icon |
string | |
text_blocks[] |
object[] | |
text_blocks[].type |
string | |
text_blocks[].snippet |
string | |
shopping_results |
any[] | |
search_parameters |
object | |
search_parameters.q |
string | |
search_parameters.gl |
string | |
search_parameters.hl |
string | |
search_parameters.engine |
string | |
reconstructed_markdown |
string |
Ready-to-run examples live in examples/; each reads your key from AUTOM_API_KEY.
| Language | google-search-ai |
|---|---|
| cURL (Bash) | google_search_ai.sh |
| PHP | google_search_ai.php |
| C# | GoogleSearchAi.cs |
| Go | google_search_ai.go |
| Java | GoogleSearchAiExample.java |
| Ruby | google_search_ai.rb |
| Node.js | google_search_ai.mjs |
- Generative Engine Optimization — See which sources AI Mode cites for your topics.
- Brand monitoring — Track how AI answers describe your brand and competitors.
- Every SERP in one API — Google Search, AI Mode, Maps, News, Shopping, Images, Videos, Jobs, Autocomplete, plus Bing and Brave.
- Structured JSON — documented fields instead of brittle HTML parsing.
- Geo & language targeting — search like a user from the country and language you need.
- One API key, one header —
x-api-keyon every request. - Copy-paste examples — Python and TypeScript in each README, 7 more languages in
examples/.
Create an account on Autom, copy your API key and send it in the x-api-key header of every request to https://api.autom.dev.
Credits per call: /v1/google/search/ai 3. See Autom pricing.
Any language that can make an HTTP request. This README shows Python and TypeScript; the examples/ folder contains cURL, PHP, C#, Go, Java, Ruby and Node.js.
Use Autom from your own language with a typed client:
| SDK | Package | Install |
|---|---|---|
| Node.js | @automdev/sdk |
npm install @automdev/sdk |
| Python | automdev |
pip install automdev |
| Go | autom-go |
go get github.com/automdev/autom-go |
| .NET | Autom |
dotnet add package Autom |
| Ruby | autom |
gem install autom |
| PHP | autom/sdk |
composer require autom/sdk |
| Java | autom-java |
build from source, see its README |
| CLI | @automdev/cli |
npm install -g @automdev/cli |
| MCP server | @automdev/mcp |
npx -y @automdev/mcp |
- Google Search API
- Google Maps API
- Google News API
- Google Shopping API
- Google Images API
- Google Videos API
- Google Jobs API
- Google Autocomplete API
- All Autom repositories
- 💬 Join the Discord to ask questions and share what you build.
- 📚 Read the API reference.
- 🔑 Get your API key.
Built by Autom. Examples are released under the MIT license.
