@trustbot/lists 0.0.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 (2026-12-02)
4
+
5
+ First release.
6
+
7
+ - 41 bots with operator, kind, User-Agent tokens and how each can be verified (`bots.json`).
8
+ - 16 official IP lists from OpenAI, Anthropic, Google, Microsoft, Apple, Perplexity, Mistral, DuckDuckGo and Common Crawl (`ranges.json` and `ranges/<id>.txt`).
9
+ - `rangesFor()`, `format()` and `getBot()`.
10
+ - `trustbot-lists` command: allowlists for nginx, Apache, Caddy and Cloudflare.
11
+ - Zero dependencies.
package/README.md CHANGED
@@ -1,12 +1,113 @@
1
1
  # @trustbot/lists
2
2
 
3
- **The data behind trustbot, without the code.** Known bots with who runs them, and every operator's official IP ranges (OpenAI, Anthropic, Google, Microsoft, Apple, Perplexity and more), refreshed every week.
3
+ <p>
4
+ <a href="https://www.npmjs.com/package/@trustbot/lists"><img src="https://img.shields.io/npm/v/@trustbot/lists" alt="npm version"></a>
5
+ <a href="https://bundlephobia.com/package/@trustbot/lists"><img src="https://img.shields.io/badge/dependencies-0-brightgreen" alt="zero dependencies"></a>
6
+ <a href="https://github.com/ckgiri/trustbot-lists/actions/workflows/update.yml"><img src="https://img.shields.io/badge/IP%20lists-updated%20weekly-blue" alt="IP lists updated weekly"></a>
7
+ <a href="https://github.com/ckgiri/trustbot-lists/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@trustbot/lists" alt="MIT license"></a>
8
+ </p>
4
9
 
5
- In development. It will ship plain JSON you can use from any language, firewall or CDN rule:
10
+ **The data behind [trustbot](https://github.com/ckgiri/trustbot), without the code.** 41 known bots with who runs them and how to verify them, plus every operator's official IP ranges (OpenAI, Anthropic, Google, Microsoft, Apple, Perplexity, Mistral, DuckDuckGo, Common Crawl), refreshed every week.
6
11
 
7
- - `bots.json`: each bot's name, operator, kind and how it can be verified
8
- - `ranges.json`: the official IP ranges, keyed by bot, with the date they were downloaded
12
+ Use it as JSON from any language, as plain-text lists for a firewall, or as ready-to-paste allowlists for nginx, Apache, Caddy and Cloudflare.
9
13
 
10
- To verify bots in JavaScript today, use [trustbot](https://github.com/ckgiri/trustbot).
14
+ ```bash
15
+ npx @trustbot/lists ranges GPTBot ClaudeBot --format nginx
16
+ # allow 4.227.36.0/25;
17
+ # allow 20.125.66.80/28;
18
+ # …
19
+ ```
11
20
 
12
- MIT © CK Giri
21
+ ## When to use this, and when to use trustbot
22
+
23
+ | You want to… | Use |
24
+ |---|---|
25
+ | Check a request in your app: is this GPTBot real? | [trustbot](https://www.npmjs.com/package/trustbot): it also checks reverse DNS and signatures, and keeps the lists fresh at runtime |
26
+ | Allowlist real bots in nginx, Apache, Caddy or a Cloudflare WAF rule | this package's CLI |
27
+ | Feed the data into Python, Go, a SIEM or a spreadsheet | `bots.json`, `ranges.json` or the `.txt` files |
28
+ | Know who runs a bot and how it can be verified | `bots.json` |
29
+
30
+ An IP allowlist only covers bots that publish IP lists. Yandex, Baidu and Amazon verify by reverse DNS instead, and ChatGPT agent by signature, so they need trustbot.
31
+
32
+ ## Command line
33
+
34
+ ```bash
35
+ npx @trustbot/lists ranges <bot...> [--format txt|json|nginx|apache|caddy|cloudflare] [--ipv4|--ipv6]
36
+ npx @trustbot/lists bots [--kind ai|search|social|other]
37
+ npx @trustbot/lists lists
38
+ ```
39
+
40
+ ```bash
41
+ # A Cloudflare WAF expression that matches real Googlebot and bingbot
42
+ npx @trustbot/lists ranges Googlebot bingbot --format cloudflare
43
+
44
+ # Real OpenAI crawlers for an Apache <RequireAny> block, IPv4 only
45
+ npx @trustbot/lists ranges GPTBot OAI-SearchBot ChatGPT-User --format apache --ipv4
46
+ ```
47
+
48
+ ## JavaScript
49
+
50
+ ```js
51
+ import { bots, lists, rangesFor, format, getBot, updated } from "@trustbot/lists";
52
+
53
+ rangesFor("GPTBot"); // ["4.227.36.0/25", …]
54
+ rangesFor(["ClaudeBot", "PerplexityBot"], { ipv6: false });
55
+ format(rangesFor("Googlebot"), "nginx"); // "allow 34.22.85.0/27;\n…"
56
+
57
+ getBot("Amazonbot").verify; // { ipRanges: [], rdns: ["crawl.amazonbot.amazon"], signatureAgent: null }
58
+ lists["openai-gptbot"].downloaded; // "2026-12-01"
59
+ ```
60
+
61
+ | Export | |
62
+ |---|---|
63
+ | `bots` | Every bot: `{ name, operator, kind, userAgent, verify: { ipRanges, rdns, signatureAgent }, docs }` |
64
+ | `lists` | Every IP list by id: `{ id, operator, url, downloaded, ipv4, ipv6 }` |
65
+ | `rangesFor(names, { ipv4?, ipv6? })` | The ranges of one or more bots, deduplicated |
66
+ | `format(ranges, as)` | `txt`, `json`, `nginx`, `apache`, `caddy` or `cloudflare` |
67
+ | `getBot(name)`, `canVerify(bot)` | Look one up; whether it can be verified at all |
68
+ | `updated` | When an IP list last changed |
69
+
70
+ Zero dependencies. Works in Node, Deno, Bun, browsers and edge runtimes.
71
+
72
+ ## Files
73
+
74
+ The same data, without JavaScript:
75
+
76
+ | File | |
77
+ |---|---|
78
+ | `@trustbot/lists/bots.json` | Every bot and how to verify it |
79
+ | `@trustbot/lists/ranges.json` | Every IP list, with its source URL and date |
80
+ | `@trustbot/lists/ranges/<id>.txt` | One list, one range per line, with a comment header |
81
+
82
+ From a CDN, with no install: `https://cdn.jsdelivr.net/npm/@trustbot/lists/data/ranges/openai-gptbot.txt`
83
+
84
+ ## IP lists
85
+
86
+ | Id | Operator | Ranges |
87
+ |---|---|---|
88
+ | `anthropic-claude` | Anthropic | 14 |
89
+ | `apple-applebot` | Apple | 24 |
90
+ | `commoncrawl-ccbot` | Common Crawl | 5 |
91
+ | `duckduckgo-duckassistbot` | DuckDuckGo | 486 |
92
+ | `duckduckgo-duckduckbot` | DuckDuckGo | 486 |
93
+ | `google-common-crawlers` | Google | 317 |
94
+ | `google-special-crawlers` | Google | 272 |
95
+ | `google-user-triggered-fetchers` | Google | 1096 |
96
+ | `google-user-triggered-fetchers-google` | Google | 504 |
97
+ | `microsoft-bingbot` | Microsoft | 29 |
98
+ | `mistral-user` | Mistral AI | 4 |
99
+ | `openai-chatgpt-user` | OpenAI | 367 |
100
+ | `openai-gptbot` | OpenAI | 18 |
101
+ | `openai-searchbot` | OpenAI | 39 |
102
+ | `perplexity-perplexitybot` | Perplexity | 21 |
103
+ | `perplexity-user` | Perplexity | 10 |
104
+
105
+ Ids never change, so file paths stay stable. Every list is downloaded from the operator's own published URL; nothing is collected or guessed.
106
+
107
+ ## Freshness
108
+
109
+ A GitHub Action downloads every list each Monday. When one changes, it opens a pull request, and a patch release follows. IP lists change rarely, but they do change, so update this package regularly, or use [trustbot](https://www.npmjs.com/package/trustbot), which refreshes them at runtime.
110
+
111
+ ## License
112
+
113
+ MIT © CK Giri. The IP ranges are published by their operators.