1.3.1 • Published 5 years ago
open-icecat v1.3.1
Install
Install with npm:
$ npm i open-icecatDeclaration & 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.