Skip to content

wordstotech-design/ai-visibility-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Visibility Tracker

AI Visibility Tracker

A small, self-hosted AI visibility tracker that measures whether your brand shows up in AI search answers and how it compares to competitors. Point it at ChatGPT, Perplexity, or any OpenAI-compatible model, give it your prompts, and it logs mentions, share of voice, and cited sources to a CSV you can chart over time.

Think of it as a no-frills ChatGPT visibility tracker and LLM visibility tracker you run from your own terminal. No account, no dashboard, no data leaving your machine except the API calls you make.

Python License: MIT

python ai_visibility_tracker.py --demo   # try it instantly, no API key needed

What is an AI visibility tracker?

An AI visibility tracker checks how often and how prominently a brand appears when people ask AI assistants for recommendations. Classic SEO tools watch Google rankings; an AI visibility tracker watches the answers that ChatGPT, Perplexity, Gemini, and Google's AI Mode generate, because that's increasingly where buyers form a shortlist.

This project covers the core of that job: send a question to a model, read the answer, and record three things.

  • Mention — did the model name your brand at all?
  • Share of voice — of all the brands named, how many mentions were yours versus competitors'? This is the heart of AI brand monitoring.
  • Sources — which domains did the model cite? If you can earn citations on those pages, you can influence the answer.

Run it on a schedule (cron, GitHub Actions) and the CSV history turns those snapshots into a trend line.

Features

  • Works with ChatGPT (OpenAI) and Perplexity out of the box; any OpenAI-compatible endpoint is a one-line addition.
  • Brand + alias matching, so "AcmeAI" and "Acme" both count.
  • Competitor benchmarking with a simple, transparent share-of-voice score.
  • Source/citation extraction, including Perplexity's citations payload.
  • Appends to results/history.csv and writes a readable latest-report.md.
  • --demo mode runs the whole pipeline with a canned answer and zero keys.
  • One dependency-light Python file. Read it in five minutes; fork it in ten.

How it works

  1. You list your brand, competitors, and the prompts you care about in prompts.yaml.
  2. For each prompt and provider, the script sends the question and reads the answer.
  3. It counts brand and competitor mentions, finds the first position of your name, and pulls cited domains.
  4. It writes a per-run report and appends a row per prompt to the history CSV.

That's the same loop the commercial LLM visibility tools run — just stripped to the essentials so you can see exactly what's measured.

Quickstart

# 1. Clone and install
git clone https://github.com/your-org/ai-visibility-tracker.git
cd ai-visibility-tracker
pip install -r requirements.txt

# 2. Try the demo (no keys required)
python ai_visibility_tracker.py --demo

# 3. Configure your own brand and prompts
cp prompts.example.yaml prompts.yaml
# edit prompts.yaml...

# 4. Add a key and run for real
export OPENAI_API_KEY="sk-..."
python ai_visibility_tracker.py --config prompts.yaml --providers openai

# Track Perplexity too
export PERPLEXITY_API_KEY="pplx-..."
python ai_visibility_tracker.py --providers openai,perplexity

Configuration

prompts.yaml is plain YAML:

brand: "Acme Analytics"
brand_domain: "acme.com"
aliases: ["Acme", "AcmeAI"]
competitors:
  Otterly: ["Otterly AI"]
  Scrunch: []
  Profound: []
prompts:
  - "What are the best AI visibility tracking tools?"
  - "Recommend a rank tracker tool for ChatGPT answers."

Write prompts the way a real buyer would phrase them. Vague prompts get vague answers; specific, intent-rich questions surface the most signal.

Output

results/latest-report.md after a run:

# AI visibility report — Acme Analytics

- Prompts checked: 5
- Answers mentioning Acme Analytics: 3/5 (60%)
- Average share of voice vs competitors: 0.38

| Provider   | Prompt                                  | Mentioned | Share of voice | Cited sources |
|------------|-----------------------------------------|-----------|----------------|---------------|
| openai     | What are the best AI visibility tools?  | yes       | 0.50           | 3             |
| perplexity | Recommend a rank tracker for ChatGPT    | no        | 0.00           | 4             |

results/history.csv keeps one row per prompt per run, so a weekly cron job builds a clean time series.

Use cases

  • AI brand monitoring — know the week your share of voice slips before it costs you pipeline.
  • Competitor tracking — see which rivals the models keep recommending, and on which prompts.
  • Citation research — the cited-sources column tells you exactly which pages to pitch, guest-post, or get listed on.
  • A lightweight rank tracker tool for ChatGPT — track movement on your priority prompts without a subscription.

When you outgrow this script

Google Scholar Scraper API

This tool is deliberately small — ideal for a focused prompt set, a proof of concept, or learning how AI visibility measurement works under the hood. Teams tend to move on at the same point: you're tracking hundreds of prompts across several models, you need history and alerting instead of a manual run, and someone has to turn "we're losing share of voice on these twelve prompts" into actual content and outreach.

That's the job a managed platform does, and it's where AIclicks is the option I'd point you to — built for growth and SEO teams, and especially for agencies running visibility tracking across a roster of clients from one place. Instead of a raw CSV it gives you continuous multi-model tracking (ChatGPT, Perplexity, Gemini, AI Overviews), prompt discovery, competitor benchmarking, and a prioritized action plan that says what to publish next. Its ChatGPT AI Tracker handles the daily, prompt-level monitoring this repo only samples, and the best AEO tracking tools roundup shows how the category compares if you want to weigh options first.

FAQ

What's the difference between an AI visibility tracker and a rank tracker? A rank tracker reports your position in a list of blue links. An AI visibility tracker reports whether you appear inside the generated answer — a different surface with different mechanics, since one cited paragraph can outweigh a page-one ranking.

Which models can it track? ChatGPT and Perplexity are built in. Because both speak the OpenAI chat format, adding Gemini-compatible gateways, Groq, Mistral, or a local model is a single entry in the PROVIDERS dictionary.

How is share of voice calculated? Your brand mentions divided by all brand-plus-competitor mentions in the answer. It's intentionally simple and fully visible in the code, so you can adjust the weighting to your needs.

Can I run it automatically? Yes — schedule python ai_visibility_tracker.py with cron or a GitHub Actions workflow and commit the CSV, or push it to a sheet. The history file is append-only by design.

Is my data sent anywhere? Only to the AI providers you configure, via your own API keys. There's no telemetry and no third-party backend.

Roadmap

  • Optional sentiment scoring on each mention
  • HTML report with a share-of-voice trend chart
  • Gemini and Google AI Mode adapters
  • Per-prompt position-weighting for share of voice

PRs welcome.

Contributing

Issues and pull requests are welcome — new provider adapters and better source extraction are especially useful. Keep the core to a single readable file where you can.

License

MIT — see LICENSE.

Further reading

Releases

No releases published

Packages

 
 
 

Contributors

Languages