AS Rank v2.1 Released (RESTFUL/Historical/Cone)

May 13th, 2020 by Bradley Huffaker
ASRankv2.1

(GraphQL/RESTFUL)

Responding to feedback from our user community, CAIDA has released version 2.1 of the AS Rank API. This update helps to reduce some of the complexity of the full-featured GraphQL interface through a simplified RESTful API.

AS Rank API version 2.1 adds support for historical queries as well as support for AS Customer Cones, defined as the set of ASes an AS can reach using customer links. You can learn more about AS relationships, customer cones, and how CAIDA sources the data at https://asrank.caida.org/about.

You can find the documentation for AS Rank API version 2.1 here https://api.asrank.caida.org/v2/restful/docs.

You can find documentation detailing how to make use of historical data and customer cones here https://api.asrank.caida.org/v2/docs.

CAIDA Team

2 Responses to “AS Rank v2.1 Released (RESTFUL/Historical/Cone)”

  1. Michel Ramírez Says:

    Dear AS Rank,

    I’m trying to request the historical data with your API via Python and Requests library. When I make the request from 2013-12-01 to 2020-06-01. The most recent data that I received is from 2020-01-01. Please indicate to me if I need to make another type of request to obtain the most recent data.

    Python code:
    import requests
    def send_trigger(message, url):
    #headers = {‘Content-type’: ‘application/json’}
    response = requests.post(url=url, json=message)

    return response.json()

    URL = “https://api.asrank.caida.org/v2/graphql”
    date = “2013-12-01”
    date2= “2020-06-01”
    payload ={“query”: “{ asns(asns:[\”701\”], dateStart:\”” + date + “\”, dateEnd:\”” + date2 + “\”) {edges{node{asn,rank,date}}}}” }
    print(payload)
    print(send_trigger(payload,URL))

    Result:
    {‘data’: {‘asns’: {‘edges’: [{‘node’: {‘asn’: ‘701’, ‘rank’: 13, ‘date’: ‘2013-12-01’}}, …
    {‘node’: {‘asn’: ‘701’, ‘rank’: 21, ‘date’: ‘2020-01-01’}}]}}}

  2. Bradley Huffaker Says:

    You should be able to access historic data with the following query:

    {
    	asns(dateStart:"20180101", dateEnd:"20180201",asns:["3356"]) {
        edges {
          node {
            date
            asn
            asnDegree {
              total
            }
          }
        }
      }
    }

Leave a Reply