Skip to content
PromptGale
Log in

How to track brand mentions in ChatGPT and AI search with an API

Build your own GEO tracker: ask ChatGPT, Perplexity and AI Overviews your buyers' prompts on a schedule and store mentions, rank and citations via API.

By PromptGale teamPublished 4 min read
  • geo
  • brand-tracking
  • api

Key takeaways

  • Ask the engines the prompts your buyers ask, on a schedule, and store for each answer whether it names your brand, in what position, and whether it cites your site.
  • Send brand, brandDomains and competitors with each prompt; every answer comes back with analysis.brands (mentioned, mentions, rank, cited, citedUrls, share of voice) at no extra credits.
  • A batch queues one item per prompt and engine (up to 100 items on Starter, 10,000 on Growth and above) and can notify a webhook with batch.completed.
  • 25 prompts on ChatGPT, Perplexity and Google AI Overviews, weekly in one country, is about 430 credits a month: within the Starter plan's 2,000.
On this page

To track brand mentions in ChatGPT and other AI search engines with an API, ask the engines the prompts your buyers ask, on a schedule, and store for each answer whether it names your brand, in what position, and whether it cites your site. With PromptGale, you send each prompt with your brand, brandDomains and competitors, and every answer comes back with analysis.brands filled in: mentioned, rank, cited, cited URLs and share of voice. You keep the rows, and your tool does the reporting.

This post is for developers building their own GEO (generative engine optimization) tracker, or adding AI visibility to an existing product. It covers the data model, the prompt set, the API calls and the metrics.

Build or buy: do you need an API at all?

If you want a ready-made dashboard, AI visibility tools already exist. For example, Peec AI, OtterlyAI, Scrunch and Profound track brands across AI engines, and several of them also offer access to their data through an API (OtterlyAI and Peec AI list one; Scrunch lists API access on its Enterprise plan). Their pages, read on 2026-11-30, describe the engines they cover and their current plans.

Building on an answer-engine API makes sense when:

  • You are building a product: an agency tool, a SaaS feature, a client report.
  • You need your own prompt sets, countries and schedules, and the raw answers in your database.
  • You want to join AI visibility data with your own data (rankings, traffic, CRM).

In that case you need a data layer that returns the app answers as JSON. That is what PromptGale is.

What should you measure?

For each prompt, engine, country and date, store one row per brand:

FieldFrom analysis.brands[]What it tells you
mentionedmentionedDoes the answer name the brand at all?
mentionsmentionsHow many times
rankrankOrder of first mention among every brand the answer names (1 = first; empty when not mentioned)
citedcitedIs one of the answer's sources on the brand's domains?
cited URLscitedUrlsWhich pages
share of voiceshareOfVoiceThe brand's mentions as a percentage of the mentions of every brand named

The analysis also returns brandsNamed (every brand the answer names, in order, including ones you did not list) and sources, each with its kind (owned, competitor, ugc, news, marketplace, review, reference, other). Every field is described in the Results docs.

From those rows you can report mention rate, average rank and citation rate per prompt, per engine and over time.

How do you choose the prompts?

The use-case guide suggests:

  1. Write 10 to 50 prompts the way a buyer would type them, not the way you describe your product. Include comparison and "best X for Y" prompts.
  2. Choose the countries you sell in. Answers differ by country, so track each one separately.
  3. Run the same prompts every week, so changes are comparable.

How do I check one prompt?

POST /v1/sync/task asks one engine and waits for the answer (up to 290 seconds). Add brand, brandDomains and competitors to the payload:

Shell
curl -X POST https://promptgale.com/v1/sync/task \
  -H "Authorization: Bearer $PROMPTGALE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskType": "CHATGPT",
    "payload": {
      "prompt": "best crm for a small agency",
      "country": "US",
      "brand": "Acme",
      "brandDomains": ["acme.com"],
      "competitors": ["Globex", "Initech"]
    }
  }'

data.result.analysis.brands has one entry for your brand (role target) and one for each competitor (role competitor), in your order.

How do I track every engine on a schedule?

Use a batch: one item per prompt and engine, up to 10,000 items per call on Growth and above. This is the example from the docs. It creates the batch, waits for it, then reads every item:

Python
import os
import time
import requests

API = "https://promptgale.com"
HEADERS = {"Authorization": f"Bearer {os.environ['PROMPTGALE_API_KEY']}"}
ENGINES = ["CHATGPT", "GEMINI", "PERPLEXITY", "BING_COPILOT_SEARCH", "META_AI", "GOOGLE_AIO", "GOOGLE_AIMODE"]
PROMPTS = ["best crm for a small agency", "crm with the best email automation"]

items = [
    {
        "customId": f"{i}:{engine}",
        "taskType": engine,
        "payload": {"prompt": prompt, "country": "US", "brand": "Acme",
                    "brandDomains": ["acme.com"], "competitors": ["Globex", "Initech"]},
    }
    for i, prompt in enumerate(PROMPTS)
    for engine in ENGINES
]
batch = requests.post(f"{API}/v1/batches", headers=HEADERS,
                      json={"items": items, "idempotencyKey": "acme-2026-11-27"}).json()["data"]

while batch["status"] != "COMPLETED":
    time.sleep(15)
    batch = requests.get(f"{API}/v1/batches/{batch['id']}", headers=HEADERS).json()["data"]

cursor = None
while True:
    params = {"include": "result", "limit": 100, **({"cursor": cursor} if cursor else {})}
    page = requests.get(f"{API}/v1/batches/{batch['id']}/items", headers=HEADERS, params=params).json()["data"]
    for item in page["items"]:
        result = (item.get("task") or {}).get("result")
        if not result or "analysis" not in result:
            print(item["customId"], item["status"])
            continue
        acme = next(b for b in result["analysis"]["brands"] if b["role"] == "target")
        print(item["customId"], acme["mentioned"], acme.get("rank"), acme["cited"], acme.get("shareOfVoice"))
    if not page["hasMore"]:
        break
    cursor = page["nextCursor"]

A few things that matter in production:

  • Webhooks instead of polling. Pass webhookUrl with the batch; it receives batch.completed once every item has finished. Deliveries are signed with HMAC-SHA256 (Webhooks).
  • Idempotency. Sending the same idempotencyKey and body again within 30 days returns the first batch instead of creating a new one, so a retried cron job does not pay twice. Use a new key for each scheduled run (the date works, as in the example).
  • Failed tasks. A failed task returns status FAILED and an error code, and its credits are refunded. Store the status so a gap in your chart is not read as "not mentioned".
  • Plan limits. Batches depend on the plan: Starter allows up to 100 items per batch, Growth and above up to 10,000 (Batches).

Pseudo-code for the storage step (not from the docs; adapt to your schema):

Text
# PSEUDO-CODE
for each finished item:
    for each brand in result.analysis.brands:
        insert row(date, prompt_id, engine, country,
                   brand.name, brand.role, brand.mentioned, brand.rank,
                   brand.cited, brand.shareOfVoice)
    for each source in result.sources where source.cited:
        insert source_row(date, prompt_id, engine, source.domain, source.url)

What about local results?

Every task takes a country, and every engine listed today also accepts a US state for 1 extra credit. On Growth and above, location grids ask one prompt from every point of a map grid (up to 9 × 9) on the Google engines, ChatGPT, Gemini and Bing Copilot Search; each point is one task with its own location. See Countries and locations.

How much does tracking cost?

Each answer costs credits: ChatGPT, Gemini and Perplexity 1.5; Google AI Overviews, Google AI Mode and Bing Copilot Search 1; Meta AI 2. As a worked example from the published prices: 25 prompts on ChatGPT, Perplexity and Google AI Overviews, in one country, once a week, is 25 × (1.5 + 1.5 + 1) = 100 credits a week, about 430 credits a month. That fits in the Starter plan ($19 a month, 2,000 credits), and the 75 items a week fit in one Starter batch. The brand analysis adds no credits. Check your own mix on the pricing page, or send the batch with dryRun over MCP for a cost estimate.

How do I start tracking?

There is no free plan: create an account, verify your email, and start the trial or pick a plan (the current offer is on the pricing page). Then copy the batch example from the docs, and see Build an AI visibility tool for the full architecture.

Frequently asked questions

Does the brand analysis cost extra?
No. Sending brand and competitors adds the analysis to the result at no extra credits. A task costs its engine's price, plus 1 credit for a US state or a map point.
Can I see brands I didn't list as competitors?
Yes. The analysis also lists every brand the answer names, in order (brandsNamed), so you can discover competitors you were not tracking.
Which engines can I track?
ChatGPT, Gemini, Perplexity, Google AI Overviews, Google AI Mode, Bing Copilot Search and Meta AI are listed today. Engines depend on availability, so read the current list from GET /v1/capabilities.
How often should I run the prompts?
Our use-case guide suggests weekly, with the same prompts each time. Answers change between runs, so a single run is a sample, not a verdict.
Can my AI agent run the tracking instead of a script?
Yes. Connect the PromptGale MCP server and ask the agent to run a batch with the submit_batch tool, then read it with get_batch and list_batch_items.

About the author

PromptGale team

The team that builds PromptGale

PromptGale is a REST API and remote MCP server that asks AI answer engines a prompt from a chosen country and returns the answer, its cited sources and a brand analysis as JSON.