How to Install agent-traffic-classifier: Count How Often ChatGPT and Other AI Bots Visit Your Site (Free)
Tools
Step-by-step
AI bot traffic

Trigger Marketing
The Trigger team
⊹
Quick question: how many times did ChatGPT visit your website last week?
You don't know. Your analytics doesn't know either. AI bots don't run the little tracking script that analytics depends on, so they walk right past it.
But your server keeps a log of every visit. Humans, Google, AI bots, sketchy scripts, all of it. A free tool called agent-traffic-classifier reads that log and sorts the crowd for you.
Quick words (one line each):
Server log (access log): a text file your web server writes, one line per visit.
User agent: the name tag a browser or bot sends with every visit, like "GPTBot/1.0".
AI crawler: a bot collecting pages to train an AI model (example: GPTBot).
AI search bot: a bot fetching pages for AI search answers (examples: OAI-SearchBot, PerplexityBot).
AI assistant: a fetch made live for one user's question (example: ChatGPT-User).
Node.js: free software that runs JavaScript tools on your computer.
Why bother
Google's John Mueller said on Oct 1, 2026 that he has seen AI crawlers reading his sitemap and RSS feed in his own server logs (0:14:00-0:16:40). Logs are where AI visits show up. This tool turns that wall of text into a count.
Step 1: Do a 60-second safety check
Here's what we found on Oct 30, 2026:
Licence: MIT. Free, including for client work.
Last update: Oct 18, 2026. npm version 0.6.2.
Stars: 4 (as of Oct 30, 2026). New (created April 2026), 30 commits.
Early version: the README says 0.x, no stability promises. Pin the version number.
One runtime dependency (isbot). No account, no API key.
Network use: only an optional feature that downloads public IP range lists to spot fake bots.
Step 2: Check you can get your logs
This is the catch. You need raw access logs (Apache or Nginx style). Many traditional hosts and some WordPress hosts let you download them from the control panel.
Hosted site builders usually don't hand them out. Some modern hosts need a "log drain" set up first. Ask your host: "Can I download my raw access logs?"
Save the file as access.log.
Step 3: Install Node.js and the tool
Install Node.js from nodejs.org.
Make a new folder, open a terminal in it, and run:
npm install agent-traffic-classifier@0.6.2
The @0.6.2 pins the version, because early tools change.
Step 4: Create a tiny counting script
In the same folder, make a file called count-ai-visits.mjs and paste this:
import { readFileSync } from 'node:fs';
import { parseLine, createClassifier, reclassifyEntries } from 'agent-traffic-classifier';
const lines = readFileSync('access.log', 'utf8').split('\n');
const entries = lines.map((line) => parseLine(line)).filter((e) => e !== null);
const results = reclassifyEntries(entries, null, createClassifier());
const totals = {};
for (const r of results) {
const group = r.classification.category;
totals[group] = (totals[group] || 0) + 1;
if (group.startsWith('ai-')) console.log(group, r.entry.path);
}
console.table(totals);
What it does: reads the log, sorts each visit into a group, prints every AI visit with the page it hit, then a total per group.
Step 5: Run it
node count-ai-visits.mjs
We tested this exact script on Oct 30, 2026 with a small sample log. It sorted the visits correctly: GPTBot asking for /sitemap.xml came out as ai-crawler, OAI-SearchBot as ai-search, ChatGPT-User as ai-assistant, a curl script as programmatic, and a normal browser as human.
Step 6: Read the groups
The main ones you'll see:
human: real people in browsers.
ai-crawler: AI training bots (GPTBot, ClaudeBot and friends).
ai-search: AI search bots (OAI-SearchBot, PerplexityBot, Claude-SearchBot).
ai-assistant: live fetches for someone's question (ChatGPT-User, Claude-User, Perplexity-User).
search-crawler: classic search engines (Googlebot, Bingbot).
seo-bot: SEO tools (AhrefsBot, SemrushBot).
programmatic: scripts like curl and python-requests.
The ai-assistant line is the juicy one. That's AI fetching your page because a real person just asked about it.
Step 7: Turn it into a monthly number
Download last month's log, run the script, and write three numbers in your report: ai-crawler, ai-search, ai-assistant. Then look at which pages they hit. Pages AI keeps fetching are the ones worth keeping fresh.
Want daily totals instead? The README shows an aggregate function that builds day-by-day summaries.
What it costs
Nothing. MIT licence, no keys, no upgrade.
Do this today
Ask your host: "Can I download my raw access logs?"
Install Node.js and run npm install agent-traffic-classifier@0.6.2.
Paste the script above into count-ai-visits.mjs.
Run node count-ai-visits.mjs on last month's log.
Write down your ai-assistant count. That's your baseline.
Related reading
Sources
Don't worry if this seems like it's a pain in the ass for someone who doesn't build websites. That's because it is. The good news: just click the link below, pull the trigger, and we'll take care of the rest.
Share This Article

