# How to see which AI crawlers read your site

This is the markdown version of https://statlark.com/learn/see-which-ai-crawlers-read-your-site. Every docs and Learn page has one: add .md to its address. Index: https://statlark.com/llms.txt

How do I see which AI bots, like GPTBot or ClaudeBot, are reading my site?

Look at your server, not your analytics tag. Most AI crawlers fetch raw HTML and never run JavaScript, so a script-based tracker can't see them. Find them by matching the user agent of each request your server handles, then check the source address against the operator's published IP list, because anyone can call themselves GPTBot.

## <a id="why-analytics-misses-them"></a>Why your analytics shows none of them

A web analytics tag is JavaScript. It runs in a browser, after the page loads, and reports the visit from there. Most AI crawlers never get that far: they ask your server for the HTML, read the text and leave, and nothing on the page runs. So the crawlers that decide whether an assistant can quote you leave no trace in the tool you check every day.

The requests still reach your server, though. Every one of them carries a user agent, the name the crawler gives itself, and that’s where you find them.

## <a id="three-kinds"></a>Three kinds of AI crawler, and what each visit means

The large AI companies run separate crawlers for separate jobs, and the job tells you more than the company does.

| Kind | Examples | What a visit means |
| --- | --- | --- |
| AI answers | `ChatGPT-User`, `Claude-User`, `Perplexity-User`, `MistralAI-User` | Someone asked an assistant a question, and it fetched your page to answer. This is the closest thing to an AI visit. |
| Indexing | `OAI-SearchBot`, `Claude-SearchBot`, `PerplexityBot`, `Googlebot`, `Applebot` | An engine is indexing the page, so it can find and cite it later. No person is waiting on this request. |
| Training | `GPTBot`, `ClaudeBot`, `CCBot`, `meta-externalagent`, `Bytespider` | Collecting public pages that may be used to train models. |

The split matters when you decide what to allow. Each user agent is matched by its own group in `robots.txt`, so blocking `GPTBot` stops OpenAI’s training crawler and leaves its search crawler and ChatGPT’s fetches alone. Fetches a person triggers are the exception: OpenAI says `robots.txt` rules may not apply to `ChatGPT-User`, and Perplexity says `Perplexity-User` generally ignores them. One name isn’t a crawler at all: `Google-Extended` is a `robots.txt` token that controls whether pages Google crawls may be used for its Gemini models. It never appears in a request, so you won’t find it in your logs.

People who click a link in an assistant’s answer are different again. They run your tag like any other visitor, so they already show up in your analytics, as referrals from sites like `chatgpt.com` or `perplexity.ai` when the assistant passes a referrer.

## <a id="server-logs"></a>Option 1: read your server logs

If your host keeps access logs, the crawlers are already in them. Search for their user agents and count the pages they asked for. For a server writing the common combined log format:

```sh
# Requests from well-known AI crawlers in a combined-format access log, counted
# per crawler and page. Works with gawk and mawk. The user agent is unchecked.
awk -F'"' 'match(tolower($6), /gptbot|oai-searchbot|chatgpt-user|claudebot|claude-searchbot|claude-user|perplexitybot|perplexity-user|ccbot|bytespider|meta-externalagent/) {
  split($2, request, " ")
  print substr(tolower($6), RSTART, RLENGTH), request[2]
}' access.log | sort | uniq -c | sort -rn | head -30
```

That’s enough for a one-off look. It falls short as a habit, for three reasons:

- **Many hosts don’t give you logs.** Serverless and static hosts often keep them for a short time or only on a paid plan, and requests for static files are often not logged at all.
- **The list of names moves.** New crawlers appear every few months, and a grep only finds the names you already knew.
- **Every line is a claim.** The user agent is whatever the client chose to send.

## <a id="verify"></a>Tell the real crawlers from the fakes

Scrapers and scanners often borrow a famous crawler’s name, because some sites let those names through. A count of “GPTBot” requests is a count of requests that *say* they’re GPTBot.

Many operators publish the addresses their crawlers use. OpenAI, Anthropic, Perplexity, Google, Apple, DuckDuckGo, Mistral and Common Crawl each publish a list, mostly as JSON with the same `prefixes` shape. A request is genuine when its source address falls inside a prefix on its operator’s list:

```ts
// The lists share one shape:
// { "prefixes": [{ "ipv4Prefix": "…/24" }, { "ipv6Prefix": "…/64" }] }
type Prefix = { ipv4Prefix?: string; ipv6Prefix?: string };

const toNumber = (ip: string) => ip.split(".").reduce((n, part) => n * 256 + Number(part), 0);

function inPrefix(ip: string, prefix: string): boolean {
  const [base, bits] = prefix.split("/");
  const size = 2 ** (32 - Number(bits));
  return Math.floor(toNumber(ip) / size) === Math.floor(toNumber(base) / size);
}

// IPv4 only, to keep it short. Fetch the list once a day, not on every request.
async function isRealGptBot(ip: string): Promise<boolean> {
  const list: { prefixes: Prefix[] } = await fetch("https://openai.com/gptbot.json").then((r) => r.json());
  return list.prefixes.some((p) => p.ipv4Prefix !== undefined && inPrefix(ip, p.ipv4Prefix));
}
```

Three things make this harder than it looks:

- **The address has to be the real one.** Behind a CDN, load balancer or reverse proxy, the socket address is the proxy’s. Use the header your own proxy sets, never the leftmost `X-Forwarded-For` entry, which the client controls. A private address such as 10.x only tells you a proxy hid the real one.
- **Lists change.** Fetch them daily, and when one is unreachable, treat its crawlers as unchecked, not fake.
- **Not every operator publishes a list.** Some publish none, and some point you to a reverse DNS lookup instead. Without one of those, a request can only ever be unchecked.

## <a id="which-pages"></a>Which pages they read

Once you trust the counts, the pages tell you the most. Crawlers often start with `robots.txt`, `sitemap.xml` and `llms.txt`, so make sure those return a plain 200 to a signed-out request, not a redirect to a login page. AI-answer visits show which pages people’s questions lead to: if assistants keep reading your pricing page, they’re answering questions about your prices, and the page should say them in plain text. And a page no indexing crawler has read in months is unlikely to be cited.

Before you store paths, mask anything private. A link someone pasted into an assistant can put an email address, a reset token or a card number into the URL a crawler then requests.

## <a id="statlark"></a>Option 2: report crawlers from your server to your analytics

This is what [bot tracking](https://statlark.com/docs/bot-traffic.md) in Statlark does. You add one call to the code that handles your requests, such as a Next.js proxy, a Cloudflare Worker or Express middleware. For requests whose user agent looks like a crawler, it sends the user agent and the page. It adds the source address for crawlers whose operator publishes a list, and for the rest a hash of it keyed with your bot key. It sends them in the background, so your responses don’t wait.

Statlark sorts each one into AI answers, indexing, training or other, and checks the address against the operator’s list. Each request is verified, can’t be checked, or fake, and fakes are hidden by default. The Bot traffic card on your Overview then shows which companies’ crawlers read your site and which pages they read, next to your human traffic and revenue.

The address is used to check the crawler and to limit forged requests, and is never stored. Query strings are dropped, and path segments that look like emails, card numbers or tokens are masked before anything is written. Each workspace includes 100,000 crawler requests a month on every plan, separate from your event allowance.

### <a id="ai-prompt"></a>Hand this to your AI

For AI tools: this is the prompt a customer pastes in to start this task. If you are already following it, don’t start again: use the rest of this page as the guide.

Building with Claude Code, Cursor or another AI coding tool? First create a bot key under Settings → Bot tracking and set it as `STATLARK_BOT_KEY` with your hosting provider (steps 1 and 2 of [setting it up by hand](https://statlark.com/docs/bot-traffic.md#set-up)), then paste this in. It never needs to see the key.

```
Add Statlark bot tracking to this project for my site. It records which AI assistants, search engines and training crawlers request the site. It has to run on the server.

Follow this guide for the exact code: https://statlark.com/docs/bot-traffic.md
If that link doesn't open, try the same address without .md. If neither opens, stop and tell me. Don't write this from memory.

1. Check whether this project already sends bot traffic to Statlark, with @statlark/bots or a call to its API. If it does, stop and tell me. If the package is installed but nothing calls it yet, carry on.
2. Work out how the site is served and use that section of the guide. Static sites on Vercel or Cloudflare have sections too, even with no server code yet. For any other server, use its "Any server" section. If the host can't run code on each request, or you can't tell how it's served, stop and ask me.
3. Add the tracking call before any login or session check.
4. robots.txt, llms.txt and sitemap.xml must reach the tracking call and skip login and session checks. Use the guide's example. Don't just widen a middleware matcher.
5. Read the key from STATLARK_BOT_KEY on the server only. Never give it a NEXT_PUBLIC_ or VITE_ prefix, put it in browser code, commit it, or ask me to paste it here.
6. Don't change anything else. Run the site and request a page and /robots.txt signed out, once normally and once with curl -A GPTBot/1.1. Each must return the same status as before, with no redirect.
7. Tell me what you changed, and remind me to set STATLARK_BOT_KEY with my hosting provider.
```

To decide what to let them read, and to make pages easy for an engine to quote, see [AI discoverability](https://statlark.com/docs/ai-discoverability.md). To ask an assistant about this data yourself, see [how to ask your AI assistant about your analytics](https://statlark.com/learn/ask-ai-assistant-about-your-analytics.md).

Last reviewed 21 November 2026
