AS Rank API
(
[doc]
)
CAIDA's AS Rank project has been analyzing macroscopic
Internet topology for over 20 years, working to improve the integrity and
utility of the relationship-based Autonomous Systems (AS) ranking by using vantage points, active probing,
cross-validation in conjunction with other sources of data, and powerful data
processing techniques to support large topology samples.
The AS Rank API allows users to query for CAIDA's ranking of Autonomous Systems (AS) (which approximately map to Internet Service Providers),
organizations (Orgs) (a collection of one or more ASes),
relations among them and other topological data. The API does not provide non-topological data like traffic, revenue, users or
other. The ranking is derived from topological data collected by CAIDA's Archipelago
Measurement Infrastructure and Border Gateway Protocol (BGP) routing data collected by the Route Views Project and RIPE NCC. For more information about the detection methodology see
the AS Rank About page.
The AS Rank API has been designed to allow users to query for
subsets of macroscopic Internet topology data. Instead of retrieving the entire AS Rank database, users often have
interest in specific subsets of the data. For instance, users may seek only for
specific Autonomous System(s) (by id or name) or Organization(s) (by id or
name), or data generated during specific periods of time or for a specific
country. In fact, we highly recommend that users use the available filter
parameters to limit the number of results returned by the API.
The AS Rank API provides a RESTful API for CAIDA's AS Rank service. The current version 2 of the API is based on the Symfony 4 PHP web application
framework and the PostgreSQL database back-end. The API Examples below may show lower
default per-page counts than the default of 500 (or
5000 maximum). We update the AS Rank data monthly.
We describe different ways to retrieve various
subset(s) of AS Rank data below. For a
detailed technical description of the API endpoints, parameters and responses, please refer to the auto-generated Swagger (OpenAPI) Documentation.
Please send your questions and comments to asrank-feedback@caida.org.
Retrieving ordered lists of Autonomous Systems (ASes)
Information
for all (any) ASNs can be retrieved by default asn
route:
/asns
Below
are example filter parameters to use with this route.
- First page with default
per-page
/asns
{ "total": 86622, "data": [ "3356", "1299", "174", "2914" ] }
/asns?page_number=2
{ "total": 86622, "data": [ "3257", "6762", "6453", "6939" ] }
/asns?page_size=8
{
"total": 86622,
"data": [ "3356", "1299", "174", "2914", "3257", "6762", "6453", "6939" ]
}
- Change sorting (rank [default],
transit_degree, customer_cone_asns,
customer_cone_prefixes, customer_cone_addresses)
/asns?sort=transit_degree
{ "total": 86622, "data": [ "6939", "174", "3356", "37468" ] }
/asns?page_number=4&page_sizecount=4
{ "total": 86622, "data": [ "3257", "6762", "6453", "6939" ] }
/asns?sort=-transit_degree
{ "total": 86622, "data": [ "11", "15", "23", "28" ] }
- Verbose (can be
combined with other query parameters)
/asns?verbose
{
"total": 86622,
"data": [
{
"cone": { "asns": 32759, "prefixes": 238712, "addresses": 795625728 },
"latitude": "36.6367665181695",
"longitude": "-92.3312241433131",
"degree": {
"globals": "5381",
"peers": 293,
"siblings": 8,
"customers": 5088,
"transits": 5396
},
"name": "LEVEL3",
"source": "ARIN",
"clique": "true",
"country_name": "United States",
"rank": "1",
"org": { "name": "Level 3 Parent, LLC", "id": "LPL-141-ARIN" },
"id": "3356",
"country": "US"
},
{
"cone": { "prefixes": 265611, "addresses": 895203584, "asns": 28902 },
"latitude": "59.9719858021065",
"longitude": "-10.1798521440613",
"degree": {
"transits": 2134,
"peers": 286,
"globals": 2135,
"customers": 1849
},
"name": "TELIANET",
"source": "RIPE",
"clique": "true",
"country_name": "European Union",
"rank": "2",
"org": { "id": "ORG-TCA23-RIPE", "name": "Telia Company AB" },
"id": "1299",
"country": "EU"
},
{
"cone": { "prefixes": 233340, "addresses": 908840704, "asns": 26664 },
"latitude": "42.0543027573296",
"longitude": "-83.2940907486633",
"degree": {
"transits": 5808,
"globals": "5806",
"peers": 253,
"customers": 5553,
"siblings": 2
},
"name": "COGENT-174",
"source": "ARIN",
"clique": "true",
"country_name": "United States",
"rank": "3",
"org": { "id": "COGC-ARIN", "name": "Cogent Communications" },
"id": "174",
"country": "US"
},
{
"cone": { "asns": 24578, "addresses": 657442048, "prefixes": 212139 },
"latitude": "44.6569142112426",
"longitude": "-98.8232455443852",
"degree": {
"siblings": 6,
"customers": 1897,
"peers": 483,
"globals": "2380",
"transits": 2381
},
"name": "NTT-COMMUNICATIONS-2914",
"source": "ARIN",
"clique": "true",
"country_name": "United States",
"rank": "4",
"org": { "name": "NTT America, Inc.", "id": "NTTAM-1-ARIN" },
"id": "2914",
"country": "US"
}
]
}
Finding Autonomous Systems (AS) By ID or Name
The API
allows users to specify which Autonomous Systems they seek.
For
example, the following GET request will return information about AS 3356
generated for the latest month:
GET
- Info about a specific ASN
/asns/3356
{
"data": {
"cone": { "asns": 32759, "prefixes": 238712, "addresses": 795625728 },
"latitude": "36.6367665181695",
"longitude": "-92.3312241433131",
"degree": {
"globals": "5381",
"peers": 293,
"siblings": 8,
"customers": 5088,
"transits": 5396
},
"name": "LEVEL3",
"source": "ARIN",
"clique": "true",
"country_name": "United States",
"rank": "1",
"org": { "name": "Level 3 Parent, LLC", "id": "LPL-141-ARIN" },
"id": "3356",
"country": "US"
}
}
Finding Relations among Autonomous systems
The AS Rank
API allows a user to retrieve a list of links
(relations) involving the given ASN.
/asns/:asn(\d+)/links
GET
- Links involving
given ASN
/asns/3356/links
{
"data": [
{
"relationship": "peer",
"asn": 1299,
"locations": [ "Atlanta-GA-US" ],
"paths": 315235
},
{
"relationship": "peer",
"asn": 174,
"locations": [ "Atlanta-GA-US" ],
"paths": 289755
},
{
"relationship": "peer",
"asn": 2914,
"locations": [ "Aliso Viejo-CA-US" ],
"paths": 274114
},
{
"relationship": "peer",
"asn": 3257,
"locations": [ "Atlanta-GA-US" ],
"paths": 231627
}
],
"total": 5381
}
Retrieving
lists of Organizations by name or id
The AS Rank
API allows a user to retrieve a list of organizations
by id or name.
·
/orgs/by-name/:search([^/]+)
GET
·
Search for an organization by name
/orgs/by-name/level
{
"total": 70,
"data": [
"ORG-LC4-RIPE",
"ORG-PT2-AP-APNIC",
"NXLI-ARIN",
"CLEVEL-2-ARIN",
"CMSD-ARIN",
"@aut-132364-APNIC",
"ORG-NA203-RIPE",
"ORG-CMIL1-AP-APNIC",
"TFSLAC-7-ARIN",
"@aut-45842-APNIC",
"@aut-45872-APNIC",
"ORG-CAPL4-AP-APNIC",
"@aut-131225-APNIC",
"ORG-LSL16-RIPE",
"ORG-NLBS1-RIPE",
"@aut-11415-LACNIC",
"ORG-CBG1-AP-APNIC",
"ORG-UEMG1-AP-APNIC",
"ORG-TUOM1-AP-APNIC",
"ORG-LDL3-RIPE",
"@aut-28588-LACNIC",
"CSUCS-ARIN",
"@aut-55443-APNIC",
"LPL-141-ARIN",
"ORG-LSPL3-AP-APNIC",
"ORG-LNS8-RIPE",
"@aut-55876-APNIC",
"@aut-45419-APNIC",
"7THLEV-ARIN",
/orgs/:org([^/]+)
GET
·
Information about an organization by ID
/orgs/LPL-141-ARIN
{
"data": {
"id":
"LPL-141-ARIN",
"members": [
"3356",
"3549",
"10753",
"202",
"30686",
"18756",
"7911",
"1",
"2551",
"11213",
"189",
"199",
"200",
"201",
"203",
"279",
"281",
"524",
"560",
"594",
"595",
"596",
"597",
"598",
"6395",
"7176",
"8043",
"16852",
"19094",
"19591",
"19962",
"20476"
],
"country": "US",
"number_members_ranked":
"10",
"cone": {
"addresses": 798662912,
"prefixes": 240762,
"asns":
32913,
"orgs": 30235
},
"degree": {
"asn": { "transit": 7287,
"global": 7300 },
"org":
{ "transit": 6731, "global": 6744 }
},
"country_name":
"United States",
"name": "Level 3 Parent,
LLC",
"rank": "1",
"number_members":
"32"
}
}