A simple tool to access the open icecat product information API. The Package is build with modern web technologies like fetch to have a small footprint and native performance. It also has some nice features like retrying when the request fails and some interfaces to make typescript development easier.
Install with npm:
$ npm i open-icecat
class OpenIcecat {
constructor(baseParams: {});
getProduct(options: GetProductOptions);
getProductReviews(options: GetProductOptions);
getProductRelatedProducts(options: GetProductOptions);
}
import { OpenIcecat } from 'open-icecat';
const oc = new OpenIcecat({
username: 'your-username',
lang: 'en'
});
(async () => {
const res = await oc.getProduct({ Brand: 'hp', ProductCode: 'RJ459AV' });
console.log(res);
})();
(async () => {
const res = await oc.getProduct({ GTIN: '0882780751682' });
console.log(res);
})();
(async () => {
const res = await oc.getProduct({ icecat_id: 1198270 });
console.log(res);
})();
(async () => {
const res = await oc.getProduct({ lang: 'en', Brand: 'hp', ProductCode: 'RJ459AV' });
console.log(res);
})();
Copyright © 2020, Tjark Kuehl Released under the MIT License.