Giter VIP home page Giter VIP logo

open-icecat's Introduction

Open Icecat Logo

 

Issues Last Commit License

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

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.

open-icecat's People

Contributors

dependabot[bot] avatar imgbotapp avatar tjark-kuehl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.