#Tesco NodeJS API
A simple precompiled ES6 Node wrapper to pull data from the Tesco API using Promises.
Head over to Tesco Labs Dev Portal, sign up and subscribe to the API.
###Install > npm install --save tesco
###Usage (ES5/2016)
// ES2016
import TescoAPI from 'tesco';
const Tesco = new TescoAPI('apikey');
// Require
var TescoAPI = require('tesco');
var Tesco = new TescoAPI.default('apikey');
###TescoAPI.search([Query], [Options], [Callback]);
You can pass two parameters: offset
(default: 0) and limit
(default: 10).
// ES2016
Tesco.search('Kellogs Cornflakes', { offset: 0, limit: 10 }, (err, response) => {
if (err) console.log(err);
console.log(response);
});
// ES5
Tesco.search('Kellogs Cornflakes', { offset: 0, limit: 10 }, function(err, response) {
if (err) console.log(err);
console.log(response);
});
120 calls/minute up to a maximum of 3000 calls/week.
The API is quite small at the moment and is restricted to product searches. As the API begins to expand, I will update accordingly.
I am open to pull requests/contributions! Fire them away.
###Issues If there is an issue with the returned results (i.e. broken URL's from the returned data), this is an issue with the API, not the wrapper itself. Head over to Tesco's Issues List and submit an issue there.
###License MIT