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://ihr.iijlab.net/ihr/api/ and there is six endpoints available:
  • delay: Overall delay change observed for an ASN.
  • delay_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_events: 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:

You can also filter results using inequalities. Add the suffix '_gte' and '_lte' for 'greater than or equal' and 'less than or equal'. For example, http://ihr.iijlab.net/ihr/api/delay/?asn=174&timebin__gte=2017-06-01T00:00&timebin__lte=2017-07-01T00:00 returns delay change results for AS174 on June 2017.

Scripting

This is a python example to fetch the latest delay change results for AS174 on June 2017:
import sys
import requests

url = "http://ihr.iijlab.net/ihr/api/delay/?asn=174&timebin__gte=2017-06-01T00:00&timebin_lte=2017-07-01T00:00"

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