JSON API

Everything this site displays is available as JSON at the same host. No key is needed and there is no charge; there is a rate limit of roughly eight requests a second per address.

Endpoints

MethodPathReturns
GET /api/search?q={query} Resolve an AS number, address, prefix or name
GET /api/asn/{asn} Everything known about one AS
GET /api/asn/{asn}/prefixes What it announces; takes af, limit and offset
GET /api/asn/{asn}/neighbours Upstreams, peers and downstreams
GET /api/asn/{asn}/ixes Exchange ports from PeeringDB
GET /api/asn/{asn}/graph Upstream graph nodes and edges
GET /api/asn/{asn}/history Daily announcement counts
GET /api/asn/{asn}/whois Live registry record, cached for a day
GET /api/asns/top?by=cone Ranked networks; by is cone, prefixes, addresses or v6
GET /api/ip/{address} The route covering an address
GET /api/prefix/{prefix} Origins, ROAs, covering and more specific routes
GET /api/ix Exchanges; takes country, limit and offset
GET /api/ix/{id}/members Networks present on an exchange
GET /api/stats Current table size and RPKI coverage
GET /api/stats/history Table size over time
GET /api/stats/prefix-lengths?af=4 Announcements per mask length
GET /api/stats/countries Address space by country of registration
GET /api/stats/ingest When each source was last imported
GET /api/moas Prefixes announced by more than one AS
GET /api/rpki/invalid Announcements a ROA contradicts
GET /api/events Recorded prefix changes; takes kind and limit
GET /api/live/recent The most recent BGP updates held in memory
GET /api/live/stream Server-sent events: the live update feed
GET /api/live/status Whether the live stream is connected

Examples

# Which network announces an address
curl -s https://bgp.as206208.one/api/ip/1.1.1.1 | jq '.best'

# Everything about one AS
curl -s https://bgp.as206208.one/api/asn/206208

# Every prefix an AS announces, IPv6 only
curl -s 'https://bgp.as206208.one/api/asn/13335/prefixes?af=6&limit=500'

# Follow the live stream
curl -Ns https://bgp.as206208.one/api/live/stream

Notes

Responses carry Cache-Control: max-age=60. The underlying data changes when an import runs, which is every eight hours for the routing table and every four for RPKI, so polling faster than that gains nothing.

If you need bulk access to the whole table, take it from the RIS collectors directly rather than through this API -- it is the same data and you will not be rate limited.