Google AI Overviews (formerly Search Generative Experience) appear at the top of search results for many informational queries. They summarize multiple sources into a concise answer visible before organic results. For SEO professionals and content strategists, knowing whether a query triggers an AI Overview and what it says is increasingly important for understanding traffic impact. The Scavio API returns the ai_overview field in SERP responses when Google generates one. This tutorial shows how to detect and extract AI Overview content.
Prerequisites
- Python 3.8 or higher
- requests library installed
- A Scavio API key
- Understanding of SERP features and SEO basics
Walkthrough
Step 1: Query a topic that triggers an AI Overview
Informational queries like "how does X work" or "what is Y" commonly trigger AI Overviews. Submit such a query to the Scavio endpoint.
data = search_google("how does retrieval augmented generation work")
ai_overview = data.get("ai_overview")
print("AI Overview present:", ai_overview is not None)Step 2: Extract the summary text
The ai_overview object contains a text summary and optionally a list of cited sources.
if ai_overview:
print("Summary:")
print(ai_overview.get("text", "No text available"))
print("\nSources:")
for source in ai_overview.get("sources", []):
print(f" - {source.get('title')}: {source.get('link')}")Step 3: Check which queries trigger AI Overviews
Run a batch of queries and report which ones have AI Overviews. This helps identify which content areas Google is summarizing.
def check_ai_overviews(queries: list[str]) -> dict:
results = {}
for q in queries:
data = search_google(q)
results[q] = data.get("ai_overview") is not None
return resultsStep 4: Save AI Overview data for analysis
Persist the AI Overview content and cited sources to JSON for further analysis.
import json
overviews = {}
for q in queries:
data = search_google(q)
if data.get("ai_overview"):
overviews[q] = data["ai_overview"]
with open("ai_overviews.json", "w") as f:
json.dump(overviews, f, indent=2)Python Example
import os
import json
import requests
API_KEY = os.environ.get("SCAVIO_API_KEY", "your_scavio_api_key")
ENDPOINT = "https://api.scavio.dev/api/v1/search"
def search_google(q: str) -> dict:
r = requests.post(ENDPOINT, headers={"x-api-key": API_KEY},
json={"query": q, "country_code": "us"})
r.raise_for_status()
return r.json()
def extract_ai_overviews(queries: list[str]) -> dict:
results = {}
for q in queries:
data = search_google(q)
ai = data.get("ai_overview")
results[q] = {"has_overview": ai is not None, "text": ai.get("text") if ai else None}
return results
if __name__ == "__main__":
queries = ["how does vector search work", "what is rag in ai", "python vs javascript 2026"]
overviews = extract_ai_overviews(queries)
print(json.dumps(overviews, indent=2))JavaScript Example
const API_KEY = process.env.SCAVIO_API_KEY || "your_scavio_api_key";
const ENDPOINT = "https://api.scavio.dev/api/v1/search";
async function searchGoogle(q) {
const res = await fetch(ENDPOINT, {
method: "POST",
headers: { "x-api-key": API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ query: q, country_code: "us" })
});
return res.json();
}
async function extractAIOverviews(queries) {
const results = {};
for (const q of queries) {
const data = await searchGoogle(q);
results[q] = { hasOverview: !!data.ai_overview, text: data.ai_overview?.text || null };
}
return results;
}
extractAIOverviews(["how does vector search work", "what is rag in ai"])
.then(r => console.log(JSON.stringify(r, null, 2)))
.catch(console.error);Expected Output
{
"ai_overview": {
"text": "Retrieval-Augmented Generation (RAG) is a technique that enhances LLM responses by retrieving relevant documents from an external knowledge base before generating an answer...",
"sources": [
{ "title": "What is RAG? — AWS", "link": "https://aws.amazon.com/what-is/retrieval-augmented-generation/" },
{ "title": "RAG Explained — LangChain Blog", "link": "https://blog.langchain.dev/rag-explained" }
]
}
}