# Google AI Overview API (`johnvc/google-ai-overview-api`) Actor

Fetch Google AI Overviews for any query - get the AI-generated answer and its cited sources as structured JSON. Send one or many queries, target a country and language, and handle Google's deferred (page-token) generation automatically. Pay per retrieval. MCP-ready for Claude and AI agents.

- **URL**: https://apify.com/johnvc/google-ai-overview-api.md
- **Developed by:** [John](https://apify.com/johnvc) (community)
- **Categories:** AI, SEO tools, MCP servers
- **Stats:** 3 total users, 3 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## 🔎 Google AI Overview API

API for Google's AI Overview. Send any search query and get back the AI-generated answer (its text blocks) plus the cited source links, as structured JSON. When Google defers generation, this API resolves the answer for you automatically. MCP-ready so Claude and other AI agents can call it as a tool.

---

### 📋 What this API returns

| Field | Description |
|---|---|
| `query` | The search query this row answers. |
| `ai_overview_present` | `true` if Google showed an AI Overview, `false` if none was available. |
| `text_blocks` | The AI Overview content as ordered blocks: paragraphs, headings, lists, and tables. |
| `references` | The cited sources behind the overview, each with `title`, `link`, `snippet`, and `source`. |
| `used_dedicated_api` | `true` when Google deferred generation and a follow-up fetch was needed to resolve the answer. |
| `retrievals_used` | `1` for an inline answer, `2` when a follow-up fetch was required. |
| `thumbnail`, `header_images` | Imagery shown with the overview, when present. |
| `gl`, `hl`, `location` | The country, language, and location used for the search. |
| `note` | A short explanation when no overview was returned. |

---

### 🎯 Use cases

- **GEO / AEO monitoring.** Track whether your brand or domain is cited in Google's AI Overview for the queries you care about.
- **SEO research.** See which sources Google's AI cites for a topic, and how the answer is phrased.
- **Content strategy.** Compare AI Overview answers across queries, countries, or over time.
- **AI agent workflows.** Drive this API over MCP from Claude (see below) to pull AI Overview answers in-conversation.
- **Datasets for analysis.** Batch hundreds of queries into one run and export the answers and citations as JSON.

---

### ⚙️ Input examples

#### Single query

```json
{
  "query": "what is the Siliconimist podcast?"
}
````

#### Many queries at once

```json
{
  "queries": [
    "best practices for prompt engineering",
    "how does vector search work",
    "what is a transformer model"
  ]
}
```

#### Country and language targeting

```json
{
  "query": "electric vehicle tax credit",
  "gl": "us",
  "hl": "en",
  "location": "Austin, Texas, United States"
}
```

Provide a single `query`, a list of `queries`, or both. At least one is required. The API returns one row per query.

> Note: Google's AI Overview is currently shown for English searches (`hl=en`) in a limited set of countries. For some queries Google declines to show an overview at all; those rows come back with `ai_overview_present: false` and a short `note`.

***

### 💰 Pricing (pay-per-event)

| Event | Price | When it fires |
|---|---|---|
| `setup` | $0.01 | Once per Actor run, at startup. |
| `overview-retrieval` | $0.015 | Per retrieval. One for a standard answer; two when Google defers generation and a follow-up fetch is required. |

Examples:

- A query whose answer is returned inline costs $0.01 + $0.015 = **$0.025**.
- A query where Google defers generation costs $0.01 + 2 x $0.015 = **$0.04**.
- A batch of 10 inline answers costs $0.01 + 10 x $0.015 = **$0.16**.

You are billed per retrieval the API actually performs, so deferred queries (which require a second fetch) are the only ones that cost two retrievals.

***

### 🔌 Use this API from Claude (MCP)

This Actor is MCP-server-compatible, so Claude Code, Claude (desktop and web), Cursor, and other MCP clients can call it as a tool through Apify's hosted MCP server.

Add it with this Actor-specific URL:

https://mcp.apify.com/?tools=actors,docs,johnvc/google-ai-overview-api

Setup walkthrough:

https://www.youtube.com/watch?v=jREWahDGhJM

Apify MCP integration docs: https://docs.apify.com/platform/integrations/mcp

**New to Claude Code or Claude Cowork?** Start a free trial here: https://claude.ai/referral/uIlpa7nPLg

Then ask Claude:

> *"Use the Google AI Overview API to get the AI Overview for 'what is the Siliconimist podcast?', and list the cited sources."*

***

### 🚀 How to get started

1. Open the Actor and enter a `query` (or a list of `queries`).
2. Optionally set the country (`gl`), language (`hl`), and `location`.
3. Run it and read the results from the dataset (JSON, CSV, Excel, or API).

[View on Apify Store](https://apify.com/johnvc/google-ai-overview-api?fpr=9n7kx3)

***

### ❓ FAQ

**Why does a query come back with `ai_overview_present: false`?**
Google does not show an AI Overview for every query. It is more likely for question-style, informational searches, and is currently limited to English searches in certain countries. When none is shown, the row includes a short `note`.

**What is `used_dedicated_api` / why do some queries cost two retrievals?**
Google sometimes returns the AI Overview immediately and sometimes defers it, returning only a short-lived token. When that happens, this API makes a second call to resolve the full answer. That second call is the second retrieval.

**Can I pass a token directly?**
No. The deferral token expires within about a minute, so it is resolved automatically inside a single run rather than exposed as an input.

***

Last Updated: 2026.05.30

# Actor input Schema

## `query` (type: `string`):

Enter a single search query to fetch the Google AI Overview for (e.g. 'what is the Siliconimist podcast?'). Provide this, `queries`, or both. AI Overviews appear most often for question-style searches.

## `queries` (type: `array`):

Provide a list of search queries to fetch AI Overviews for in one run. Merged with `query` and de-duplicated. Use this for batch lookups.

## `gl` (type: `string`):

Set the two-letter country code for the search (ISO 3166-1, e.g. 'us', 'gb', 'ca'). Defaults to 'us'. AI Overviews are available in a limited set of countries.

## `hl` (type: `string`):

Set the two-letter interface language code (ISO 639-1, e.g. 'en'). Defaults to 'en'. AI Overviews are currently shown for English searches only, so leaving this as 'en' is recommended.

## `location` (type: `string`):

Optionally narrow results to a specific location by name (e.g. 'Austin, Texas, United States'). Leave empty to use country-level targeting from the country code.

## Actor input object example

```json
{
  "query": "what is the Siliconimist podcast?",
  "gl": "us",
  "hl": "en"
}
```

# Actor output Schema

## `allResults` (type: `string`):

Every dataset item from this run: resolved AI Overview rows (result\_type='ai\_overview') and any error rows.

## `overview` (type: `string`):

Tabular overview of every dataset item using the dataset schema's default view. Columns: type, query, overview present, follow-up fetch, retrievals, sources, note, fetched-at.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "what is the Siliconimist podcast?",
    "gl": "us",
    "hl": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("johnvc/google-ai-overview-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "query": "what is the Siliconimist podcast?",
    "gl": "us",
    "hl": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("johnvc/google-ai-overview-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "what is the Siliconimist podcast?",
  "gl": "us",
  "hl": "en"
}' |
apify call johnvc/google-ai-overview-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=johnvc/google-ai-overview-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google AI Overview API",
        "description": "Fetch Google AI Overviews for any query - get the AI-generated answer and its cited sources as structured JSON. Send one or many queries, target a country and language, and handle Google's deferred (page-token) generation automatically. Pay per retrieval. MCP-ready for Claude and AI agents.",
        "version": "0.0",
        "x-build-id": "7bsX9RAQkttwX6i4b"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/johnvc~google-ai-overview-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-johnvc-google-ai-overview-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/johnvc~google-ai-overview-api/runs": {
            "post": {
                "operationId": "runs-sync-johnvc-google-ai-overview-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/johnvc~google-ai-overview-api/run-sync": {
            "post": {
                "operationId": "run-sync-johnvc-google-ai-overview-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Enter a single search query to fetch the Google AI Overview for (e.g. 'what is the Siliconimist podcast?'). Provide this, `queries`, or both. AI Overviews appear most often for question-style searches."
                    },
                    "queries": {
                        "title": "Search Queries",
                        "type": "array",
                        "description": "Provide a list of search queries to fetch AI Overviews for in one run. Merged with `query` and de-duplicated. Use this for batch lookups.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "gl": {
                        "title": "Country Code",
                        "type": "string",
                        "description": "Set the two-letter country code for the search (ISO 3166-1, e.g. 'us', 'gb', 'ca'). Defaults to 'us'. AI Overviews are available in a limited set of countries.",
                        "default": "us"
                    },
                    "hl": {
                        "title": "Language Code",
                        "type": "string",
                        "description": "Set the two-letter interface language code (ISO 639-1, e.g. 'en'). Defaults to 'en'. AI Overviews are currently shown for English searches only, so leaving this as 'en' is recommended.",
                        "default": "en"
                    },
                    "location": {
                        "title": "Location",
                        "type": "string",
                        "description": "Optionally narrow results to a specific location by name (e.g. 'Austin, Texas, United States'). Leave empty to use country-level targeting from the country code."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
