I am trying to use pipl with Node.js. I have written the following code:
router.post('/httpOnly/enrich/pipl', (req, res) => {
var pipl = require('pipl')('BUSINESS-PREMIUM-DEMO-xyozhmgkc57085z7...');
pipl.search.query('json', {"email": "[email protected]"}, function(err, data) {
console.log(data);
res.json(data)
});
})
However, it gave an error:
index.js POST /httpOnly/enrich/pipl
http://api.pipl.com/search/v4/
/.../node_modules/pipl/lib/inherits.js:32
return callback(err, JSON.parse(body) || body);
^
TypeError: callback is not a function
at Request._callback (/.../node_modules/pipl/lib/inherits.js:32:28)
at Request.self.callback (/.../node_modules/request/request.js:123:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.<anonymous> (/.../node_modules/request/request.js:893:14)
at emitOne (events.js:120:20)
at Request.emit (events.js:210:7)
at IncomingMessage.<anonymous> (/.../node_modules/request/request.js:844:12)
at emitNone (events.js:110:20)
at IncomingMessage.emit (events.js:207:7)
at endReadableNT (_stream_readable.js:1059:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Does anyone know what's wrong?