Services
getService(parameters)
Overview
This function creates a pointer to an SDMX REST service.
It takes either a String or an Object as parameter.
If it is a String, it must be the identifier of a predefined service (see the list below).
If it is an Object, the expected properties are:
url- the entry point of the SDMX serviceid(optional) - an identifier for the servicename(optional) - a label for the serviceapi(optional) - the version of the SDMX API offered by the service (default:latest)
Examples
Get a predefined service:
sdmxrest.getService("ECB");
In case the desired service is not already predefined, an object describing that service can be used instead:
sdmxrest.getService({ url: "http://ws-entry-point" });
Error handling
The function throws an error when:
- The supplied string is not the ID of a predefined service
- Or the supplied object does not contain a valid url property.
Predefined services
The library offers shortcuts to the following services:
| ID | Provider | Comment |
|---|---|---|
BIS |
Bank for International Settlements | |
ECB_S |
European Central Bank | Use ECB in case you don’t need access over https (not recommended!) |
EUROSTAT |
European Statistical Office (Eurostat) | This channel does not support https. |
OECD_S |
Organisation for Economic Co-operation and Development | Use OECD in case you don’t need access over https (not recommended!). |
SDMXGR_S |
SDMX Global Registry | Use SDMXGR in case you don’t need access over https (not recommended!). |
UNICEF |
UNICEF | |
WB |
World Bank |
You can get the list of supported services via the services array:
sdmxrest.services;