Verifying AI Crawler Traffic on a Law Firm Site by IP Range
If you maintain a law firm website, you have probably been asked some version of this question: "Is ChatGPT reading our pages?" The quick answer is to grep the access logs for GPTBot or OAI-SearchBot and count the hits.
If you maintain a law firm website, you have probably been asked some version of this question: "Is ChatGPT reading our pages?" The quick answer is to grep the access logs for GPTBot or OAI-SearchBot and count the hits. The problem is that a user agent string is just a header. Anyone can send it, and scrapers often borrow the names of well-known crawlers to slip past filters.
For a criminal defense firm, the distinction matters. The firm may be deciding which AI crawlers to allow, or trying to judge whether its charge pages are being fetched by an assistant when people ask about a DUI or a drug charge. Counting spoofed requests leads to bad decisions. This post walks through verifying AI crawler traffic against the IP ranges the operators publish.
Which operators publish ranges
OpenAI documents its crawlers and publishes a JSON file of IP prefixes for each one. At the time of writing, its documentation lists GPTBot (content that may be used for training), OAI-SearchBot (surfacing sites in ChatGPT search), ChatGPT-User (fetches made when a user asks ChatGPT to visit a page) and OAI-AdsBot (checking landing pages submitted as ads). The files live at openai.com/gptbot.json, openai.com/searchbot.json, openai.com/chatgpt-user.json and openai.com/adsbot.json.
Perplexity publishes a similar file for PerplexityBot. Google documents its own crawler IP ranges and a reverse DNS check for verifying Googlebot. Check each operator's current documentation before building on it, because file locations and bot names change.
One detail from OpenAI's docs is easy to miss. ChatGPT-User handles user-initiated requests, and the documentation says robots.txt rules may not apply to it. So a robots.txt rule aimed at GPTBot does not tell you anything about ChatGPT-User fetches.
The file format
The OpenAI and Perplexity files share a simple shape: a creationTime value and a prefixes array, where each entry holds an ipv4Prefix in CIDR notation. That makes them easy to load with standard library tools. Keep the creationTime, since it tells you when the ranges last changed.
A small verification script
The script below loads the published prefixes, reads a combined-format access log, and labels each request that claims to be an AI crawler as verified or unverified.
import ipaddress, json, re, sys, urllib.request
SOURCES = {
"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",
}
def load(url):
data = json.load(urllib.request.urlopen(url))
return [ipaddress.ip_network(p["ipv4Prefix"]) for p in data["prefixes"] if "ipv4Prefix" in p]
nets = {bot: load(url) for bot, url in SOURCES.items()}
line_re = re.compile(r'^(\S+) .*?"[A-Z]+ (\S+) [^"]*" \d+ \S+ "[^"]*" "([^"]*)"')
for line in open(sys.argv[1]):
m = line_re.match(line)
if not m:
continue
ip, path, ua = m.groups()
for bot, ranges in nets.items():
if bot in ua:
addr = ipaddress.ip_address(ip)
ok = addr.version == 4 and any(addr in n for n in ranges)
print(bot, "verified" if ok else "UNVERIFIED", ip, path)
It is deliberately small. In production you would cache the JSON files, refresh them daily and handle IPv6 if an operator starts listing it.
Reading the results for a law firm site
Once requests are labeled, a few patterns become useful. Verified OAI-SearchBot and PerplexityBot hits on charge pages suggest those pages are being considered as sources for AI search answers. Verified ChatGPT-User hits on a specific page often mean someone asked ChatGPT about that topic and the assistant fetched your page in response.
Unverified requests deserve their own report. A spike of fake GPTBot traffic hitting every URL on the site is usually a scraper. If your firm blocks bots at the CDN or firewall, base those rules on verified ranges rather than user agent strings, or you may block the real crawler while the impostor changes its header and keeps going.
Decisions about which crawlers to let in are a business question as much as a technical one. This guide on which AI crawlers a criminal defense website should let in covers the tradeoffs from the firm's side.
Keeping it maintained
Published ranges change. OpenAI's files carry a creationTime, and the values differ between files, which tells you they are updated independently. Schedule the refresh, log when the ranges change and alert if a file fails to download, so a stale list does not quietly mark real crawlers as fake.
It also helps to send a monthly summary to whoever handles marketing at the firm: verified fetches by bot and by page, plus a count of spoofed requests. Lawyers rarely want raw logs, but a short table of which charge pages AI crawlers read most is something they will look at. For broader context on this area, there is a collection of writing on ChatGPT, AI search and legal marketing technology.
Questions about verifying AI crawlers
Is checking the user agent enough?
No. User agents are easy to fake. Matching the request IP against the operator's published ranges is far more reliable.
Does blocking GPTBot stop ChatGPT from visiting the site?
Not necessarily. OpenAI lists ChatGPT-User separately for user-initiated fetches and says robots.txt rules may not apply to it.
How often should the IP lists be refreshed?
Daily is a reasonable default. The files are small, and refreshing often keeps verification accurate when ranges change.
SBD Marketing works only with criminal defense law firms, one firm per city, and helps them with website design, SEO for the charges they defend, visibility in AI search tools and SEO audits.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.