Cloudflare Workers
One Worker in front of your site sorts every visitor: people, real search crawlers, AI crawlers like GPTBot, and bots on VPNs or data centers.
Speed
Every check answers in 50 to 100 ms, so your pages and signups never wait on it.
AI crawlers like GPTBot and ClaudeBot, scrapers, fake Googlebots and bots on VPNs, Tor or data centers. People and real search crawlers get in.
Click Deploy to Cloudflare, paste your API key and Site ID, add a route. About 10 minutes.
Each kind of visitor is set to Allow, Flag or Block. Flag lets it in and marks it, so you can switch that class to Block later in one click.
Monitoring costs nothing up to 10,000 site checks a month, with no card. Blocking uses prepaid credits: 1 per visitor check, cached for 10 minutes, packs from $20. The 5,000 free credits to start need a card (nothing is charged until you buy a pack) and last 30 days.
Servers in Denmark (EU). For each visitor we receive the IP address, the user agent and a few request headers. Security and data handling
Keep them. IPScanner adds VPN, Tor and data-center checks and shows every visitor before you block more than Tor and bot scripts.
Setup
Or use the Deploy button above.
git clone https://github.com/ipscanner/ipscanner-cloudflare
cd ipscanner-cloudflare
npm install
npx wrangler deploynpx wrangler secret put IPSCANNER_API_KEYAdd it under Sites in your dashboard, which shows its traffic and holds its policy.
"vars": {
"SITE_ID": "site_4fQ8nZ2kLm7xR1vT9cBw"
}On a custom domain or workers.dev, set ORIGIN_URL to your backend instead.
"routes": [{
"pattern": "example.com/*",
"zone_name": "example.com"
}]Set it and forget it
Policy changes reach the edge without a redeploy, and if we are ever slow, the request goes through untouched.

How it works
The Worker reads the visitor's IP, User-Agent and JA4, when Cloudflare provides it.
Agentscan and IP Detection run in parallel, cached per visitor, and fail open after 1.5 seconds.
Monitor mode sends verdict headers to your origin. Block mode also answers a blocked visitor with a 403.
Verified crawlers always pass, and X-IPScanner-* headers sent by the client are stripped.
Headers
When a check fails or is skipped, only X-IPScanner-Status is set.
| Header | From | Example |
|---|---|---|
| X-IPScanner-ClassAgentscan | Agentscan | human |
| X-IPScanner-ActionAgentscan | Agentscan | allow |
| X-IPScanner-ConfidenceAgentscan | Agentscan | 0.92 |
| X-IPScanner-Network-ClassIP Detection | IP Detection | residential_clean |
| X-IPScanner-AnonymizedBoth | Both | false |
| X-IPScanner-RiskIP Detection | IP Detection | 12 |
| X-IPScanner-CountryIP Detection | IP Detection | DE |
| X-IPScanner-StatusWorker | Worker | ok |
Settings
Set these in the vars block of wrangler.jsonc.
| Variable | Default | What it does |
|---|---|---|
| MODEmonitor adds headers, enforce also blocks | monitor | monitor adds headers, enforce also blocks |
| SITE_IDYour site id. Set it and the dashboard policy applies | Empty | Your site id. Set it and the dashboard policy applies |
| CHECK_AGENTRuns Agentscan | true | Runs Agentscan |
| CHECK_IPRuns IP Detection | true | Runs IP Detection |
| BLOCK_CLASSESAgentscan classes to block in enforce mode | malicious_automation | Agentscan classes to block in enforce mode |
| BLOCK_ANONYMIZEDAlso blocks VPN, proxy and Tor in enforce mode | false | Also blocks VPN, proxy and Tor in enforce mode |
| TIMEOUT_MSPer call, then the request goes through | 1500 | Per call, then the request goes through |
| AGENT_TTLSeconds to cache an Agentscan verdict | 600 | Seconds to cache an Agentscan verdict |
| IP_TTLSeconds to cache an IP lookup | 3600 | Seconds to cache an IP lookup |
| POLICY_TTLSeconds a fetched policy stays fresh | 30 | Seconds a fetched policy stays fresh |
| SKIP_PATHSPath regex that skips the check | Static assets | Path regex that skips the check |
| ORIGIN_URLBackend to forward to when not on a route | Empty | Backend to forward to when not on a route |
Questions