Je suis Charlie

Autres trucs

Accueil

Seulement les RFC

Seulement les fiches de lecture

Mon livre « Cyberstructure »

Ève

Short documentation of my BGP API

First publication of this article on 6 June 2025


I manage a small API to get information from the BGP routing protocol. This is its documentation.

The service allows you to find the current origin AS for a given IP address. The data comes from the RIS, which does not have apparently a ultra-simple API. You get more or less what can be seen by any router located on the DFZ. Here, the API is very frugal: you call https://bgp.bortzmeyer.org/IP-ADDRESS and you get a plain text reply. This is an example with curl:

% curl -i https://bgp.bortzmeyer.org/2001:500:2f::f

HTTP/2 200 
content-type: text/plain
…

2001:500:2f::/48 3557
  

So, the IP address 2001:500:2f::f is part of the prefix 2001:500:2f::/48 and is originated by AS 3557 (ISC).

If the reply is empty, it typically means the service does not have information about this address.

You can also add a prefix length at the end, after a slash.

Of course, it also works with the old version of IP:

% curl  https://bgp.bortzmeyer.org/185.71.138.138 
185.71.138.0/24 14907    
  

(originated by AS 14907, Wikimedia).

You can access information about the current knowledge of the service with a special request:

% curl  https://bgp.bortzmeyer.org/info
OK: 1038593 IPv4 prefixes, 231512 IPv6 prefixes, 84914 AS  
  

The service exists for some time now, but did not have its own documentation before june 2025. Note it can also be accessed on the fediverse by sending an IP address to @bgp@mastodon.gougere.fr (here is an example).

Version PDF de cette page (mais vous pouvez aussi imprimer depuis votre navigateur, il y a une feuille de style prévue pour cela)

Source XML de cette page (cette page est distribuée sous les termes de la licence GFDL)