> ## Documentation Index
> Fetch the complete documentation index at: https://agent-traffic.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# loadIpRanges

> Download operators' published IP ranges for verification.

```ts theme={null}
loadIpRanges(fetch?: typeof globalThis.fetch): Promise<IpRanges>
```

Downloads every IP range file listed in the dataset and returns them keyed by URL, each with its CIDRs and creation date. Pass the result to [`classify`](https://agent-traffic.mintlify.site/reference/classify) as `ipRanges`.

**fetch** `typeof fetch` (default: globalThis.fetch)

A custom `fetch` implementation, for proxies or tests.

* **When to call it:** call it once, then refresh about daily in long-running processes.
* **Failed files:** a file that fails to download or contains no ranges is skipped. Requests from that operator then come back unverified rather than flagged.
* **Cloudflare Workers:** call it inside the request handler, not at module scope, and cache the promise so concurrent requests share one download.

```js theme={null}
let ipRanges

async function handle(request) {
  ipRanges ??= loadIpRanges()
  return classify({ headers: request.headers, ip: request.headers.get('cf-connecting-ip') }, { ipRanges: await ipRanges })
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.