The Google AI Overviews API returns structured JSON for a search query. Read data.ai_overview for the answer and data.sources for citations. Always send query, gl, and hl, and let your code handle a valid result with no AI Overview.
The Google AI Overviews API turns one Google search query into JSON. Send the query, country, and language. The response can contain the AI Overview answer, its cited pages, the Google results URL, a screenshot URL, and raw HTML. This saves you from opening a browser and writing a parser for Google's page.
Start with GET /ai-overview. Read data.ai_overview for the answer and data.sources for citations. Do not assume that both fields will always contain data. Google does not show an AI Overview for every search.
See the Google AI Overviews API product page for current plans and request limits.
Try one Google AI Overview request
What does the Google AI Overviews API return?
It returns a JSON object instead of a rendered Google page. That makes the result easier to use in an application, spreadsheet importer, or monitoring job.
| Data | JSON field | Simple meaning |
|---|---|---|
| Answer | data.ai_overview | The AI Overview text shown for the query |
| Citations | data.sources | A list of pages connected with the answer |
| Search URL | data.url | The Google search URL created from your inputs |
| Screenshot | data.screen_url | A visual record that can help with debugging |
| Raw page | data.html | The captured HTML, which can be large |
The field names above were observed in a live product test on August 5, 2026. Search results are not permanent. The answer and citations can change when the query, country, language, or collection time changes.
How do I make the first request?
You need a RapidAPI subscription and an API key. Put the key in the x-rapidapi-key header. Never place that key in browser JavaScript or commit it to Git.
curl --request GET \
--url "https://google-ai-overviews.p.rapidapi.com/ai-overview?query=what%20is%20bitcoin&gl=us&hl=en" \
--header "x-rapidapi-host: google-ai-overviews.p.rapidapi.com" \
--header "x-rapidapi-key: $RAPIDAPI_KEY"
The request has three inputs:
| Parameter | Example | What to send |
|---|---|---|
query | what is bitcoin | The search question or phrase |
gl | us | A two letter country code |
hl | en | The search language code |
Send all three values explicitly. This makes repeated checks easier to compare and prevents an unknown default country or language from changing your dataset.
How do I read the JSON response?
A successful test returned an outer object with description, status, and data. The shortened example below keeps the real field names but removes the full answer, screenshot location, and raw HTML.
{
"description": "OK",
"status": 200,
"data": {
"exists": true,
"url": "https://www.google.com/search?q=what+is+bitcoin&hl=en&gl=us&num=10",
"ai_overview": "[answer text omitted]",
"sources": [
{
"url": "https://example.com/article",
"title": "Example source",
"site": "example.com",
"position": 1
}
],
"screen_url": "[screenshot URL omitted]",
"html": "[raw HTML omitted]"
}
}
Use the outer status to check the API result. Then check that data is an object. Inside it, treat ai_overview and sources as optional result data. This is safer than assuming that every HTTP 200 response contains an answer with citations.
A simple Python example
The script below uses Python 3 and the requests package. It keeps the API key in an environment variable, sets a 45 second timeout, and handles an answer without citations.
import os
import requests
API_URL = "https://google-ai-overviews.p.rapidapi.com/ai-overview"
api_key = os.environ.get("RAPIDAPI_KEY")
if not api_key:
raise RuntimeError("Set the RAPIDAPI_KEY environment variable first.")
response = requests.get(
API_URL,
headers={
"x-rapidapi-host": "google-ai-overviews.p.rapidapi.com",
"x-rapidapi-key": api_key,
},
params={
"query": "what is bitcoin",
"gl": "us",
"hl": "en",
},
timeout=45,
)
response.raise_for_status()
payload = response.json()
data = payload.get("data")
if payload.get("status") != 200 or not isinstance(data, dict):
message = payload.get("description", "Unexpected API response")
raise RuntimeError(message)
answer = data.get("ai_overview")
sources = data.get("sources")
if not isinstance(sources, list):
sources = []
if not answer:
print("This search did not return an AI Overview.")
elif not sources:
print(answer)
print("\nThe response did not include a source list.")
else:
print(answer)
print("\nSources:")
for source in sources:
if isinstance(source, dict):
title = source.get("title") or source.get("site") or "Untitled source"
url = source.get("url") or "No URL"
print(f"- {title}: {url}")
Install the dependency with python -m pip install requests. Then set RAPIDAPI_KEY in your terminal and run the file. On PowerShell, use $env:RAPIDAPI_KEY="your-key". On macOS or Linux, use export RAPIDAPI_KEY="your-key".
Handle three result states
A beginner integration often checks only whether the request returned HTTP 200. That is not enough. Your application should keep these three states separate:
| State | What you see | What your code should do |
|---|---|---|
| No AI Overview | No usable ai_overview | Store the check as completed with no overview |
| Answer without sources | Answer text and an empty or missing source list | Store the answer and an empty citation list |
| Answer with sources | Answer text and one or more source objects | Store both the answer and every source record |
Do not turn a missing AI Overview into a fake parser error. Google says AI Overviews are shown only when its systems decide they add value to the normal search results, so some queries will not trigger one.
Which errors should I retry?
Retry only problems that may be temporary. Examples are a network timeout or HTTP 500, 502, 503, and 504. Wait before retrying and stop after a small number of attempts. Do not retry an unchanged HTTP 400 request because it usually means an input is missing or invalid.
In the August 5 test, a request without query returned HTTP 400 with a message that the query field was required. Some valid queries also produced temporary HTTP 500 responses. This is why production code needs both a timeout and a limited retry policy.
What should I save in the database?
Save a new observation for every check. Do not overwrite yesterday's answer with today's answer.
- Save
query,gl, andhl. - Save the collection time in UTC.
- Save the answer text and the source list.
- Save a clear status for no overview, answer without sources, or answer with sources.
This gives you enough history to see when a domain appeared, disappeared, or changed position. Keep the screenshot or raw HTML only when you need it for debugging or auditing because those fields can use much more storage.
For a focused next step, read how to check whether your website is cited in Google AI Overviews. If you are deciding whether to maintain your own browser automation, see the Google AI Overview API versus DIY scraping comparison.
Frequently asked questions
Does every query return an AI Overview?
No. A successful API request can still produce no AI Overview because Google does not show one for every search.
Can I call the API from browser JavaScript?
Do not put the RapidAPI key in browser code. Call the API from your server so visitors cannot read and reuse your key.
Are country and language important?
Yes. Use gl for the country and hl for the language. The answer and cited pages can differ between markets.
How much does a test cost?
The product page listed a free Basic plan with 200 requests per month when checked on September 22, 2026. Pricing can change, so confirm the current limit before starting a large job.
Sources and verification dates
- DataOcean Google AI Overviews on RapidAPI, product listing checked September 22, 2026.
- Let's Scrape Google AI Overviews API product page, endpoint, inputs, and plans checked September 22, 2026.
- Google Search Central documentation for AI features, checked September 22, 2026.
The response fields and error examples in this guide come from a live product test performed on August 5, 2026. They are test observations, not a promise that Google will return the same answer or citations later.