Skip to content

helpers : isAIBot()

isAIBot(ua: string): boolean

Check whether user-agent is an AI crawler (an AI bot that browses websites by itself to collect data).

OperatorUser-Agent
AI2AI2Bot
AmazonAmazonbot
Anthropicanthropic-ai, ClaudeBot, Claude-SearchBot, Claude-Web
AppleApplebot, Applebot-Extended
BraveBravebot
ByteDanceBytespider, TikTokSpider
Coherecohere-training-data-crawler
Common CrawlCCBot
CoveoCoveobot
DataForSEODataForSeoBot
DeepSeekDeepSeekBot
DiffbotDiffbot
GoogleGoogle-Extended, GoogleOther, GoogleOther-Image, GoogleOther-Video, Google-CloudVertexBot
Hive AIImagesiftBot
HuaweiPanguBot, PetalBot
Hugging FaceHuggingFace-Bot
KangarooKangaroo Bot
Mendable.aiFirecrawlAgent
MetaFacebookBot, meta-externalagent
OpenAIGPTBot, OAI-SearchBot
PerplexityPerplexityBot
ReplicateReplicate-Bot
RunPodRunPod-Bot
SB IntuitionsSBIntuitionsBot
SEMrushSemrushBot-OCOB
TimpiTimpibot
Together AITogether-Bot
Hunter.ioVelenPublicWebCrawler
Vercelv0bot
Webz.ioomgili, omgilibot, Webzio-Extended
xAIxAI-Bot
You.comYouBot
Zhipu AIChatGLM-Spider

TIP

See list of all possible values for Crawler (including non-AI crawlers) here.

Code Example

js
import { isAIBot } from 'ua-parser-js/helpers';

const ahref = 'Mozilla/5.0 (compatible; AhrefsBot/7.0; +http://ahrefs.com/robot/)';
const firefox = 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0';
const searchGPT = 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; OAI-SearchBot/1.0; +https://openai.com/searchbot';

console.log(isAIBot(ahref)); // false
console.log(isAIBot(firefox)); // false
console.log(isAIBot(searchGPT)); // true
js
import { isAIBot } from 'ua-parser-js/helpers';

console.log(isAIBot(req.headers['user-agent']));

References

UAParser.js v2 is licensed under AGPLv3 or PRO licenses.