SerpBase
Back to Blog

Google AI Mode API: Get AI Mode Answers and Cited Sources as JSON

Google AI Mode answers as text, Markdown and cited source URLs through one POST request. Launch-day timings (median 5.3 s), fields, and a Python check for whether your site is cited.

November 12, 2026
By SerpBase Team4 min readguide

Short answer: Google AI Mode is now available as an API endpoint. POST https://api.serpbase.dev/google/ai_mode returns Google's AI Mode answer as plain text and as Markdown, plus the pages it cites with their real URLs. It costs 1 credit per request until 26 November 2026 (16:00 UTC) and 3 credits after that. Failed requests are not charged.

AI Mode is not AI Overview

Google now shows generated answers in two places, and they behave differently:

  • AI Overview is a module at the top of a normal results page. It appears for some queries and not others, and it sits above the usual organic results. Our search endpoint already returns it as ai_overview when Google shows one.
  • AI Mode is a separate conversational answer page. The whole page is the answer: longer text, headings, lists and tables, and a list of cited sources. There are no organic results on it.

If you track brand visibility in AI search, you usually want both. AI Overview tells you whether Google summarizes a query at all on the normal results page; AI Mode tells you what Google says when a user asks the question in its AI interface, and which sites it cites.

The request

curl -X POST 'https://api.serpbase.dev/google/ai_mode' \
  -H "Content-Type: application/json" \
  -H 'X-API-Key: YOUR_API_KEY' \
  --max-time 60 \
  -d '{"q":"how does a heat pump work","gl":"us","hl":"en"}'

Parameters:

NameWhat it does
qThe question, written the way a person would ask it
glCountry, for example us, de, jp
hlInterface language, for example en
formatjson (default) or markdown. markdown returns the answer as Markdown text with no JSON envelope, which is convenient to pass straight to a language model

What comes back

The JSON response carries the usual status, credits_charged and request_id, plus an ai_mode object:

FieldContent
ai_mode.textThe answer as plain text, paragraphs separated by blank lines
ai_mode.markdownThe same answer with headings, lists, tables and emphasis
ai_mode.sources[]The cited pages in the order Google lists them: title (the site name the citation shows), link, page_title, snippet

The link values are the cited pages' own URLs, not Google redirect links, so you can match them against your own domains directly.

How long it takes: launch-day numbers

AI Mode generates a fresh answer for every question, so it is slower than a normal search. On 11 November 2026 we sent 30 questions through the public endpoint, nine seconds apart. For the 26 that returned an answer:

MeasureValue
Median response time5.3 s
90th percentile9.1 s
Slowest13.2 s
Answer length380 to 4,688 characters
Answers that cited sources22 of 26, up to 21 sources each

This is one small test on launch day, not a latency promise. The practical advice follows from it: set your HTTP client timeout to 60 seconds, as in the example above. A 5- or 10-second timeout will cut off many answers that were on their way. Our timeout study of normal Google searches reaches the same conclusion for slower pages.

Example: is my site cited?

A common use is checking, for a list of questions in your market, whether Google's AI Mode cites your domain:

import requests
from urllib.parse import urlparse

API = "https://api.serpbase.dev/google/ai_mode"
HEADERS = {"X-API-Key": "YOUR_API_KEY"}
MY_DOMAIN = "example.com"

questions = [
    "best heat pump for a cold climate",
    "how much does a heat pump cost to run",
]

for q in questions:
    r = requests.post(API, headers=HEADERS, json={"q": q, "gl": "us", "hl": "en"}, timeout=60)
    data = r.json()
    if data.get("status") != 0:
        print(q, "-> failed:", data.get("error"))
        continue
    sources = data.get("ai_mode", {}).get("sources", [])
    hosts = [urlparse(s.get("link", "")).hostname or "" for s in sources]
    cited = [i + 1 for i, h in enumerate(hosts) if h.endswith(MY_DOMAIN)]
    print(q, "-> cited at", cited if cited else "not cited", f"({len(sources)} sources)")

Check status, not only the HTTP code: a failed request has a non-zero status and an error, and is not charged.

Things to know

  • Answers change. Ask the same question twice and the wording, and sometimes the cited sources, can differ. For tracking, store each answer with its date and compare citations over time rather than exact text.
  • Not every question gets a long answer. Short factual questions can come back as a few sentences with no sources.
  • Phrase questions naturally. AI Mode is built for full questions; a bare keyword often gives a thinner answer than a question.

Try it

New accounts get 500 free credits, which at the launch price is up to 500 AI Mode answers. The endpoint reference has the full parameter list and a Playground button. If you also track the AI module on normal results pages, see SERP feature monitoring, and for feeding answers into your own agent, grounding AI answers with live Google results.