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 odpor
Install via git clone
$ git clone https://github.com/kalinchernev/odp.git
$ cd odp
$ npm installREST 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 testCheck whether modifications are acceptable:
$ npm run lintMIT license. See the LICENSE file for details.