The RIPEstat Data API is the public data interface for RIPEstat. It is the only data source for the RIPEstat widgets.
The basic URL for requesting data is:
https://stat.ripe.net/data/<name>/data.json?param1=value1¶m2=value2&...
and to get metadata for a data call, including its methodology:
https://stat.ripe.net/data/<name>/meta
Where:
Note: Data call URLs previously began with /plugin/. This will keep working for the forseable future, but /data/ should now be preferred.
To support JSON-P all RIPEstat Data API calls support a "callback" parameter. This parameter can be set to the name of the Javascript function that will be called, with the output data as its argument.
name | part of cache key? | acceptable values | default value? | description |
---|---|---|---|---|
callback | no | - | - | JSON-P callback |
preferred_version | yes | version of the data call e.g. 0.1 | current stable version |
If the desired version is not available we try to return a version that is matching the major version (e.g. "0" for "0.3"). Use the meta information of a data call to retrieve all available versions, see "Getting metadata for a data call". Magic version tags supported:
|
|
- |
|
- |
Temporarily disabled! |
These are the rules for the usage of the data API:
If you are using the API on a regular basis you can use the "sourceapp" parameter to provide a unique identifier to every data call.
This identifier helps us to assist you when you encounter any problems with the system. The identifier can be your project name or your company's.
Please drop us a short mail to stat@ripe.net with the identifier and an email address on which we can reach you. (If you include the purpose of the lookups, gold membership support is awaiting you :-)
https://stat.ripe.net/data/<datacallname>/data.json?resource=AS3333&sourceapp=<YourId>
For the format please just use alphanumeric values with no whitespace and no special characters expect for hyphens and underscores.
E.g. sourceapp=ripestat-cybersecurity-research, sourceapp=my_ripestat_id, sourceapp=as3333RIPEstat, etc.
The resulting data has a key=>value structure. Each data call has its own output fields, which are detailed in the individual sections. The common fields that are provided by every call are:
key | type | value |
---|---|---|
status | string | Indicates the status of the result of the data call. Possible values are "ok" for a successful query, "error" for unsuccessful query and "maintenance" in case the data call is undergoing maintenance. In case of an error see the messages field for details. |
status_code | integer | Same as the HTTP status code. In case of server errors the HTTP status code will be set appropriately. |
data_call_status | string |
Indicates the status of the data call. Possible values:
|
data_call_name | string | Holds the name of the data call; this is useful for our team and when only the API output is available in a support request. |
version | string | major.minor version of the response layout for this particular data call. New minor versions are backwards compatible, new major versions are not. |
cached | boolean | True/False |
message | string | human readable message if there was an error during processing. |
process_time | string | Time it took to process the request, in millisecons. If for some reason the time could not be determined then its value is "not available". |
data |
The data itself. |
The data overload prevention is to protect users, especially widgets, from getting more data than they can handle. For this
reason some data calls already support a soft-limit check which returns a warning if the output looks to be more than usual.
This prevention mechanism should only kick in if the request stems from a browser (the referrer header set), but in case
it happens for a non-browser request, it can easily suppressed by the "data_overload_limit" parameter set to "ignore".
https://stat.ripe.net/data/<datacallname>/data.json?resource=AS3333&data_overload_limit=ignore
A meta request returns additional information about a data call. A simple request to
https://stat.ripe.net/data/<name>/meta
will return the list of currently supported meta calls, like:
{ "availability": [ { "available_timelines": [ { "endtime": "2013-12-01T00:00:00", "starttime": "2008-11-01T00:00:00" } ], "id": "v4" }, { "available_timelines": [ { "endtime": "2014-01-07T00:00:00", "starttime": "2003-10-09T00:00:00" } ], "id": "v6" } ] }The "description" property is optional and provides information if this timeline describes a data island.
{ "availability": { "available_timelines": [ { "endtime": "2014-01-08T09:30:00", "starttime": "2012-01-01T00:00:00" }, ... { "description": "Mediterranean Cable Cut", "endtime": "2008-02-10T23:59:59", "starttime": "2008-01-23T00:00:00" } ] } }
https://stat.ripe.net/data/geoloc/data.json?resource=140.78/16&meta=availability
As with a Data API call it's possible to wrap the result into an JSON-P request by appending the "callback" URL parameter, e.g. for methodology
https://stat.ripe.net/data/<name>/meta/methodology?callback=callOnSuccess
Although it's still possible to use the RIPEstat Data API on a non-secure connection (ordinary HTTP) we strongly encourage using https. If there's a reason for you why you can't use HTTPS at all, please inform us since we will disable HTTP in the near future.