This project is a simple node.js wrapper for the European Union Open Data Portal REST API. The wrapper does not aim to replace any of the existing services and websites, but rather encourage more integrations. The module is a helper in building web apps requesting data from the portal.
Install via npm.
$ npm install odp
or
Install via git clone
$ git clone https://github.com/kalinchernev/odp.git
$ cd odp
$ npm install
REST API service: EU OPD developers' corner
Learn more about EU Open Data Portal
var odp = require('odp');
// Get list of all datasets.
odp.getDatasets()
.then(data => console.log(data))
// Get a range of the list of datasets:
odp.getDatasets({query: {limit: 100, offset: 1}})
.then(data => console.log(data))
// Get all tags:
odp.getTags()
.then(data => console.log(data))
// Search through tags:
odp.getTags({
query: {
vocabulary_id: 'some_id',
all_fields: true
}
})
.then(data => console.log(data))
// Get details about a dataset:
odp.getDataset({body: {id: 'dgt-translation-memory'}})
.then(data => console.log(data))
// Search for a dataset:
odp.datasetSearch({body: {q: 'forest'}})
.then(data => console.log(data))
Run all tests
$ npm test
Check whether modifications are acceptable:
$ npm run lint
MIT license. See the LICENSE file for details.