Tutorial

July 15, 2026 · 8 min read

How to Track Your Brand in Google AI Mode

AI Mode has no position 3. It has an answer, and either you are in it or you are not. Visibility is still measurable: brand mentions, sentiment, citations, and citation position. Here is how to track all four, starting from about 30 lines of Python.

Adam Ben-Ayoun

Author

Adam Ben-Ayoun

CTO · OpenWeb Ninja

Google AI Mode · AI Search · SEO · Python

Key Takeaways

  • AI Mode returns one generated answer plus reference links, so classic rank tracking does not apply. Track four signals instead: mention, sentiment, citation, and citation position.

  • A mention is not automatically good news. Classify each mention as positive, neutral, or negative; the share of positive mentions is the number to watch.

  • AI answers are not deterministic. Run each prompt daily and read the trend; a single check is noise.

  • Build a prompt set from questions people actually ask ("what crm should a 10-person agency use"), not keyword strings.

  • Track each market separately with gl and hl; the same prompt surfaces different brands per country.

  • Fifty prompts, two markets, checked daily, is 3,000 requests a month. That fits the $25/month Pro plan with room to spare.

Tracking brand visibility in Google AI Mode

Rank tracking without ranks

Rank tracking made sense when Google returned ten blue links. Google AI Mode returns a conversation. There is no position 3. There is an answer, written by Gemini, with a set of reference links next to it. Either you are part of that answer or you are not.

That does not mean visibility stopped being measurable. It means the metrics changed. Some of our most active Google AI Mode API customers are SEO agencies and growth teams, and what they track boils down to four questions:

1. Mention

Does the answer text name your brand?

2. Sentiment

Is the mention positive or negative?

3. Citation

Is your domain in the reference links?

4. Citation position

How high in that list?

Run those four checks across a fixed set of prompts, daily, per market, and you have rank tracking for AI search. Here is how to build it.

What an AI Mode response looks like

One GET request. The prompt parameter carries the question; gl and hl localize it.

curl

curl "https://api.openwebninja.com/google-ai-mode/ai-mode?prompt=best%20crm%20for%20small%20business&gl=us&hl=en" \
  -H "x-api-key: YOUR_API_KEY"

Response (truncated)

The real response to that exact query, trimmed. Two parts matter for tracking: reply_parts, the structured answer, and reference_links, the pages AI Mode cites. The full response carried 16 reference links.

{
  "status": "OK",
  "request_id": "ece3a0be-c332-4801-a1ec-6a6280b9f146",
  "parameters": { "prompt": "best crm for small business", "gl": "us", "hl": "en" },
  "data": {
    "reply_parts": [
      {
        "type": "paragraph",
        "text": "The best CRM for a small business depends entirely on whether you prioritize marketing features, a visual sales pipeline, or budget-friendly customization. ..."
      },
      { "type": "heading", "text": "Best All-in-One: HubSpot CRM" },
      { "type": "list", "ordered": false, "list": ["...items with text, links, and sources..."] }
    ],
    "reference_links": [
      {
        "title": "Best and inexpensive CRM",
        "link": "https://www.reddit.com/r/CRM/comments/...",
        "source": "Reddit"
      },
      {
        "title": "Streamline Your Entire Business With a Free CRM - HubSpot",
        "link": "https://www.hubspot.com/products/crm",
        "snippet": "HubSpot's free CRM unifies all your customer data on one platform...",
        "source": "HubSpot"
      }
    ],
    "session_token": "Q21vd1lUUnpPRzFqWkdkbVoxcG9VelV5..."
  }
}

The answer is structured, not a blob of text.

The tracker

Thirty lines, no framework. One function fetches the answer, one flattens the typed parts into text, one computes the mention and citation signals.

Python

# ai_mode_tracker.py
import json
import requests

API_KEY = "YOUR_API_KEY"
BASE = "https://api.openwebninja.com/google-ai-mode"

def ai_mode(prompt, gl="us", hl="en"):
    r = requests.get(
        f"{BASE}/ai-mode",
        headers={"x-api-key": API_KEY},
        params={"prompt": prompt, "gl": gl, "hl": hl},
        timeout=90,
    )
    r.raise_for_status()
    return r.json()["data"]

def part_text(part):
    if part["type"] in ("heading", "paragraph"):
        return part.get("text", "")
    if part["type"] == "list":
        return " ".join(f"{i.get('title', '')} {i.get('text', '')}" for i in part["list"])
    return ""

def visibility(prompt, brand, domain):
    data = ai_mode(prompt)
    answer = " ".join(part_text(p) for p in data["reply_parts"]).lower()
    refs = data.get("reference_links", [])
    cited_at = next(
        (i + 1 for i, ref in enumerate(refs) if domain in ref["link"]),
        None,
    )
    return {
        "prompt": prompt,
        "mentioned": brand.lower() in answer,
        "cited_at": cited_at,
        "total_citations": len(refs),
    }

print(json.dumps(visibility("best crm for small business", "HubSpot", "hubspot.com")))

Output

{"prompt": "best crm for small business", "mentioned": true, "cited_at": 2, "total_citations": 16}

HubSpot is named in the answer and cited second out of 16 references. That row, stored daily with a date, is your time series.

From one check to a tracking program

Build a prompt set, not a keyword list.

People do not type "crm small business" into AI Mode. They ask questions: "what crm should a 10-person agency use", "is hubspot worth it for a small team". Take your commercial keywords and rewrite them the way a person asks. Twenty to fifty prompts covers most niches.

Score sentiment on every mention.

Two answers can both name your brand: one as the recommended pick, one as the option to avoid. When a prompt returns a mention, run the answer text through a quick LLM classification pass (positive, neutral, negative) and store the label next to the mention flag. Our Gemini API handles this well: send it the answer text with a one-line instruction and get the label back. A falling share of positive mentions is a shift a raw mention count will hide.

Track markets separately.

The gl and hl parameters localize the answer. "Best accounting software" returns different brands in gl=us and gl=de. One loop per market.

Sample, don't spot-check.

AI answers are not deterministic. The same prompt can produce a different answer an hour later. A brand that shows up in 7 of 10 runs is visible; a brand that showed up once is noise. Run each prompt daily and read the trend, never a single sample.

Compute share of voice.

Run the same prompt set against your competitors’ names and domains. Mentions-per-prompt-set is the AI Mode equivalent of average position, and it is the number worth putting on a dashboard.

What it costs

Every prompt is one request. Fifty prompts, two markets, daily is 3,000 requests a month, which fits in the Pro plan at $25/month for 5,000 requests. The free plan is enough to validate your prompt set before committing.

A call took about 10 seconds in our tests, so a daily 100-prompt batch finishes in minutes with a few concurrent workers. The same method applies to the AI Overviews API if you also track the AI summaries on classic results pages.

FAQ

Most common questions and answers

Does Google AI Mode have rankings like classic search?

How often should I check my brand visibility in AI Mode?

Can I track AI Mode visibility in other countries and languages?

Is tracking AI Mode different from tracking Google AI Overviews?

About the author

Adam Ben-Ayoun

Adam Ben-Ayoun

CTO @ OpenWeb Ninja

Adam leads engineering at OpenWeb Ninja, building the APIs and infrastructure that make public web data accessible to developers and AI agents.

Connect on LinkedIn

Start tracking your AI search visibility

The Google AI Mode API returns the full structured answer and every reference link per prompt. The free plan needs no credit card.

APIs by Category

Didn't find the API you are looking for? Request an API

© 2026 OpenWeb Ninja. All rights reserved.

G2 LogoTrustpilot LogoGitHub