Detect AI bots visiting your website. Cloudflare Worker for 100% accurate AI traffic detection.
npm install @loamly/edgeSee every AI bot that visits your website.
ChatGPT, Claude, Perplexity, Gemini โ know when they crawl your pages or when users browse through them.


Part of the Loamly open-source project.
---
AI bots are visiting your site right now. They're:
- ๐ค Crawling your content for training (GPTBot, ClaudeBot)
- ๐ Searching on behalf of users (Perplexity, ChatGPT browsing)
- ๐งโ๐ป Browsing through agentic interfaces (ChatGPT Agent Mode)
Without edge detection, this traffic is invisible in your analytics.
```
Today's AI Visitors:
โโโ ChatGPT Agent Mode 47 visits (verified โ)
โโโ GPTBot Crawler 892 pages (User-Agent)
โโโ ClaudeBot 234 pages (User-Agent)
โโโ PerplexityBot 156 pages (User-Agent)
โโโ Unknown AI 23 visits (behavioral)
| Method | Accuracy | What it catches |
|--------|----------|-----------------|
| Cryptographic signatures | 100% | ChatGPT Agent Mode (RFC 9421 signed) |
| User-Agent patterns | 95%+ | All major AI crawlers and bots |
| Behavioral analysis | 90%+ | Unknown AI bots |
Just point your DNS โ we handle everything:
``
your-domain.com A 37.16.7.18
SSL, verification, and proxying handled automatically. Security details โ
`bash
git clone https://github.com/loamly/loamly.git
cd loamly/packages/edge
Then add a Worker Route in Cloudflare:
- Route:
yourdomain.com/*
- Worker: loamly-edgeHow It Works
`
User/Bot Request
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Loamly Edge (this package) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ 1. Check for RFC 9421 sig โ โ ChatGPT Agent Mode
โ 2. Check User-Agent patterns โ โ GPTBot, ClaudeBot, etc.
โ 3. Analyze request behavior โ โ Unknown bots
โ 4. Forward verified events โ โ Loamly Dashboard
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
Your Origin (unchanged)
`Zero latency added โ verification happens in parallel with the request.
Supported AI Bots
$3
| Bot | Company | Detection |
|-----|---------|-----------|
| GPTBot | OpenAI | User-Agent |
| ChatGPT-User | OpenAI | User-Agent + Signature |
| ClaudeBot | Anthropic | User-Agent |
| Claude-User | Anthropic | User-Agent |
| PerplexityBot | Perplexity | User-Agent |
| Google-Extended | Google | User-Agent |
$3
| Bot | Feature | Detection |
|-----|---------|-----------|
| ChatGPT Agent Mode | "Browse with Bing" | RFC 9421 Signature โ |
| Claude Computer Use | Browser automation | Coming soon |
| Perplexity Pro Search | Live web search | User-Agent |
Configuration
$3
| Variable | Required | Description |
|----------|----------|-------------|
|
LOAMLY_WORKSPACE_ID | Yes | Your Loamly workspace ID |
| LOAMLY_WORKSPACE_API_KEY | Yes | Your Loamly API key |
| LOAMLY_INGEST_URL | No | Custom ingest endpoint (default: app.loamly.ai) |$3
Events sent to Loamly:
`json
{
"landing_page": "https://example.com/product/123",
"bot_type": "chatgpt_agent",
"detection_method": "rfc9421_signature",
"signature_verified": true,
"user_agent": "ChatGPT-User/1.0",
"country": "US",
"timestamp": "2025-12-21T10:30:00Z"
}
`> Privacy: IP addresses are hashed for visitor deduplication, then discarded. Only country is stored.
Self-Hosting Without Loamly
This Worker can send events to your own backend. Modify the
sendToIngest function:`typescript
async function sendToIngest(event: AIVisitEvent) {
await fetch('https://your-backend.com/ai-visits', {
method: 'POST',
body: JSON.stringify(event)
});
}
``MIT ยฉ Loamly
---