ScavioScavio
ProductPricingDocs
Sign InGet Started
  1. Home
  2. Tutorials
  3. How to Detect AI Overview Presence for a Keyword
Tutorial

How to Detect AI Overview Presence for a Keyword

Check in one API call whether Google shows an AI Overview for a keyword using include_ai_overview:true. Returns a binary yes/no with the AI Overview text.

Get Free API KeyAPI Docs

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.

Python
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.

Python
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

Python
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

JavaScript
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

JSON
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)

Related Tutorials

  • How to Track Products in Google AI Overview Results
  • How to Track AI Overview Citations for Your Brand
  • How to Build an SEO Audit Agent in Claude Code

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Python 3.9+ or Node.js 18+. Scavio API key. A Scavio API key gives you 50 free credits on signup.

Yes. The free tier includes 50 credits on signup, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Related Resources

Best Of

Best Google Search API in 2026

Read more
Best Of

Best APIs That Return AI Overview Data in 2026

Read more
Glossary

Exa Semantic Search

Read more
Use Case

n8n Search Enrichment Workflow

Read more
Solution

Replace Google Programmable Search Engine with Scavio API

Read more
Solution

Migrate from Brave Search API to Scavio for Better Coverage

Read more

Start Building

Check in one API call whether Google shows an AI Overview for a keyword using include_ai_overview:true. Returns a binary yes/no with the AI Overview text.

Get Free API KeyRead the Docs
ScavioScavio

Real-time search API for AI agents. Search every platform, not just Google.

Product

  • Features
  • Pricing
  • Dashboard
  • Affiliates

Developers

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

Alternatives

  • Tavily Alternative
  • SerpAPI Alternative
  • Firecrawl Alternative
  • Exa Alternative

Tools

  • JSON Formatter
  • cURL to Code
  • Token Counter
  • All Tools

© 2026 Scavio. All rights reserved.

Featured on TAAFT
Terms of ServicePrivacy Policy