Short answer: do not trust the user-agent string alone. OpenAI and Perplexity publish JSON lists of the IP ranges their crawlers use, and Google documents reverse DNS names and IP ranges for its crawlers. Match each logged request against the right list before you count it, block it or celebrate it.
Anyone can send User-Agent: GPTBot. Scrapers do it to slip past rules written for well-known bots. If you are deciding which AI crawlers to allow, or measuring whether AI search engines read your site, fake visits distort both decisions.
Where are the official lists?
| Crawler | How to verify | Source |
|---|---|---|
| GPTBot, OAI-SearchBot, ChatGPT-User | Published IP prefixes: gptbot.json, searchbot.json, chatgpt-user.json on openai.com | OpenAI crawler docs |
| PerplexityBot, Perplexity-User | Published IP prefixes: perplexitybot.json and perplexity-user.json on perplexity.ai | Perplexity bot docs |
| Googlebot and other Google crawlers | Reverse DNS, then forward DNS, or Google's IP range files | Verifying Google's crawlers |
OpenAI and Perplexity keep a separate JSON file per user agent, so use the file that matches the agent you see. The files carry a creationTime field; fetch them fresh at least daily.
A small checker in Node.js
// verify-bots.mjs : node verify-bots.mjs access.log import { readFileSync } from "node:fs"; import net from "node:net"; const LISTS = { GPTBot: "https://openai.com/gptbot.json", "OAI-SearchBot": "https://openai.com/searchbot.json", "ChatGPT-User": "https://openai.com/chatgpt-user.json", PerplexityBot: "https://www.perplexity.ai/perplexitybot.json", "Perplexity-User": "https://www.perplexity.ai/perplexity-user.json", }; const toInt = (ip) => ip.split(".").reduce((a, o) => (a << 8n) + BigInt(o), 0n); function inCidr(ip, cidr) { const [base, bits] = cidr.split("/"); if (!net.isIPv4(ip) || !net.isIPv4(base)) return false; // IPv6 left out for brevity const mask = ((1n << 32n) - 1n) ^ ((1n << BigInt(32 - Number(bits))) - 1n); return (toInt(ip) & mask) === (toInt(base) & mask); } const ranges = {}; for (const [bot, url] of Object.entries(LISTS)) { const json = await (await fetch(url)).json(); ranges[bot] = json.prefixes.map((p) => p.ipv4Prefix).filter(Boolean); } const counts = {}; for (const line of readFileSync(process.argv[2], "utf8").split("\n")) { const ip = line.split(" ")[0]; // common/combined log format for (const bot of Object.keys(ranges)) { if (!line.includes(bot)) continue; const real = ranges[bot].some((c) => inCidr(ip, c)); const k = `${bot} ${real ? "verified" : "UNVERIFIED"}`; counts[k] = (counts[k] ?? 0) + 1; } } console.table(counts); For Googlebot, Google's documentation describes two checks: a reverse DNS lookup on the IP should return a hostname under googlebot.com or google.com (the exact masks are listed per crawler type), and a forward lookup of that hostname should return the same IP. Google also publishes IP range files for its crawlers if you prefer a list match.
What do you do with unverified hits?
Count them separately and decide on a rule. Options, from mild to strict:
- Exclude them from any report on AI crawler activity.
- Rate-limit them at the edge.
- Block them by user agent plus failed IP match.
Do not block by user agent alone. That blocks the real crawler too, and robots.txt is the right tool for real crawlers anyway.
Common mistakes
- Hard-coding the IP list. Ranges change; the JSON has a creation time for a reason.
- Matching the user agent too loosely.
GPTBotandChatGPT-Userare different agents with different lists. - Forgetting IPv6. Extend the CIDR check if your server logs IPv6 clients.
- Reading CDN IPs instead of client IPs. Behind a CDN, use the header your CDN sets for the original client.
FAQ
Does Anthropic publish IP ranges?
Check Anthropic's current crawler help page. Its documentation describes ClaudeBot, Claude-User and Claude-SearchBot and how to control them in robots.txt.
Do verified bots always obey robots.txt?
Google says its common crawlers always respect robots.txt for automatic crawls. For the others, read each vendor's page: user-triggered fetches are documented separately from automatic crawling.
How often should I refresh the lists?
Daily is a reasonable default.
What does a verified OAI-SearchBot visit tell me?
That ChatGPT search can read the page. Whether ChatGPT cites it is a separate question, which I looked at in a piece on OpenAI's index and bots on the citelity blog.
