This library allows to create and execute SDMX REST queries using JavaScript.
In a nutshell, you can:
- Create data, metadata, availability and schema queries;
- Access various SDMX web services, with the
getService
function; - Execute a query against a web service, with the
request
function; - Translate queries into URLs, with the
getUrl
function. This is handy, in case you want to execute the query using, say, jQuery;
The example below shows how to execute a query against the ECB service, with the request
function.
var sdmxrest = require('sdmx-rest');
var query = {flow: 'EXR', key: 'A.CHF.EUR.SP00.A'};
sdmxrest.request(query, 'ECB') // ECB is one of the predefined services
.then(function(data) {console.log(data)})
.catch(function(error){console.log("something went wrong: " + error)});
This library is compliant with both SDMX 2.1 and SDMX 3.0.
For more information and examples, check the Wiki.