Free API
Check AI bots and get blocking rules with one HTTP request. Try it right here.
https://aibotsdb.com/api/check?ua=Mozilla%2F5.0+%28compatible%3B+GPTBot%2F1.4%3B+%2Bhttps%3A%2F%2Fopenai.com%2Fgptbot%29&ip=198.51.100.7// Press "Send request" or pick an exampleEndpoints
| Endpoint | What you get | |
|---|---|---|
GET /api/check | JSON: which AI bot it is, and whether it is real or fake. | Open ↗ |
GET /api/generate | Plain text, ready to paste into robots.txt or your server config. | Open ↗ |
GET /bots.json | JSON: { version, updatedAt, count, bots: [ … ] } with full details for every bot. | Open ↗ |
GET /ip-ranges.json | JSON: { botId: { source, updatedAt, prefixes: [ "1.2.3.0/24", … ] } }, synced daily. | Open ↗ |
GET /ai-robots.txt | Plain text robots.txt rules for every AI bot. Use /download/robots.txt to save it as a file. | Open ↗ |
Check a visitor
GET /api/check
JSON: which AI bot it is, and whether it is real or fake.
| Parameter | Meaning |
|---|---|
ua optional | The User-Agent to check. If you leave it out, your own request’s User-Agent is used. |
ip optional | The visitor’s IP address (IPv4 or IPv6). Needed to tell real bots from fakes. |
| Response field | Meaning |
|---|---|
isAIBot | true if the user-agent matches a known AI bot. |
verified | true: the IP is in the bot’s official ranges. false: it is not. null: the operator publishes no IP list, or no IP was given. |
spoofed | true when the user-agent claims a bot but the IP is outside its official ranges. Safe to block. |
bot | The full bot entry (name, company, purpose, robots.txt token, sources…), or null. |
input | The user-agent and IP that were checked. |
curl "https://aibotsdb.com/api/check?ua=GPTBot/1.4&ip=198.51.100.7"const res = await fetch(`https://aibotsdb.com/api/check?ua=${encodeURIComponent(ua)}&ip=${ip}`);
const { isAIBot, spoofed, bot } = await res.json();import requests
r = requests.get("https://aibotsdb.com/api/check", params={"ua": ua, "ip": ip}).json()
print(r["isAIBot"], r["spoofed"])Get blocking rules
GET /api/generate
Plain text, ready to paste into robots.txt or your server config.
| Parameter | Meaning |
|---|---|
format optional | robots (default), nginx, apache, caddy, cloudflare, haproxy, lighttpd, iis or varnish. |
block optional | Comma-separated purposes: training, data-provider, search, user-fetch, agent, unknown, or all. Default: training,data-provider. |
curl "https://aibotsdb.com/api/generate?format=nginx&block=training,data-provider" > ai-bots.confconst rules = await fetch("https://aibotsdb.com/api/generate?format=robots&block=all").then((r) => r.text());import requests
rules = requests.get("https://aibotsdb.com/api/generate", params={"format": "robots", "block": "all"}).textDownload every bot
GET /bots.json
JSON: { version, updatedAt, count, bots: [ … ] } with full details for every bot.
No parameters.
curl -s https://aibotsdb.com/bots.json | jq -r '.bots[] | select(.purpose == "training") | .name'const { bots } = await fetch("https://aibotsdb.com/bots.json").then((r) => r.json());import requests
bots = requests.get("https://aibotsdb.com/bots.json").json()["bots"]Download official IP ranges
GET /ip-ranges.json
JSON: { botId: { source, updatedAt, prefixes: [ "1.2.3.0/24", … ] } }, synced daily.
No parameters.
curl -s https://aibotsdb.com/ip-ranges.json | jq -r '.gptbot.prefixes[]'const ranges = await fetch("https://aibotsdb.com/ip-ranges.json").then((r) => r.json());import requests
ranges = requests.get("https://aibotsdb.com/ip-ranges.json").json()robots.txt that blocks every AI bot
GET /ai-robots.txt
Plain text robots.txt rules for every AI bot. Use /download/robots.txt to save it as a file.
No parameters.
curl -s https://aibotsdb.com/ai-robots.txt >> robots.txtconst text = await fetch("https://aibotsdb.com/ai-robots.txt").then((r) => r.text());import requests
text = requests.get("https://aibotsdb.com/ai-robots.txt").textFair use
The API is free for everyone. Please cache results and don't call it on every page view of a busy site. Responses for the same input rarely change within a day.
High traffic? Run it locally
The packages for JavaScript, Python, Go and PHP do the same checks inside your app, with no network calls. See also the bot checker.