How to Audit 500 Websites for ChatGPT & Perplexity Crawlers Using Zero-Dependency Node.js
When developers and technical SEOs audit websites for Generative Engine Optimization (GEO) — visibility inside ChatGPT Search, Perplexity, Claude, and Google AI Overviews — most quick online checkers only check whether H
When developers and technical SEOs audit websites for Generative Engine Optimization (GEO) — visibility inside ChatGPT Search, Perplexity, Claude, and Google AI Overviews — most quick online checkers only check whether HTTP 200 came back.
In practice, that misses the three exact technical bugs that silently kill AI citations on real production websites:
-
HTML Soft-404s masquerading as
/llms.txt(SPA/CMS catch-all routers returningHTTP 200withindex.htmlinstead of plain Markdown). -
JavaScript Rendering Traps (React/Vite/Vue apps returning
<div id="root"></div>with<120raw HTML words to non-JS AI fetchers). -
Subtle RFC-9309
robots.txtprecedence bugs across 10 distinct AI crawlers (GPTBot,OAI-SearchBot,ChatGPT-User,ClaudeBot,Claude-Web,PerplexityBot,Google-Extended,Applebot-Extended,Meta-ExternalAgent, andCCBot).
Below is how you can detect all three across hundreds of URLs using pure Node.js 18+ (built-in fetch, zero npm install, zero paid APIs).
Bug #1: Catching /llms.txt Soft-404 Traps
A huge percentage of Next.js, Vite, and Netlify single-page apps configure a catch-all rewrite (/* -> /index.html 200). If you naively check res.ok on https://example.com/llms.txt, it reports valid even though the AI crawler just received your HTML app shell!
Here is a clean, reliable detector:
export function evaluateLlmsTxt(status, contentType, body) {
if (status < 200 || status >= 300) {
return { status: "missing", httpStatus: status };
}
const trimmed = (body || "").trim();
const ct = (contentType || "").toLowerCase();
const looksLikeHtml =
ct.includes("text/html") ||
/^<!doctype\s+html/i.test(trimmed) ||
/^<html[\s>]/i.test(trimmed) ||
/<body[\s>]/i.test(trimmed.slice(0, 1200));
if (looksLikeHtml) {
return { status: "soft-404", note: "Returned HTML instead of Markdown" };
}
if (trimmed.length < 40) {
return { status: "thin", note: "File exists but under 40 characters" };
}
const linkCount = (trimmed.match(/\[[^\]]+\]\(https?:\/\/[^)]+\)/g) || []).length;
return { status: "valid", bytes: trimmed.length, linkCount };
}
Quick tip: If you don't have an
/llms.txtor AI-friendly/robots.txtyet, I put up a 100% free, zero-signup client-side generator you can use directly in the browser: CiteLens Free llms.txt & AI robots.txt Generator.
Bug #2: Implementing RFC-9309 Precedence for 10 AI Crawlers
A surprisingly common mistake in DIY robots.txt scripts is checking text.includes("Disallow: /") or stopping at the first matching rule.
Under RFC-9309, two rules matter most:
-
Specific
User-agentgroups override*completely (if a site defines aPerplexityBotblock, the wildcard*block no longer applies toPerplexityBot). - Within the matched group, the longest matching path pattern wins, and on an exact length tie,
AllowbeatsDisallow.
export const AI_BOTS = [
"GPTBot", "OAI-SearchBot", "ChatGPT-User",
"ClaudeBot", "Claude-Web", "PerplexityBot",
"Google-Extended", "Applebot-Extended",
"Meta-ExternalAgent", "CCBot",
];
function patternToRegex(pattern) {
const endAnchor = pattern.endsWith("$");
const clean = endAnchor ? pattern.slice(0, -1) : pattern;
const escaped = clean.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
return new RegExp("^" + escaped + (endAnchor ? "$" : ""));
}
export function isBotAllowed(groups, botName, targetPath = "/") {
const bot = botName.toLowerCase();
const specific = groups.filter((g) => g.agents.includes(bot));
const applicable = specific.length
? specific
: groups.filter((g) => g.agents.includes("*"));
if (!applicable.length) return { allowed: true, matchedRule: "default-allow" };
let best = null;
for (const g of applicable) {
for (const rule of g.rules) {
if (rule.type === "disallow" && rule.pattern === "") continue;
if (!rule.pattern) continue;
if (patternToRegex(rule.pattern).test(targetPath)) {
const len = rule.pattern.length;
if (!best || len > best.len || (len === best.len && rule.type === "allow" && best.type === "disallow")) {
best = { type: rule.type, pattern: rule.pattern, len };
}
}
}
}
return best ? { allowed: best.type === "allow", matchedRule: `${best.type}:${best.pattern}` }
: { allowed: true, matchedRule: "no-match-allow" };
}
This distinguishes cleanly between sites that block training (GPTBot) while still welcoming live citation retrieval (OAI-SearchBot and ChatGPT-User).
Bug #3: Spotting Raw HTML JavaScript Rendering Traps
Traditional Googlebot runs a headless Chromium rendering queue, so client-side SPAs often "look fine" in Google Search Console. However, many AI retrieval fetchers and lightweight RAG agents parse raw server HTML without executing JavaScript.
Before firing up Playwright or Puppeteer across 500 URLs, you can catch 90% of severe SPA traps in milliseconds by stripping <script>, <style>, and HTML tags from the raw HTTP response and checking for an empty mount container:
export function checkJsTrap(rawHtml) {
const stripped = rawHtml
.replace(/<script[\s\S]*?<\/script>/gi, " ")
.replace(/<style[\s\S]*?<\/style>/gi, " ")
.replace(/<noscript[\s\S]*?<\/noscript>/gi, " ")
.replace(/<[^>]+>/g, " ")
.replace(/\s+/g, " ")
.trim();
const rawWordCount = stripped ? stripped.split(" ").length : 0;
const hasEmptySpaShell =
/<div[^>]+id=["'](root|app|__next|__nuxt)["'][^>]*>\s*<\/div>/i.test(rawHtml) ||
/enable javascript to run this app/i.test(rawHtml);
const risk = hasEmptySpaShell && rawWordCount < 150 ? "HIGH"
: rawWordCount < 120 ? "MEDIUM" : "LOW";
return { rawWordCount, hasEmptySpaShell, risk };
}
Running It Across 500 URLs (With Concurrency & White-Label Output)
Combine all three checks with JSON-LD @graph parsing, <link rel="canonical">, absolute og:image, and /sitemap.xml validation inside a small Promise worker pool (concurrency = 5), and you can audit 100 client or prospect domains in ~25 seconds:
$ node citelens-audit.mjs prospects.txt --brand "Apex GEO" --color "#4f46e5"
Auditing 4 URL(s) with concurrency=5...
[1/4] acmesaas.io -> 54/100 (D) | Bots 8/10 | llms.txt: soft-404 | JS Trap: HIGH
[2/4] brightdental.com -> 61/100 (D) | Bots 10/10 | llms.txt: missing | JS Trap: LOW
[3/4] legalpro.co -> 98/100 (A+) | Bots 10/10 | llms.txt: valid | JS Trap: LOW
[4/4] shopnova.store -> 68/100 (C) | Bots 7/10 | llms.txt: missing | JS Trap: LOW
Want the Complete Ready-to-Run Toolkit?
- Free Chrome Web Store Extension (Published): Install CiteLens GEO Auditor on Chrome Web Store for 1-click local audits on any tab.
- Open-Source GitHub Action (MIT): Add automated GEO checks to CI/CD with ai-search-readiness-action.
- Free MIT Single-URL CLI (GitHub): Clone and run zero-dependency checks locally with llms-txt-soft404-checker.
-
7 Free Browser Tools Hub (no signup): Test
robots.txt,/llms.txt, JSON-LD, Obsidian Markdown, n8n webhooks & SaaS contracts directly at CiteLens Free Tools Hub. -
For Technical SEOs & Agencies ($29 one-time, Commercial License): I packaged the full unit-tested Zero-Dependency Bulk GEO CLI (500+ URLs, exports CSV, JSON, Markdown & customizable White-Label A4 HTML/PDF client reports), 10 industry GEO packs (30 ready-to-deploy
llms.txt,robots.txt& JSON-LD files), 2 importable n8n workflows (weekly bot-regression Slack monitor + automated lead prospector), plus agency proposals and outreach SOPs in the CiteLens GEO & AI Search Agency Kit.
What technical GEO edge cases have you caught on client sites lately? Drop them in the comments — always keen to add new checks to the parser!
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.