Search engines are evolving rapidly. Instead of presenting only a list of websites, Google now frequently displays AI Overviews. It is an AI-generated summary that combines information from multiple sources and presents answers directly at the top of the search results page.

As a result, visibility is no longer defined solely by rankings. This shift has introduced a new concept known as Generative Engine Optimization (GEO).

In this tutorial, we'll walk through how to build a simple AI Overview Rank Tracker using Python.

What Is an AI Overview Rank Tracker?

An AI Overview Rank Tracker is a tool that answers a new kind of visibility question:

"Is my website cited inside Google's AI Overview, and how prominent is that citation?"

Traditional rank trackers focus on organic positions (1–10).
An AI Overview Rank Tracker focuses on:

  • Whether an AI Overview appears for a query
  • Which sources does the AI references
  • The order in which those sources appear
  • Whether your brand or competitors are included

This is a core component of Generative Engine Optimization (GEO).

Why AI Overviews Change How Ranking Works

AI Overviews often appear above organic results and summarize information directly on the search results page. In many cases, users get their answers without clicking any links.

This introduces several challenges:

  • Traditional rankings become less visible
  • Click-through rates are harder to attribute
  • Competition shifts toward citations, not just rankings
  • Existing SEO tools offer little insight into AI-generated answers

As AI Overviews become more common, tracking AI citation presence becomes essential.

Read more details explanation about Rank Tracking in the Age of AI Overviews from our previous post below:

Rank Tracking in the Age of AI Overviews: What’s Changed
Traditional rank position still matters, but it’s no longer the complete picture. You need these three other metrics now.

Why Traditional Scraping Is Not Enough

Tracking AI Overviews via browser automation or raw HTML scraping is unreliable due to:

  • JavaScript-rendered content
  • Frequent layout changes
  • Regional and language variations
  • Bot detection and captchas
  • Fragile DOM-based selectors

These issues make traditional scraping brittle and difficult to maintain at scale.

Using SerpApi to Build an AI Overview Rank Tracker

SerpApi provides real-time access to structured search engine data, including AI-generated elements where available. It handles:

  • IP rotation and request routing
  • JavaScript rendering
  • Layout changes across regions
  • High-volume request reliability

By using a Web Search API, developers can focus on analysis and insights rather than infrastructure maintenance.

Check out the tutorial below on how to get results from AI Overviews using our API:

How to Scrape Google AI Overviews (AIO)
Scrape Google’s new AI Overviews feature (formerly called SGE) with SerpApi

Building an AI Overview Rank Tracker using Python

Below is a step-by-step implementation that:

  • Detects AI Overviews
  • Fetches AI Overview details
  • Extracts cited sources
  • Prints title and link only
  • Determines whether a specific website is cited
  • Reports the site’s rank inside the AI Overview
AI overview Rank Tracker in terminal

Step 1: Install dependencies

pip install google-search-results python-dotenv

Step 2: Run a Google search and detect AI Overview presence

AI Overview does not appear for every query.

The first step is to detect whether one exists and retrieve its page_token.

from serpapi import GoogleSearch
import os

SERPAPI_API_KEY = os.getenv("SERPAPI_API_KEY")

def detect_ai_overview(query):
    params = {
        "engine": "google",
        "q": query,
        "hl": "en",
        "gl": "us",
        "api_key": SERPAPI_API_KEY
    }

    search = GoogleSearch(params)
    results = search.get_dict()

    ai_overview = results.get("ai_overview")
    if not ai_overview:
        return None

    return ai_overview.get("page_token")

The query here refers to target keyword or search phrase you want to monitor for AI Overview visibility.

If no page_token is returned, the query does not trigger an AI Overview.

Step 3: Fetch the AI Overview result page

Once a page token is available, use the google_ai_overview engine to retrieve full AI Overview data.

def fetch_ai_overview(page_token):
    params = {
        "engine": "google_ai_overview",
        "page_token": page_token,
        "api_key": SERPAPI_API_KEY
    }

    search = GoogleSearch(params)
    return search.get_dict()

This response includes structured AI content and cited references.

Note: Since this is another API endpoint, it uses another one search credit.

Step 4: Extract citations and calculate rank

In AI Overviews, ranking is determined by the order in which references are returned by the API.

from urllib.parse import urlparse

def normalize_domain(url):
    return urlparse(url).netloc.replace("www.", "")

def analyze_ai_overview(ai_results, target_url):
    references = ai_results.get("ai_overview", {}).get("references", [])
    target_domain = normalize_domain(target_url)

    found_rank = None

    print("\nAI Overview References:\n")

    for rank, ref in enumerate(references, start=1):
        title = ref.get("title")
        link = ref.get("link")

        print(f"{rank}. {title}")
        print(f"   {link}\n")

        if target_domain in normalize_domain(link):
            found_rank = rank

    if found_rank:
        print(f"Your site appears in the AI Overview at position #{found_rank}")
    else:
        print("Your site is not referenced in the AI Overview")

Step 5: Run the full AI Overview Rank Tracker

if __name__ == "__main__":
    query = input("Enter target keyword to track: ").strip()
    website = input("Enter your website URL: ").strip()

    page_token = detect_ai_overview(query)

    if not page_token:
        print("No AI Overview detected for this query.")
    else:
        ai_results = fetch_ai_overview(page_token)
        analyze_ai_overview(ai_results, website)

Result

AI Overview Rank Tracker result

Full code is available in our GitHub serpapi/tutorials repository:

tutorials/python_projects/ai_overview_rank_tracker at master · serpapi/tutorials
Public repo to store our blog and video demo code snippets - serpapi/tutorials

Conclusion

AI Overviews are redefining search visibility. As generative search experiences continue to expand, being cited by AI systems becomes as important as ranking organically.

An AI Overview Rank Tracker allows developers and SEO teams to measure this new form of visibility using structured, reliable data. By leveraging Google Search API and Google AI Overview API, we can move beyond fragile scraping and build scalable GEO monitoring systems for the future of search.