Detecting whether Google shows an AI Overview for a keyword takes a single API call with include_ai_overview set to true. If the response contains an ai_overview field, AI Overview is present for that query.
Prerequisites
- Python 3.9+ or Node.js 18+
- Scavio API key
Walkthrough
Step 1: Send a search request with include_ai_overview
Add include_ai_overview:true to the request body. The field is only present in the response when Google shows AI Overview.
import requests
API_KEY = "your-scavio-api-key"
def has_ai_overview(keyword: str) -> dict:
r = requests.post(
"https://api.scavio.dev/api/v1/search",
json={"query": keyword, "include_ai_overview": True, "num_results": 1},
headers={"x-api-key": API_KEY},
timeout=15
)
r.raise_for_status()
data = r.json()
ao = data.get("ai_overview")
return {
"keyword": keyword,
"has_ai_overview": ao is not None,
"text_preview": (ao.get("text", "")[:200] if ao else None)
}
result = has_ai_overview("best python web frameworks")
print(result)Step 2: Batch check a keyword list
Check multiple keywords and return which ones trigger AI Overview.
def batch_check(keywords: list) -> list:
results = []
for kw in keywords:
result = has_ai_overview(kw)
status = "YES" if result["has_ai_overview"] else "NO"
print(f"{status:3} | {kw}")
results.append(result)
return results
KEYWORDS = [
"what is a vector database",
"best noise cancelling headphones",
"python list comprehension",
"buy running shoes online",
"how to cook pasta"
]
batch_check(KEYWORDS)Python Example
import requests
from typing import Optional
API_KEY = "your-scavio-api-key"
def check_ai_overview(keyword: str) -> dict:
r = requests.post(
"https://api.scavio.dev/api/v1/search",
json={"query": keyword, "include_ai_overview": True, "num_results": 1},
headers={"x-api-key": API_KEY},
timeout=15
)
r.raise_for_status()
ao = r.json().get("ai_overview")
return {
"keyword": keyword,
"present": ao is not None,
"text": ao.get("text", "")[:200] if ao else None,
"source_count": len(ao.get("sources", [])) if ao else 0
}
def batch_check(keywords: list[str]) -> dict:
yes, no = [], []
for kw in keywords:
r = check_ai_overview(kw)
(yes if r["present"] else no).append(r)
print(f"{'YES' if r['present'] else 'NO ':3} | {kw}")
return {"with_aio": yes, "without_aio": no,
"aio_rate": f"{len(yes)/len(keywords)*100:.0f}%" if keywords else "0%"}
if __name__ == "__main__":
KEYWORDS = [
"what is a vector database",
"best noise cancelling headphones 2026",
"python list comprehension tutorial",
"how to cancel netflix subscription",
"buy running shoes online"
]
summary = batch_check(KEYWORDS)
print(f"\nAI Overview rate: {summary['aio_rate']} ({len(summary['with_aio'])}/{len(KEYWORDS)})")JavaScript Example
const API_KEY = 'your-scavio-api-key';
async function checkAiOverview(keyword) {
const res = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': API_KEY },
body: JSON.stringify({ query: keyword, include_ai_overview: true, num_results: 1 })
});
const data = await res.json();
const ao = data.ai_overview;
return { keyword, present: !!ao, text: ao?.text?.slice(0, 200) ?? null };
}
const keywords = ['what is a vector database', 'best headphones 2026', 'buy shoes online'];
for (const kw of keywords) {
const r = await checkAiOverview(kw);
console.log(`${r.present ? 'YES' : 'NO '} | ${kw}`);
}Expected Output
YES | what is a vector database
YES | best noise cancelling headphones 2026
YES | python list comprehension tutorial
NO | how to cancel netflix subscription
NO | buy running shoes online
AI Overview rate: 60% (3/5)