Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

icecat

1.3.0 • Public • Published

Icecat API

Version License Build Status Known Vulnerabilities Coverage Status

With this package you can read the worldwide product information data from Icecat. This product information comes from editors like participating manufacturers. You can use this package for comparison websites, online shopping directories or enterprise resource planning systems.

Getting started

1) Icecat account

To create a Icecat account, go to the Icecat registration page.

2) Installation

Install the Icecat Node.js package by running the following command within your project's root directory:

npm install icecat --save

3) Basic usage

const icecat = require('icecat');
 
const icecatClient = new icecat('username', 'password');
 
// Language: en, GTIN: 4948570114344 (GTIN: EAN, UPC or GTIN-13/JAN)
icecatClient.openCatalog
  .getProduct('EN', '4948570114344')
  .then(function(product) {
    console.log('Description: ' + product.getLongDescription());
 
    const productImages = product.getImages();
 
    console.log('Product images:');
    for (let i in productImages) {
      console.log(productImages[i].ThumbImg);
    }
  })
  .catch(function(reason) {
    console.error('Error or timeout', reason);
  });

Demo: https://runkit.com/greencore/icecat-demo

openCatalog

getProduct(Language, GTIN)

Arguments:

Returns: productObject

getProductById(Language, ProductId)

Arguments:

Returns: productObject

productObject

getReturnCode

  • returnCode.FAIL (-1)
  • returnCode.SUCCESS (1)

getErrorMessage
returns ErrorMessage {string}
Example: The requested XML data-sheet is not present in the Icecat database.

getName
returns Product Name {string}
Example: X4071UHSU-B1

getTitle
returns Product Title {string}
Example: iiyama X4071UHSU-B1 39.5" LED 4K Ultra HD Black public display

getReleaseDate
returns Product Release Date YYYY-MM-DD {string}
Example: 2015-10-04

getLongDescription
returns {string}

getShortDescription
returns {string}

getProductInfoPDFurl
returns {string}
Example: http://pdfs.icecat.biz/pdf/48068167-5427.pdf

getProductManualPDFurl
returns {string}

getProductUrl
returns {string}

getSupplier
returns {string}
Example: iiyama

getCategory
returns {string}
Example: public displays

getFamily
returns {object}
Example: {"id":"30340","name":"ProLite"}

getId
Get the Icecat product ID
returns {string}
Example: 29900045

getEan
Get the first EAN from the productXML
returns {string}
Example: 4948570114344

getImages
returns {array}
Example:

[
  {
    IsMain: 'Y',
    HighImg: 'http://images.icecat.biz/img/gallery/29900045_1198.jpg',
    LowImg: 'http://images.icecat.biz/img/gallery_lows/29900045_1198.jpg',
    ThumbImg: 'http://images.icecat.biz/img/gallery_thumbs/29900045_1198.jpg'
  },
  {
    IsMain: undefined,
    HighImg: 'http://images.icecat.biz/img/gallery/29900045_3889.jpg',
    LowImg: 'http://images.icecat.biz/img/gallery_lows/29900045_3889.jpg',
    ThumbImg: 'http://images.icecat.biz/img/gallery_thumbs/29900045_3889.jpg'
  },
  {
    IsMain: undefined,
    HighImg: 'http://images.icecat.biz/img/gallery/29900045_6765.jpg',
    LowImg: 'http://images.icecat.biz/img/gallery_lows/29900045_6765.jpg',
    ThumbImg: 'http://images.icecat.biz/img/gallery_thumbs/29900045_6765.jpg'
  }
];

getSpecifications
returns {array}

getMultimediaObjects
returns {Array}

About Icecat

Icecat Url
services https://icecat.biz/menu/services/index.html
product info https://icecat.biz/

License

MIT License

install

npm i icecat

Downloadsweekly downloads

22

version

1.3.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability