REST API

The API permits to easily fetch results displayed on the Internet Health Report.

Format

Two formats are available, HTML and JSON. The HTML format allows developpers to easily play with the API. The JSON format provides a programmatic access to our reports. The results are formatted in HTML if you access the API with your web browser, JSON is used otherwise.

Endpoints

The API is accessible at http://romain.iijlab.net/ihr/api/ and there is six endpoints available:
  • congestion: Overall delay change observed for an ASN.
  • congestion_alarms: Details of links with reported delay change.
  • forwarding: Overall forwarding anomaly score reported for an ASN.
  • forrwarding_alarms: Details of routers for identified forwarding anomalies.
  • disco_event: Network disconnections observed for an ASN or country.
  • disco_probes: Disconnected probes identified in a disco_event

Filtering

You can filter your search by adding parameters in the URL. For example, http://romain.iijlab.net/ihr/api/congestion/?asn=174 returns congestion results only for AS174.

There is mainly two operators. The equal, '=', is for exact match, and, the caret, '^', permits to select values that start with a certain pattern. For example, http://romain.iijlab.net/ihr/api/congestion/?asn=174&timebin^2016-06-01 returns congestion results for AS174 on June 1st.

Scripting

This is a python example to fetch the latest congestion results for AS174 on June 1st:
import sys
import requests

url = "http://romain.iijlab.net/ihr/api/congestion/?asn=174&timebin^2016-06-01"

resp = requests.get(url)
if (resp.ok):
    data = resp.json()
    print(data)
else:
    resp.raise_for_status()