Closed ErikHoeven closed 7 years ago
Ah yes I still need to port that package (and my blog post) to the Overheid.io API.
That might take a while, so you better use my overheid.io
package instead, like this:
const kvk = require ('overheid.io') ({
apikey: 'YOUR APIKEY',
dataset: 'kvk'
});
function output (err, data) {
console.dir (err || data, {
depth: null,
colors: true
});
}
kvk ({
params: {
'filters[handelsnaam]': 'ahold'
},
callback: output
});
Thanks for your alternative solution,
I execute the following code (based on your readme.md) in the node_module\overheid.io folder.
var openkvk = require ('overheid.io') ({
apikey: 'mijnAPI',
dataset: 'kvk'
});
openkvk ({
params: {
'filters[handelsnaam]': '*' + 'Advocaten' + '*'
},
callback: function (err, data) {
if (err) { return console.log (err) }
console.info(data.handelsnaam + ' : ' + data.plaats)
}
})
The result i get from the console is:
undefined : undefined
While i expected:
Advocaat 1 : Plaats 1
Advocaat 2 : Plaats 2
What am i doing wrong?
Manny thanks
filter
or use the query
parameter instead.plaats
in the fields
parameter to include it in the result data.data._embedded.rechtspersoon
array.openkvk ({
params: {
query: '*Advocaten*',
queryFields: ['handelsnaam'],
fields: ['plaats']
},
callback: (err, data) => {
if (err) { return console.log (err); }
if (data.totalItemCount) {
data._embedded.rechtspersoon.forEach (item => {
console.log (item.handelsnaam + ' : ' + item.plaats);
});
}
}
});
For some reason they include the country in plaats
, I think that could be a bug in their API. I have filed a report with them.
Hello i am trying to get results from the OpenKvk Node API, avalable in the npm libary. I use the example which is given on the website: https://frankl.in/code/openkvk-voor-node-js
I register on the webiste: https://overheid.io and make an API Key which delivers me a token number which i used in the code
Which provide me the folowing code:
openkvk returns the following error:
What i expected is the following result:
// Koninklijke Ahold N.V. (Zaandam) // Ahold Group Support B.V. (Zaandam) // ... On the website https://overheid.io you can see that they receive the requests:
enter image description here
What am i doing wrong?
With kind regards Erik