Promise based wrapper for the Cortical.io Retina API
npm install cortical --save
Create a new client instance
const Cortical = require('cortical');
const client = new Cortical({ key: YOUR_API_KEY });
Send a GET request
client.get('terms', { term: text })
.then(result => console.log(result));
// [
// {
// "term": ...,
// ...
// }
// ]
Send a POST request
client.post('text', text)
.then(result => console.log(result));
// [
// {
// "positions": [...]
// }
// ]
Get a fingerprint for a text
client.getFingerprint(text)
.then(result => console.log(result));
// [2,3,65,66...]
Get fingerprints for an array of texts
client.getFingerprints(texts)
.then(results => console.log(results));
// [
// [2,3,65,66...],
// ....
// ]