Search API · Google AI
Google AI Mode
and AI Overviews, as data.
Track what Google’s AI answers say and which sources they cite. The PacketStream Search API returns AI Mode answers and AI Overviews as JSON or Markdown, with their references. $0.0025 per successful search.
Google AI Mode
Set type to ai_mode. You can add country and language; other options return 400 unsupported_option before any charge.
curl -s https://api.packetstream.io/v1/search \
-H "Authorization: Bearer $PACKETSTREAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "how does a burr coffee grinder work", "type": "ai_mode", "country": "us"}'A live response, shortened. The answer is in ai_mode: text_blocks hold the text, and references list the sources Google cited.
{
"request_id": "6d6a0eb6-3252-4f31-b78c-461fef48f795",
"search": {
"engine": "google",
"type": "ai_mode",
"query": "how does a burr coffee grinder work",
"country": "us",
"page": 1
},
"ai_mode": {
"text_blocks": [
{
"type": "paragraph",
"text": "A burr coffee grinder works by crushing and cutting coffee beans between two revolving abrasive surfaces (called burrs) with a tightly controlled gap, …"
},
{
"type": "list",
"items": [
"Feeding: Whole coffee beans drop from the hopper into the chamber between the two burrs.",
"Crushing/Breaking: One burr stays stationary while the other spins …",
…
]
},
…
],
"references": [
{
"title": "Deep Dive: Coffee Grinder Burrs",
"url": "https://counterculturecoffee.com/blogs/counter-culture-coffee/deep-dive-coffee-grinder-burrs",
"source": "Counter Culture Coffee"
},
…
]
},
"result_count": 5,
"charged_units": 1,
"processing_time_ms": 4208
}- An AI Mode response has no
resultslist.result_countis the number of references. - Each text block is a
paragraphorheadingwith itstext, or alistwith itsitems. There are up to 40 blocks and 20 references, and each text value is at most 2,000 bytes. - Google sometimes answers without sources.
referencesis then empty andresult_countis0. The search is still billed, because it ran.
Google AI Overviews
AI Overviews come with a normal web search. Send a search request (the default type). When Google shows an AI Overview, the response has an ai_overview block next to the web results, with the same shape as ai_mode.
curl -s https://api.packetstream.io/v1/search \
-H "Authorization: Bearer $PACKETSTREAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "how does a burr coffee grinder work", "country": "us"}'A live response, shortened:
{
"request_id": "a9ccfd72-a67c-4789-b25e-7e3f36e5b659",
"search": { "engine": "google", "type": "search", "query": "how does a burr coffee grinder work", "country": "us", "page": 1 },
"results": [
{
"position": 1,
"title": "How does a coffee grinder work?",
"url": "https://www.cartwrightcoffee.co.uk/blog/how-does-a-coffee-grinder-work/",
"snippet": "Flat burr grinders work mainly through centrifugal force. …",
"displayed_url": "https://www.cartwrightcoffee.co.uk › Blog"
},
…
],
"ai_overview": {
"text_blocks": [
{ "type": "paragraph", "text": "A burr coffee grinder works by crushing and cutting whole coffee beans between two revolving abrasive surfaces (called burrs) separated by a user-adjusted gap. …" },
{ "type": "heading", "text": "The Core Grinding Process" },
…
],
"references": [
{ "title": "Burr mill - Wikipedia", "url": "https://en.wikipedia.org/wiki/Burr_mill", "source": "Wikipedia" },
…
]
},
"people_also_ask": [{ "question": "Which is better, a burr or blade coffee grinder?" }, …],
"related_searches": […],
"search_information": { "total_results": 130 },
"result_count": 5,
"charged_units": 1,
"processing_time_ms": 3096
}- The block appears only when Google showed an AI Overview and it could be read reliably. Many queries have none, so do not build logic that needs it.
- Mobile searches (
"device": "mobile") usually carry fewer blocks. - The search is billed whether or not an AI Overview appears.
Markdown for AI pipelines
Add "format": "markdown" to either request. The Markdown output includes the AI Overview or AI Mode answer next to the results, with text from web pages escaped so it cannot inject HTML or links.
What teams use it for
- AI visibility tracking: see whether your pages appear in the references for the queries you care about.
- Answer monitoring: record what the AI answer says about a brand or product over time.
- Market checks: compare answers across countries and languages with
countryandlanguage.
To run many queries at once, batch searches takes up to 10 searches in one request.
Pricing
Each successful search costs $0.0025, or $2.50 per 1,000, the same for AI Mode as for every other type. Failed searches are free. Searches draw from your prepaid PacketStream balance, with a $50 minimum purchase and no subscription. Each key can make 20 requests per second, with bursts of 200. See API pricing.