https://asn.ipinfo.appAll errors return JSON with error, request, and status fields.
{
"error": "We can't find a result for your query.",
"request": "99999",
"status": 404
}| Parameter | Type | Description |
|---|---|---|
| {asn} | integer | AS number in the URL path. Accepts bare integer (13335) or AS-prefixed (AS13335). |
GET /api/json/details/AS13335{
"asn": 13335,
"name": "CLOUDFLARENET - Cloudflare",
"iprec": 5600,
"v4size": 1476096,
"v6size": 78455046144,
"smaskv4": { "24": 2240, "20": 167, ... },
"smaskv6": { "48": 5200, "32": 8, ... },
"announced": {
"prefixes_v4": 36,
"prefixes_v6": 2,
"addresses_v4": 12032,
"rib_ts": "2026-11-10T00:00:00Z"
}
}Note: v6size is counted in /64 equivalents. The time field from the legacy API has been removed. iprec/v4size/smaskv4 are attributed by the IP-to-ASN range data (iptoasn) — not observed BGP origination — and can differ from what BGP shows the AS originating (issue #297). announced is the observed-BGP view from Atlas's latest RIB snapshot: prefixes_v4, prefixes_v6, addresses_v4 (numbers) and rib_ts (snapshot timestamp); null when unknown.
AS prefix) does a direct lookup; anything else does a case-insensitive partial match on the org name. Returns up to 25 results.| Parameter | Type | Description |
|---|---|---|
| search | string | Org name, IP address (1.1.1.1), or AS number (13335 / AS13335). |
GET /api/json/search/?search=cloudflare GET /api/json/search/?search=1.1.1.1 GET /api/json/search/?search=AS13335
[
{ "asn": 13335, "name": "CLOUDFLARENET - Cloudflare" },
{ "asn": 209242, "name": "CLOUDFLARE-WARP" }
]example.com?" without needing to run dig + a follow-up ASN search yourself. Reserved or non-public TLDs (.local, .internal, .test, .example, etc.) are refused.| Parameter | Type | Description |
|---|---|---|
| {domain} | string | Public hostname (e.g. cloudflare.com). Also accepts ?domain= as a query parameter. |
GET /api/json/domain/cloudflare.com{
"domain": "cloudflare.com",
"addresses": [
{
"ip": "104.16.132.229",
"version": 4,
"asn": 13335,
"name": "CLOUDFLARENET",
"kind": "hosting",
"country_code": "US",
"country": "United States",
"location": { "countryCode": "US", "city": "San Francisco", "source": "geofeed", ... }
},
...
],
"asns": [
{ "asn": 13335, "name": "CLOUDFLARENET", "kind": "hosting",
"ips": ["104.16.132.229", ...] }
]
}Cached server-side for 1 hour. IPs that don't map to a known ASN (private space, unannounced blocks) are still returned in addresses with asn: null; only public ASNs appear in the deduplicated asns array.
country_code / country are the registration country of the announcing AS (iptoasn.com via Atlas) — not necessarily where the address is: hosting, anycast and multinational networks differ (OVH’s German data centres read FR). location is where the address physically is, or null when Atlas has no answer: countryCode, country, region, city, latitude, longitude, accuracyKm (rough radius; null for a country-level answer), source (override | geofeed | registry | rdns | baseline), sourceLabel (the same in plain words, e.g. “DB-IP estimate”), confidence (verified | high | medium | low) and attribution — the DB-IP City Lite credit (CC BY 4.0), which you must show wherever you show this data. The same location object appears under atlas on /api/json/ip/. Full evidence per address: https://atlas.ipinfo.app/api/v2/geo/{ip}.
{
"ip": "1.1.1.1",
"asn": 13335,
"name": "CLOUDFLARENET - Cloudflare"
}GET /api/json/list/AS13335 ↳ JSON { name, type, list } GET /api/text/list/AS13335 ↳ plain text, one CIDR per line GET /api/download/list/AS13335 ↳ download as list_13335.txt
{
"name": "CLOUDFLARENET - Cloudflare",
"type": "ipList",
"list": [
"104.16.0.0/12",
"172.64.0.0/13",
"2606:4700::/32",
...
]
}{asn} with a bare integer (13335) or AS-prefixed form (AS13335)./api/json/<format>/{asn} — JSON envelope { name, type, list } where list is an array of config strings/api/text/<format>/{asn} — plain text, one line per entry/api/download/<format>/{asn} — plain text with Content-Disposition: attachment for direct file downloadThe
raw format is JSON-only (no text or download variant).{asn} may also be an IRR as-set such as AS-CLOUDFLARE or AS13335:AS-CLOUDFLARE — see IRR as-set source.All firewall formats return aggregated prefix lists (the bgp-* router-filter formats deliberately do not). BGP routing tables often contain disaggregated announcements — a single logical block split into many smaller prefixes for traffic engineering. We collapse adjacent and overlapping CIDRs into the minimal covering set so you get fewer, cleaner firewall rules. The aggregation is lossless: we never add addresses that aren't actually announced by the AS.
ipset hash:net commands. Creates two named sets — {asn}-4 (inet/IPv4) and {asn}-6 (inet6/IPv6) — then adds every prefix to the appropriate set. Suitable for use with iptables -m set --match-set.GET /api/json/ipset/AS13335 ↳ JSON { name, type, list } GET /api/text/ipset/AS13335 ↳ plain text, one command per line GET /api/download/ipset/AS13335 ↳ download as ipset_13335.txt
{
"name": "CLOUDFLARENET",
"type": "ipset",
"list": [
"ipset -N 13335-4 hash:net family inet",
"ipset -N 13335-6 hash:net family inet6",
"ipset -A 13335-4 104.16.0.0/12",
"ipset -A 13335-4 172.64.0.0/13",
"ipset -A 13335-6 2606:4700::/32",
...
]
}iptables INPUT DROP rules. IPv4 prefixes use iptables; IPv6 prefixes use ip6tables. Append directly to your existing INPUT chain.GET /api/json/iptables/AS13335 GET /api/text/iptables/AS13335 GET /api/download/iptables/AS13335 ↳ iptables_13335.txt
{
"name": "CLOUDFLARENET",
"type": "iptables",
"list": [
"iptables -A INPUT -s 104.16.0.0/12 -j DROP",
"iptables -A INPUT -s 172.64.0.0/13 -j DROP",
"ip6tables -A INPUT -s 2606:4700::/32 -j DROP",
...
]
}deny directives. Paste these lines into an nginx geo or map block, or directly into a location context to block all prefixes belonging to the AS.GET /api/json/nginx/AS13335 GET /api/text/nginx/AS13335 GET /api/download/nginx/AS13335 ↳ nginx_13335.txt
{
"name": "CLOUDFLARENET",
"type": "nginx",
"list": [
"deny 104.16.0.0/12;",
"deny 172.64.0.0/13;",
"deny 2606:4700::/32;",
...
]
}object network statements. IPv4 entries use dotted-decimal subnet masks; IPv6 entries use CIDR notation. Objects are named {asn}-4-SN0, {asn}-4-SN1, …, {asn}-6-SN0, …GET /api/json/cisco/AS13335 GET /api/text/cisco/AS13335 GET /api/download/cisco/AS13335 ↳ cisco_13335.txt
{
"name": "CLOUDFLARENET",
"type": "cisco",
"list": [
"object network 13335-4-SN0",
" subnet 104.16.0.0 255.240.0.0",
"object network 13335-4-SN1",
" subnet 172.64.0.0 255.248.0.0",
"object network 13335-6-SN0",
" subnet 2606:4700::/32",
...
]
}set policy-options prefix-list statements. IPv4 prefixes go into the {asn}v4 list; IPv6 prefixes go into {asn}v6.GET /api/json/juniper/AS13335 GET /api/text/juniper/AS13335 GET /api/download/juniper/AS13335 ↳ juniper_13335.txt
{
"name": "CLOUDFLARENET",
"type": "juniper",
"list": [
"set policy-options prefix-list 13335v4 104.16.0.0/12",
"set policy-options prefix-list 13335v4 172.64.0.0/13",
"set policy-options prefix-list 13335v6 2606:4700::/32",
...
]
}.htaccess deny rules using mod_access_compat (Apache 2.4+ with compatibility module). The list always starts with Order Deny,Allow.GET /api/json/htaccess/AS13335 GET /api/text/htaccess/AS13335 GET /api/download/htaccess/AS13335 ↳ htaccess_13335.txt
{
"name": "CLOUDFLARENET",
"type": "htaccess",
"list": [
"Order Deny,Allow",
"Deny from 104.16.0.0/12",
"Deny from 172.64.0.0/13",
"Deny from 2606:4700::/32",
...
]
}add commands. Silently drops all traffic to the AS by installing static blackhole routes in the kernel routing table. Also used in BGP RTBH (Remotely Triggered Black Hole) setups.GET /api/json/ipblackhole/AS13335 GET /api/text/ipblackhole/AS13335 GET /api/download/ipblackhole/AS13335 ↳ ipblackhole_13335.txt
{
"name": "CLOUDFLARENET",
"type": "ip blackhole",
"list": [
"ip route add blackhole 104.16.0.0/12",
"ip route add blackhole 172.64.0.0/13",
"ip route add blackhole 2606:4700::/32",
...
]
}del commands. Removes the static blackhole routes previously added with the ipblackhole format. Download filename uses ipblackhole_remove_ prefix to match the original PHP app convention.GET /api/json/ipblackholerem/AS13335 GET /api/text/ipblackholerem/AS13335 GET /api/download/ipblackholerem/AS13335 ↳ ipblackhole_remove_13335.txt
{
"name": "CLOUDFLARENET",
"type": "ip blackhole remove",
"list": [
"ip route del blackhole 104.16.0.0/12",
"ip route del blackhole 172.64.0.0/13",
"ip route del blackhole 2606:4700::/32",
...
]
}"FALSE" (no dotted-decimal representation). JSON-only — no /text/ or /download/ variant.GET /api/json/raw/AS13335{
"name": "CLOUDFLARENET",
"type": "raw",
"list": [
{
"ip": "104.16.0.0",
"subnetMask": "255.240.0.0",
"cidr": "12",
"type": 4
},
{
"ip": "2606:4700::",
"subnetMask": "FALSE",
"cidr": "32",
"type": 6
},
...
]
}Note: cidr is the prefix length as a string. type is 4 or 6.
IP Address, Subnet Mask, CIDR (prefix length), Type (4 or 6). IPv6 subnet masks are FALSE.GET /api/json/tsv/AS13335 GET /api/text/tsv/AS13335 GET /api/download/tsv/AS13335 ↳ tsv_13335.txt
{
"name": "CLOUDFLARENET",
"type": "tsv",
"list": [
"IP Address\tSubnet Mask\tCIDR\tType",
"104.16.0.0\t255.240.0.0\t12\t4",
"172.64.0.0\t255.248.0.0\t13\t4",
"2606:4700::\tFALSE\t32\t6",
...
]
}IP Address, Subnet Mask, CIDR (prefix length), Type (4 or 6). IPv6 subnet masks are FALSE.GET /api/json/csv/AS13335 GET /api/text/csv/AS13335 GET /api/download/csv/AS13335 ↳ csv_13335.txt
{
"name": "CLOUDFLARENET",
"type": "csv",
"list": [
"IP Address,Subnet Mask,CIDR,Type",
"104.16.0.0,255.240.0.0,12,4",
"172.64.0.0,255.248.0.0,13,4",
"2606:4700::,FALSE,32,6",
...
]
}bgpq4. Unlike the firewall formats these use the exact prefixes, not an aggregate: a filter built from an aggregate would reject the more-specifics the network really announces. One list per address family.bgp-cisco — IOS ip prefix-list / ipv6 prefix-list, cleared first; an empty family gets a deny entry because IOS treats an undefined list as permit-any.bgp-junos — policy-options prefix-list NAME-v4/-v6 (a route-filter-list with upto when max lengths apply).bgp-bird — BIRD 2 define NAME_V4 = [ ... ];, max lengths as {min,max}.bgp-plain — one prefix per line.Every output starts with comment lines naming the source and the prefix count, and a
TRUNCATED line whenever the upstream list was cut. Query options: ?af=4|6 (one family), ?name=LIST (list name, like bgpq4 -l), ?source=roa and ?rpki= (see RPKI). The JSON tree adds source, count, truncated and entries: [{prefix, max_length}].GET /api/text/bgp-cisco/AS13335 GET /api/text/bgp-junos/AS13335?af=6 GET /api/text/bgp-bird/AS13335:AS-CLOUDFLARE?name=CLOUDFLARE GET /api/download/bgp-plain/AS-FOO ↳ bgp-plain_AS-FOO.txt
! Cisco IOS prefix-list for AS2906 — announced prefixes (observed BGP) ! 519 prefixes; generated by asn.ipinfo.app from Atlas no ip prefix-list AS2906 ip prefix-list AS2906 permit 9.187.0.0/16 ip prefix-list AS2906 permit 9.187.0.0/17 ip prefix-list AS2906 permit 9.187.128.0/17 ...
# BIRD 2 prefix set for AS2906 — RPKI ROAs # 23 ROAs; generated by asn.ipinfo.app from Atlas # from ROAs: prefixes AS2906 is AUTHORISED to originate, not what it announces define AS2906_V4 = [ 9.187.0.0/16{16,24}, 9.188.0.0/16{16,24}, ...
AS-HURRICANE) or hierarchical (AS13335:AS-CLOUDFLARE), case-insensitive. The set is expanded recursively across the public IRR databases and the list is every route/route6 object whose origin is in the expansion — what bgpq4 AS-FOO builds. These are registered prefixes, not observed announcements. An unknown set answers 200 with an empty list and a comment saying so; ?af=4|6 applies. Firewall formats also get X-Prefix-Count / X-Prefix-Truncated headers. Browse a set at /lists/AS-FOO.?source=roa — the prefixes this AS's ROAs authorise, with their max length (le / upto / {min,max} in the BGP formats), instead of what it announces. Labelled "from ROAs" in the output header.?rpki=valid — only announcements that are RPKI-valid (RFC 6811).?rpki=not-invalid — drop RPKI-invalid announcements, keep the rest.ASN sources only. Answers 503 when the RPKI dataset is unavailable rather than an unfiltered list.
GET /api/text/bgp-bird/AS13335?source=roa GET /api/text/nginx/AS13335?rpki=valid GET /api/json/list/AS13335?rpki=not-invalid
| Endpoint | Was | Status |
|---|---|---|
| /api/json/archive/… | Historical CIDR snapshot for a specific timestamp | 410 |
| /api/json/archiveRaw/… | Raw archived record | 410 |
| /api/json/growth/… | IP space growth over time | 410 |
| /api/json/growthSplit/… | Growth split by IP version | 410 |
| /api/json/snapshots/… | List of available archive timestamps | 410 |
| /api/json/peersv4/… | IPv4 BGP peer list | 410 |
| /api/json/peersv6/… | IPv6 BGP peer list | 410 |
| /api/json/directPeers*/… | Direct peer adjacencies | 410 |
| /api/json/peerWordlist*/… | Peer ASN wordlists for brute-forcing | 410 |