Free API

Check AI bots and get blocking rules with one HTTP request. Try it right here.

✅ No API key✅ No sign-up✅ CORS enabled✅ JSON or plain text✅ Data synced daily
GET request
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
Response
// Press "Send request" or pick an example

Endpoints

EndpointWhat you get
GET /api/checkJSON: which AI bot it is, and whether it is real or fake.Open ↗
GET /api/generatePlain text, ready to paste into robots.txt or your server config.Open ↗
GET /bots.jsonJSON: { version, updatedAt, count, bots: [ … ] } with full details for every bot.Open ↗
GET /ip-ranges.jsonJSON: { botId: { source, updatedAt, prefixes: [ "1.2.3.0/24", … ] } }, synced daily.Open ↗
GET /ai-robots.txtPlain 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.

ParameterMeaning
ua optionalThe User-Agent to check. If you leave it out, your own request’s User-Agent is used.
ip optionalThe visitor’s IP address (IPv4 or IPv6). Needed to tell real bots from fakes.
Response fieldMeaning
isAIBottrue if the user-agent matches a known AI bot.
verifiedtrue: 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.
spoofedtrue when the user-agent claims a bot but the IP is outside its official ranges. Safe to block.
botThe full bot entry (name, company, purpose, robots.txt token, sources…), or null.
inputThe user-agent and IP that were checked.
curl
curl "https://aibotsdb.com/api/check?ua=GPTBot/1.4&ip=198.51.100.7"
JavaScript
const res = await fetch(`https://aibotsdb.com/api/check?ua=${encodeURIComponent(ua)}&ip=${ip}`);
const { isAIBot, spoofed, bot } = await res.json();
Python
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.

ParameterMeaning
format optionalrobots (default), nginx, apache, caddy, cloudflare, haproxy, lighttpd, iis or varnish.
block optionalComma-separated purposes: training, data-provider, search, user-fetch, agent, unknown, or all. Default: training,data-provider.
curl
curl "https://aibotsdb.com/api/generate?format=nginx&block=training,data-provider" > ai-bots.conf
JavaScript
const rules = await fetch("https://aibotsdb.com/api/generate?format=robots&block=all").then((r) => r.text());
Python
import requests
rules = requests.get("https://aibotsdb.com/api/generate", params={"format": "robots", "block": "all"}).text

Download every bot

GET /bots.json

JSON: { version, updatedAt, count, bots: [ … ] } with full details for every bot.

No parameters.

curl
curl -s https://aibotsdb.com/bots.json | jq -r '.bots[] | select(.purpose == "training") | .name'
JavaScript
const { bots } = await fetch("https://aibotsdb.com/bots.json").then((r) => r.json());
Python
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
curl -s https://aibotsdb.com/ip-ranges.json | jq -r '.gptbot.prefixes[]'
JavaScript
const ranges = await fetch("https://aibotsdb.com/ip-ranges.json").then((r) => r.json());
Python
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
curl -s https://aibotsdb.com/ai-robots.txt >> robots.txt
JavaScript
const text = await fetch("https://aibotsdb.com/ai-robots.txt").then((r) => r.text());
Python
import requests
text = requests.get("https://aibotsdb.com/ai-robots.txt").text

Fair 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.