Skip to content

Country Resource Stats


This endpoint returns statistics on Internet resources for a country - this includes:

  • number of ASNs seen in routing data and registration data
  • number of prefixes in routing data and registration data (split into IPv4 and IPv6)
  • amount of IPv4 space seen in routing data as well as registration data

The results can be restricted to a specific time period as well the granularity is variable but can be set explicitly.

GET /data/country-resource-stats/data.json?resource=at&starttime=2020-12-01T12:00&resolution=5m
Try it

Parameters

KeyValueInfoRequired
resource2-digit ISO-3166 country code (e.g. "at","de"...)Defines the country that the stats are returned forYES
starttimeISO8601 or Unix timestampThe start time for the query. See "Default Values for Time Parameters" for details.NO
endtimeISO8601 or Unix timestampThe end time for the query. See "Default Values for Time Parameters" for details.NO
resolutionstring representation for the resolutionPossible values:

* "5m" - 5 minutes
* "1h" - 1 hour
* "1d" - 1 day
* "1w" - 1 week
NO

Default Values for Time Parameters

StarttimeEndtimeDefaults
setnot setEndtime falls back to the lastest time data is available for
not setnot setEndtime falls back to "now", starttime defaults to beginning of 2004

Data Output

KeyInfo
statsEncaplulates the statistics valid for the times seen in the "timeline" field.
asns_ris Number of ASNs seen in routing data .
asns_stats Number of ASNs seen in registration data.
v4_prefixes_ris Number of v4 prefixes seen in routing data.
v4_prefixes_stats Number of v4 prefixes seen in registration data
v6_prefixes_ris Number of v6 prefixes seen in routing data.
v6_prefixes_stats Number of v6 prefixes seen in registration data.
stats_data Timestamp of the RIR stat file that is used for the registration data.
timeline
starttimeStart time of this validity period.
endtimeEnd time of this validity period.
query_starttimeThe start of the time the query covers.
query_endtimeThe end of the time the query covers.
latest_time & earliest_timeHolds the latest and the earliest time data is available for.
hd_latest_timeHolds the latest (most recent) time data is available for at the highest resolution (high definition)
resourceThe resource used for the query.

Code Examples

bash
curl --location --request GET "https://stat.ripe.net/data/country-resource-stats/data.json?resource=at&starttime=2020-12-01T12:00&resolution=5m"
js
const requestOptions = {
	method: 'GET',
};

fetch("https://stat.ripe.net/data/country-resource-stats/data.json?resource=at&starttime=2020-12-01T12:00&resolution=5m", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Available versions for this endpoint:

0.6
0.2 (current)