open-icecat
v1.3.1
Published
Icecat API - Find product description with EAN, UPC or GTIN-13 with full typescript support
Downloads
52
Maintainers
Readme
Install
Install with npm:
$ npm i open-icecat
Declaration & Methods
class OpenIcecat {
constructor(baseParams: {});
getProduct(options: GetProductOptions);
getProductReviews(options: GetProductOptions);
getProductRelatedProducts(options: GetProductOptions);
}
Usage
1. Setup
import { OpenIcecat } from 'open-icecat';
const oc = new OpenIcecat({
username: 'your-username',
lang: 'en'
});
2. Get a Product by Brand & Product Code
(async () => {
const res = await oc.getProduct({ Brand: 'hp', ProductCode: 'RJ459AV' });
console.log(res);
})();
3. Get a Product by GTIN/EAN/UPC/JAN
(async () => {
const res = await oc.getProduct({ GTIN: '0882780751682' });
console.log(res);
})();
4. Get a Product by icecat_id
(async () => {
const res = await oc.getProduct({ icecat_id: 1198270 });
console.log(res);
})();
5. Change the language for a single request
(async () => {
const res = await oc.getProduct({ lang: 'en', Brand: 'hp', ProductCode: 'RJ459AV' });
console.log(res);
})();
License
Copyright © 2020, Tjark Kuehl Released under the MIT License.