Comments (3)
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
});
from nodejs-openkvk.
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
from nodejs-openkvk.
- Either don't use wildcards on
filter
or use thequery
parameter instead. - You need to specify
plaats
in thefields
parameter to include it in the result data. - This module returns the raw data object, so the results are stored in the
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.
from nodejs-openkvk.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodejs-openkvk.