Web research5 min readBy Purrkey team

How to pull Google Search AI Mode answers with citations

Run a Google AI Mode query through Purrkey and get Markdown answer blocks plus cited reference metadata

On this page

You have 25 keyword questions about a product category and need a cited AI Mode answer for each before drafting a briefing. Run each question through serpapi.google.ai_mode and turn the responses into a worksheet that separates the answer text from its cited references. No run has been executed for this guide; the tables show a design and use placeholders

Build the worksheet

Example query (invented): noise-cancelling headphones for travel. Replace it with your own question. The worksheet has one row per reference; repeat the query and answer fields when a query has several references. Values here are placeholders showing the shape

queryreconstructed_markdowntext_blocks.typetext_blocks.snippetreferences.indexreferences.titlereferences.linkreferences.sourcenotice
(query)(Markdown answer)(block type)(snippet)(integer)(title)(link)(source)(notice or empty)

Use the query column as the key so you can sort or filter by the exact question. If a query has three cited references, the query appears in three rows with the same reconstructed_markdown, text_blocks.type, text_blocks.snippet and notice. That shape lets you filter on references.index to count how many questions have at least one mapped citation. Leave reference columns empty when a block has no mapped citation

Inputs for each query

The catalog lists serpapi.google.ai_mode under POST /v1/runs. The current input schema shows q as required and gl, hl and location as optional. Set q to the research question. Use a two-letter country code for gl, a two- or three-letter language code with optional region for hl, and a city-level value for location when the question needs geo or language targeting. The q pattern excludes control characters, so paste questions as plain text. location is a string with a maximum of 200 characters; keep it to a city name plus region where needed

This is the step where the q limit matters: it must be 1-500 characters. A search that returns no results still counts as one call, and the response sets notice. Failed searches are not charged

Read the answer and citations

reconstructed_markdown holds the full answer as Markdown. text_blocks holds the answer blocks; use text_blocks.type and text_blocks.snippet to scan them, and text_blocks.reference_indexes to see which references a block cites. references holds up to 50 cited sources with index, title, link, source and snippet. text_blocks and references each hold up to 50 items. text_blocks.snippet_highlighted_words and text_blocks.list can help you scan structured blocks, but the decision table only needs type, snippet and reference_indexes

Match text_blocks.reference_indexes to references.index before you draft. A claim with a mapped reference goes to the source-check queue; a claim with no mapped reference goes to primary-source verification. If notice is set, mark the query as no result and keep the row. Do not read an empty answer as a negative finding; the search still counts as one call. The tool cannot tell you whether a source supports a claim; it returns the answer and the cited reference metadata. For a related check on AI Overviews, see https://purrkey.app/blog/check-google-ai-overviews

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to run each research question below through serpapi.google.ai_mode. Check the current inputs and price of serpapi.google.ai_mode before running anything. Set q to the question; use gl, hl and location only when the question needs country, language or city targeting. Return a table with query, reconstructed_markdown, text_blocks.type, text_blocks.snippet, references.index, references.title, references.link, references.source and notice. Repeat query and answer fields when a query has several references. Leave reference fields empty when no reference is mapped. Do not treat a cited reference as verification of a claim. Replace the example list with your 25 queries. Example list: noise-cancelling headphones for travel.

Estimated tool cost

Price from the Purrkey catalog, read November 20, 2026: $0.015 per call, unit call, price revision serpapi-developer-retail-2026-11-18. The separate max_call label means "Maximum per call. Successful runs settle at the actual AnyAPI charge." The totals below are ceilings; failed searches are not charged, while a search that returns no results still counts as one search. Agent model fees are not counted

StepFormulaUnit pricePlanned quantityTotal
Single answer check1 call x $0.015$0.015 per call1$0.015
25-question research pass25 calls x $0.015$0.015 per call25$0.375
500-query monthly monitor500 calls x $0.015$0.015 per call500$7.50

The 25-question pass matches the worksheet: one call per question, before any retry. If you add a second call for a question, add $0.015 to the ceiling

Next action

Open https://purrkey.app/tools/google_search?q=ai_mode and check the current inputs and price before you run the 25 queries

Get started by giving this to your agent

  • Claude Code
  • Codex
  • Gemini CLI
  • Cursor
  • GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with Google Search.
Explore Google Search tools and pricing

FAQ

How do I pull Google AI Mode answers with citations?

Run each research question as q through serpapi.google.ai_mode. The response returns reconstructed_markdown, text_blocks, references and an optional notice.

What inputs does serpapi.google.ai_mode take?

q is required, with gl, hl and location optional. q is limited to 1-500 characters, gl is a two-letter country code, hl is a language code, and location is recommended at city level.

What does the notice field mean?

notice is set when the search engine returned no results for the query. The search still counts as one call, while failed searches are not charged.

How much does a 25-question research pass cost?

At $0.015 per call, 25 calls cost at most $0.375. A single answer check is $0.015, and a 500-query monthly monitor is at most $7.50.

What do references.index and text_blocks.reference_indexes do?

references.index identifies a cited source, and text_blocks.reference_indexes lists the indexes cited by an answer block. Match the two to see which reference belongs to a block.

Why does a no-result search still count as a call?

The price rule says a search that returns no results still counts as one search. The response sets notice for that case, and failed searches are not charged.

Next step

Try this with Google Search

The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.

See Google Search tools

Share this article