Claude AI visibility tracker for a website

An AI visibility tracker is a script or tool that regularly asks AI assistants questions your buyers ask, then records whether your brand or website appears in the answers. You can build one yourself with Claude's API, a short Python script, and a list of prompts, no SaaS subscription required.

TL;DR

  • Problem: AI assistants increasingly shape buying decisions inside their answers (roughly 93% of AI search sessions end without a click) yet most teams have no way to measure whether they're mentioned at all.
  • Insight: You don't need an enterprise platform to get a baseline. A Python script using Claude's API can query your buyers' real questions on a schedule and log every mention, citation, and competitor appearance to a CSV you own.
  • Takeaway: Lock in 10–25 commercial-intent prompts, run the tracker weekly for a quarter, and treat the trend line (not any single run) as the signal worth acting on.

How to Build an AI Visibility Tracker for Your Website Using Claude

This guide is for marketing directors, founders, and SEO leads who want to measure their AI visibility tracker without committing to an enterprise tool. By the end, you'll have a working tracker running on Mac or Windows that logs brand mentions, citations, and competitor appearances over time. The full source code is available on GitHub, you can request access through the form at the end of this article.

Why an AI Visibility Tracker Matters Now

Traditional rank tracking tells you where you stand in Google. It tells you nothing about whether ChatGPT, Claude, Perplexity, or Gemini recommend you when a buyer asks "what's the best Webflow agency for B2B SaaS?"

That blind spot is growing. AI referral traffic grew 16x between 2024 and 2026, reaching 0.32% of total website traffic, roughly one in every 312 website visits now comes from an AI search engine. The absolute numbers are still small next to organic search, but the influence extends beyond clicks: around 93% of AI search sessions end without a website click, meaning your brand is often evaluated, and recommended or omitted, inside the answer itself.

An AI visibility tracker measures how often AI assistants like Claude, ChatGPT, and Perplexity mention or cite a specific brand or website when answering relevant buyer questions. It works by sending a fixed set of prompts to an AI model on a schedule, scanning the responses for brand and domain mentions, and logging the results over time to reveal visibility trends.

What the Claude Visibility Tracker Does

The tracker we built at Broworks is deliberately simple. It:

  • Sends a defined list of prompts (your buyers' real questions) to Claude via the API
  • Scans each response for your brand name, domain, and competitor names
  • Logs every run to a CSV file with a timestamp, so you can chart visibility over time
  • Runs on a schedule (daily or weekly) with no manual work after setup
  • Costs a few cents per run, depending on prompt volume

It's not a replacement for full platforms like Profound or Scrunch AI, which track multiple engines and regions. It's a fast, transparent baseline you fully control, and for many teams, that's exactly the right starting point at the top of the funnel.

Step-by-Step: Building the Tracker

Step 1: Install Python

The tracker runs on Python 3.10 or newer.

  1. Mac: Open Terminal and run python3 --version. If Python isn't installed or is older than 3.10, download the latest installer from python.org/downloads and run it.
  2. Windows: Download the installer from the same page. During installation, check the box "Add Python to PATH", this is the step most people miss, and skipping it breaks every later command.
  3. Verify the install: run python3 --version (Mac) or python --version (Windows Command Prompt). You should see something like Python 3.12.x.

Step 2: Get a Claude API Key

  1. Create an account at the Anthropic Console and add a small amount of credit ($5 is more than enough to start).
  2. Go to API Keys, generate a new key, and copy it somewhere safe. You'll only see it once.
  3. Never paste this key directly into the script or commit it to GitHub. The tracker reads it from an environment variable instead.

Set the environment variable:

  • Mac: In Terminal, run export ANTHROPIC_API_KEY="your-key-here". To make it permanent, add that line to your ~/.zshrc file.
  • Windows: Search for "Edit environment variables," add a new user variable named ANTHROPIC_API_KEY, and paste your key as the value. Restart Command Prompt afterward.

Step 3: Get the Tracker Code

The complete, ready-to-run repository is gated, fill out the short form of this article and you'll receive the GitHub link by email. Once you have it:

  • Mac: git clone the repo, or download the ZIP and unzip it into a folder like ~/ai-visibility-tracker.
  • Windows: Download the ZIP from GitHub and extract it to C:\ai-visibility-tracker.

Then install the dependencies from inside the folder:

pip install anthropic pandas

(On Mac, use pip3 if pip isn't recognized.)

Step 4: Configure It for Your Brand

This is the part you must change to make the tracker yours. Open config.py in any text editor and update three things:

  1. BRAND_NAME - your company name exactly as it's written publicly (e.g., "Broworks"). Add common variations to BRAND_ALIASES if your name gets spelled multiple ways.
  2. DOMAIN - your root domain without protocol (e.g., "broworks.net"). The tracker matches this against any URLs Claude cites.
  3. COMPETITORS - a list of 3–5 competitor brand names. This turns the tracker from a mirror into a benchmark: you'll see share of voice, not just your own mentions.

Next, open prompts.txt and replace the sample prompts with 10–25 questions your actual buyers ask. Good prompts are specific and commercial in nature: "best Webflow development agency for SaaS," "who should I hire for a WordPress to Webflow migration," "top agencies for AI search optimization." Avoid generic questions like "what is Webflow", nobody wins a citation worth having on those.

Step 5: Run It

From the tracker folder:

  • Mac: python3 tracker.py
  • Windows: python tracker.py

The script sends each prompt to Claude, checks every response for your brand, domain, and competitors, and appends the results to results.csv. Each row records the date, the prompt, whether you were mentioned, whether you were cited by URL, and which competitors appeared.

Step 6: Schedule It

One run is a snapshot. The value comes from the trend line.

  • Mac: Use cron. Run crontab -e and add a line like 0 8 * * 1 cd ~/ai-visibility-tracker && python3 tracker.py to run every Monday at 8 a.m.
  • Windows: Open Task Scheduler, create a basic task, set a weekly trigger, and point the action to python with tracker.py as the argument and the tracker folder as "Start in."

After four to six weeks, open results.csv in any spreadsheet tool and chart mention rate per week. That's your AI visibility baseline.

To build a basic AI visibility tracker, you need four components: Python 3.10+, an Anthropic API key, a configuration file containing your brand name, domain, and competitors, and a list of 10–25 buyer-intent prompts. The script queries Claude on a schedule, scans responses for mentions and citations, and logs results to a CSV file for trend analysis.

Common Mistakes and Pitfalls

  • Testing only branded prompts. Asking "tell me about [your brand]" proves nothing. Track the unbranded, commercial questions where being recommended actually wins business.
  • Changing prompts mid-stream. If you edit your prompt list every week, your trend data becomes meaningless. Lock the list for at least a quarter.
  • Reading too much into one run. AI responses vary between runs. A single missing mention is noise; a six-week decline is signal.
  • Ignoring the "why." The tracker tells you whether you're visible, not why. Fixing low visibility usually comes back to structured content, entity clarity, and crawlable site architecture, the same fundamentals covered in our LLM visibility resources.
  • Hardcoding the API key. Anyone with repo access can see it, and leaked keys get abused fast. Environment variables exist for a reason.

Tracker vs. Manual Checks vs. SaaS Platforms

Approach Cost Setup time Data ownership Best for
Manual AI checks Free None None (screenshots) One-off sanity checks
Custom Claude tracker ~$2–10/month API usage 1–2 hours Full (your CSV) Baseline trend tracking
SaaS platforms High monthly subscription Days, incl. onboarding Vendor-hosted Multi-engine enterprise monitoring

A custom Claude-based AI visibility tracker costs roughly $2–10 per month in API usage and takes one to two hours to set up, compared to enterprise SaaS platforms that monitor multiple AI engines at a significantly higher monthly cost. The custom approach suits teams that want a controlled, transparent baseline; SaaS platforms suit teams needing multi-engine, multi-region coverage.

What to Do With the Data

Visibility measurement is only step one. If the tracker shows you're absent from answers your competitors dominate, the fix lives on your website: clear entity definitions, answer-formatted content, structured data, and fast, clean pages that AI crawlers can parse. This is where site foundations matter, content structure and technical quality compound. We've seen this play out in our own client work: after a structural and content overhaul focused on crawlability and answer-oriented pages, Visa Franchise grew organic traffic by 284%, and that same discipline is what earns citations in AI answers. If your current platform makes those changes slow or fragile, a purpose-built Webflow development foundation is often the unlock.

Measure first. Then fix what the measurement reveals.

FAQs about
Tracking and Improving AI Search Visibility
What does "AI visibility" actually mean for a website?
How many prompts should I track, and how do I choose them?
How much does it cost to run a Claude-based visibility tracker?
Can tracking AI visibility hurt my site or violate any platform rules?
My tracker shows zero mentions. Is that a problem I can actually fix?
How does Broworks approach AI visibility for client websites?