#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct AiAgent {
pub name: &'static str,
pub company: &'static str,
pub kind: &'static str,
pub token: &'static str,
pub ranges: Option<&'static str>,
}
const fn agent(name: &'static str, company: &'static str, kind: &'static str, token: &'static str) -> AiAgent {
AiAgent { name, company, kind, token, ranges: None }
}
const fn listed(
name: &'static str,
company: &'static str,
kind: &'static str,
token: &'static str,
ranges: &'static str,
) -> AiAgent {
AiAgent { name, company, kind, token, ranges: Some(ranges) }
}
const ANTHROPIC: &str = "https://claude.com/crawling/bots.json";
pub const AI_AGENTS: &[AiAgent] = &[
listed("ChatGPT-User", "OpenAI", "live", "chatgpt-user", "https://openai.com/chatgpt-user.json"),
listed("OAI-SearchBot", "OpenAI", "crawl", "oai-searchbot", "https://openai.com/searchbot.json"),
listed("GPTBot", "OpenAI", "crawl", "gptbot", "https://openai.com/gptbot.json"),
listed("Claude-User", "Anthropic", "live", "claude-user", ANTHROPIC),
listed("Claude-SearchBot", "Anthropic", "crawl", "claude-searchbot", ANTHROPIC),
listed("ClaudeBot", "Anthropic", "crawl", "claudebot", ANTHROPIC),
listed("Claude-Web", "Anthropic", "crawl", "claude-web", ANTHROPIC),
listed("anthropic-ai", "Anthropic", "crawl", "anthropic-ai", ANTHROPIC),
listed(
"Perplexity-User",
"Perplexity",
"live",
"perplexity-user",
"https://www.perplexity.ai/perplexity-user.json",
),
listed("PerplexityBot", "Perplexity", "crawl", "perplexitybot", "https://www.perplexity.ai/perplexitybot.json"),
listed("MistralAI-User", "Mistral", "live", "mistralai-user", "https://mistral.ai/mistralai-user-ips.json"),
agent("meta-externalfetcher", "Meta", "live", "meta-externalfetcher"),
agent("meta-externalagent", "Meta", "crawl", "meta-externalagent"),
listed("DuckAssistBot", "DuckDuckGo", "crawl", "duckassistbot", "https://duckduckgo.com/duckassistbot.json"),
agent("Amazonbot", "Amazon", "crawl", "amazonbot"),
agent("Bytespider", "ByteDance", "crawl", "bytespider"),
listed("CCBot", "Common Crawl", "crawl", "ccbot", "https://index.commoncrawl.org/ccbot.json"),
agent("cohere-ai", "Cohere", "crawl", "cohere-ai"),
agent("YouBot", "You.com", "crawl", "youbot"),
agent("Diffbot", "Diffbot", "crawl", "diffbot"),
agent("Timpibot", "Timpi", "crawl", "timpibot"),
];
pub const BOT_PATTERN: &str = r"(?i-u)bot\b|bot/|crawl|spider|slurp|scrap|fetch|headless|lighthouse|pagespeed|gtmetrix|pingdom|uptime|monitor|preview|validator|python|curl/|wget|httpclient|okhttp|java/|go-http|axios|node-fetch|undici|libwww|phantomjs|selenium|puppeteer|playwright|facebookexternalhit|embedly|whatsapp|telegram|discord|slackbot|skypeuripreview|bitlybot|feed|rss|reader|archive\.org|ia_archiver|semrush|ahrefs|mj12|dotbot|petalbot|bingpreview|baiduspider|sogou|exabot|seznam|applebot";