ScavioScavio
Pricing
Tools
Sign InsGet Startedg
Blog
Google7 min readNov 29, 2026

How to Get Google AI Mode Answers and Their Cited Sources Through an API

Use Scavio's Google AI Mode API: one POST returns the AI Mode answer as typed text blocks and every source it cited with its direct link, for 1 credit a query.

Scavio Team

Nov 29, 2026

Try the Google AI Mode API free
scavio
AI visibility / SEO
Google

To get Google AI Mode answers programmatically, use Scavio's Google AI Mode API. POST /api/v2/google/ai-mode with a query, a country and a language returns the answer Google's AI Mode gives, split into typed text blocks (paragraphs, headings, lists and tables), and a references array with every source it cited: title, direct link, snippet and publisher. Each paragraph lists the references that support it in reference_indexes. A call costs 1 credit, about $0.001 on the Growth plan.

Google does not publish an AI Mode API. Search Console counts AI Mode clicks and impressions for your own pages inside its Web search type, and the Generative AI performance report shows impressions of your pages in AI Overviews and AI Mode, but neither shows the answer itself or the competitors it cited. The steps below use responses captured from Scavio on November 29, 2026.

Step 1: Get the answer

Bash
curl -s https://api.scavio.dev/api/v2/google/ai-mode \
  -H "Authorization: Bearer $SCAVIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "best vpn for streaming", "gl": "us", "hl": "en"}'

The response is flat: text_blocks and references sit at the top level, not under a data key. Trimmed to the first paragraph, two of the four table rows and two of the nine references, with each reference's favicon URL removed:

JSON
{
  "search_parameters": {
    "q": "best vpn for streaming",
    "hl": "en",
    "gl": "us",
    "device": "desktop",
    "google_domain": "google.com"
  },
  "text_blocks": [
    {
      "type": "paragraph",
      "snippet": "I would choose [Highlight start] NordVPN [Highlight end] as the best overall VPN for streaming because it combines top-tier 4K speeds with broad platform compatibility and reliable unblocking. Depending on your budget, devices, and ease-of-use preferences, a few other providers stand out.",
      "reference_indexes": [0, 1, 7]
    },
    {
      "type": "table",
      "table_headers": ["VPN Provider", "Simultaneous Devices", "Standout Streaming Feature", "Primary Drawback"],
      "table_rows": [
        ["NordVPN", "10 devices", "Fastest speeds with minimal 4K buffering", "Higher renewal costs"],
        ["ExpressVPN", "8 devices", "Easiest setup; servers in all 50 US states", "Most expensive option"]
      ]
    }
  ],
  "references": [
    {
      "title": "Best VPN for Streaming in 2026: Unblock International Movies ...",
      "link": "https://www.cnet.com/tech/services-and-software/best-vpn-for-streaming/",
      "snippet": "ExpressVPN is currently the best VPN for streaming. It effortlessly unblocks Netflix and other popular streaming services like Ama...",
      "source": "CNET",
      "index": 0
    },
    {
      "title": "The fastest VPN for high‑speed streaming of movies and TV | NordVPN",
      "link": "https://nordvpn.com/streaming/",
      "snippet": "NordVPN: High-speed streaming VPN (817+ Mbps overall, +3ms latency, Streaming criteria & fixes: HD (5-8 Mbps), 4K (25 Mbps); Disne...",
      "source": "NordVPN",
      "index": 1
    }
  ],
  "shopping_results": [],
  "cached": false,
  "response_time": 8300,
  "credits_used": 1
}

Blocks come typed as paragraph, heading (with a level), list, ordered_list and table, so you can render the answer or parse its comparison table directly. The [Highlight start] and [Highlight end] markers wrap the phrase AI Mode emphasised as its pick; in 16 of 30 buyer answers we captured, that phrase named the top recommendation.

Step 2: Tie each claim to its sources

reference_indexes on a block points at entries in references by their index. The opening paragraph above cites 0, 1 and 7: CNET's VPN guide, NordVPN's own streaming page and a YouTube review, "Best VPN for Streaming: Buffering, TV Apps & Connection Limits". Across the 30 answers in our test, 227 of the 304 references were attached to at least one block this way. The rest were listed as sources without being tied to a specific sentence.

That matters for AI visibility work: a source cited next to the recommendation sentence is doing more for its owner than one listed at the bottom.

Step 3: Check whether your domain is cited

Each reference's link is the publisher's own URL, so a citation check is a set operation on hostnames:

Python
import requests
from urllib.parse import urlparse

API_KEY = "sk_live_your_key"  # load from your secret store in real code

def ai_mode(query, gl="us", hl="en"):
    r = requests.post(
        "https://api.scavio.dev/api/v2/google/ai-mode",
        headers={"Authorization": f"Bearer {API_KEY}"},
        json={"query": query, "gl": gl, "hl": hl},
        timeout=90,
    )
    r.raise_for_status()
    return r.json()

def cited_domains(res):
    return [urlparse(r["link"]).netloc.removeprefix("www.").removeprefix("m.")
            for r in res["references"]]

res = ai_mode("best vpn for streaming")
print(cited_domains(res))

For the response above it prints:

['cnet.com', 'nordvpn.com', 'pcmag.com', 'youtube.com', 'quora.com', 'youtube.com', 'reddit.com', 'youtube.com', 'experte.com']

NordVPN's own site is cited; ExpressVPN, the second row of the answer's table, is named but not linked. Strip m. as well as www.: one of the YouTube links in this answer was m.youtube.com.

Step 4: Hold the market constant

gl (country) and hl (language) decide which market's answer you get, and search_parameters echoes them back so stored rows record what was asked. location or uule narrow it to a city, and device switches to the mobile layout. The market changes the sources: "best budgeting app" with gl set to us and to gb named Monarch Money as the pick both times, but the two answers shared only 3 cited domains, YouTube, Goodbudget and Forbes. The US answer cited NerdWallet and Chime; the UK answer cited Which?, Boring Money and a Reddit thread. Track each market as its own series.

Step 5: Compare with the AI Overview on the normal results page

AI Overviews and AI Mode are different surfaces. The Google Search endpoint returns the full results page, and when Google shows an AI Overview it comes back as ai_overview with the same block and reference shape:

Bash
curl -s https://api.scavio.dev/api/v2/google \
  -H "Authorization: Bearer $SCAVIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "best crm for startups", "gl": "us", "hl": "en"}'
JSON
{
  "ai_overview": {
    "text_blocks": [
      {
        "type": "paragraph",
        "snippet": "The best CRM for a startup depends on your stage and sales motion, with [Highlight start] HubSpot standing out for all-in-one scalability and Attio standing out for modern, lightweight early-stage workflows [Highlight end].",
        "snippet_links": [
          { "text": "HubSpot", "link": "https://www.hubspot.com/products/crm/startups" }
        ],
        "reference_indexes": [0, 1, 2, 3]
      }
    ],
    "references": [
      {
        "title": "What's the best CRM for an early stage, bootstrapped startup (NOT ...",
        "link": "https://www.reddit.com/r/CRM/comments/1ncf59q/whats_the_best_crm_for_an_early_stage/",
        "snippet": "Attio for Early Startups: Commenters recommend Attio as an effective lightweight CRM for small teams, highlighting its customizabi...",
        "source": "Reddit"
      }
    ]
  }
}

For this query the AI Overview cited 8 links and AI Mode cited 8, and 6 were the same URL. Both put HubSpot first. Some AI Overview links come back as google.com/goto tokens rather than publisher URLs; how to get real URLs from AI Overview citations covers resolving them. A single run of either is a sample, not a measurement: see how often AI Overview citations repeat across identical requests.

Step 6: Run it on a schedule

Write one row per citation, per query, per run, so share of answer becomes a query over a table:

Python
import csv, datetime

QUERIES = ["best vpn for streaming", "best budgeting app", "best crm for startups"]

with open("ai_mode_citations.csv", "a", newline="") as f:
    w = csv.writer(f)
    today = datetime.date.today().isoformat()
    for q in QUERIES:
        res = ai_mode(q)
        for pos, dom in enumerate(cited_domains(res)):
            w.writerow([today, q, pos, dom])

Make calls one after another or a few at a time: in our run the server-side response_time was 3.3 to 12.0 seconds per answer, median 7.4 seconds. 100 queries once a day is 3,000 credits a month, about $3 at the Growth rate, and the same size as the $15 Hobby plan's 3,000 credits.

All the endpoints you need

EndpointWhat it returnsCredits
POST /api/v2/google/ai-modeAI Mode answer as typed text blocks, cited references, reference_indexes per block1
POST /api/v2/googleFull Google results page, with the AI Overview, organic results and People Also Ask1
POST /api/v1/chatgpt/promptChatGPT's answer, cited pages and the searches it ran, for the same query2
POST /api/v1/gemini/promptGemini's answer and sources in the same shape as ChatGPT5

Getting started

  1. Sign up for a Scavio key: 50 free credits, no card, enough for 50 AI Mode answers.
  2. Run Step 1 for the query your buyers type most, with your market's gl and hl.
  3. Add your domain and three competitors' to the Step 3 check.
  4. Schedule Step 6 daily and chart citations per domain per week.
  5. For agents, the MCP server exposes AI Mode as a tool with the same parameters.

To compare vendors before you build, read the best Google AI Mode APIs for citation tracking, which also shows which domains AI Mode cited across 30 buyer queries. Try the Google AI Mode API free, or run a query in the playground.

Reference: Google AI Mode API overview · AI Mode docs · Google Search API docs · AI visibility checker

Frequently asked questions

Is there an API for Google AI Mode?

Google does not offer one. Search Console reports AI Mode clicks and impressions for your own site, not the answer or the other sources it cited. Scavio's /api/v2/google/ai-mode returns the answer as typed text blocks and every cited reference as JSON for 1 credit a call, with the same key used for Google search, ChatGPT and Gemini.

How do I track Google AI Mode?

Keep a fixed list of queries, call an AI Mode API for each with the same country and language every time, and store the domain of each cited reference with the date and the query. Count how many answers cite your domain and each competitor's. Run it on a schedule, because the sources in an answer change between days and between markets.

Can I see which sentence each AI Mode source supports?

Yes. Each text block in the response can carry reference_indexes, a list of positions in the references array. In 30 answers captured on November 29, 2026, 227 of the 304 references were attached to at least one block this way, so you can tell which claim a source backs.

Can I get AI Mode answers for another country?

Yes. Set gl to the country and hl to the language, or pass a location. The answer and its sources change with the market: "best budgeting app" for the US and the UK picked the same app on November 29, 2026, but the two answers shared only 3 of their cited domains.

Google AI Mode answers as JSON

  • Answer, tables and every cited source
  • Each paragraph tied to its sources
  • 1 credit a query, 50 free credits
Try the Google AI Mode API free

50 free credits, no credit card

On this page

  1. Step 1: Get the answer
  2. Step 2: Tie each claim to its sources
  3. Step 3: Check whether your domain is cited
  4. Step 4: Hold the market constant

Related articles

View all
  • scavio
    AI visibility / SEO
    Google
    How Do You Track Google AI Overview and AI Mode on a Small Budget? Pull Each Answer and Its Sources as JSON
  • scavio
    AI visibility / Comparison
    Google
    6 Best Google AI Mode APIs for Citation Tracking in 2026: Scavio Read 304 Citations in 30 Buyer Answers, and YouTube Was in 24
ScavioScavio

One scraper API for every social, search, e-commerce and real estate platform. Built for AI agents.

Product

  • Features
  • Pricing
  • Dashboard
  • Affiliates

Developers

  • Documentation
  • API Reference
  • Quickstart
  • MCP Integration
  • Python SDK

Alternatives

  • Tavily Alternative
  • SerpAPI Alternative
  • Firecrawl Alternative
  • Exa Alternative
  • Serper Alternative
  • Tavily vs Scavio
  • SerpAPI vs Scavio
  • All alternatives
  • Compare Scavio vs alternatives

Search APIs

  • Google Search API
  • Amazon Product API
  • YouTube API
  • Reddit API
  • Walmart Product API
  • TikTok API
  • Instagram API

Tools

  • All Tools

Ask AI about Scavio

© 2026 Scavio. All rights reserved.

Featured on TAAFT
Terms of ServicePrivacy Policy