Icecat API - Find product description with EAN, UPC or GTIN-13.
npm install icecat
npm install icecat --save
`
3) Basic usage
`js
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:
- Language: Supported language codes.
- GTIN: EAN, UPC or GTIN-13/JAN
Returns: productObject
getProductById(Language, ProductId)
Arguments:
- Language: Supported language codes.
- ProductId: ProductId from Icecat
Returns: productObject
getProductBySKU(Language, Brand, SKU)
Arguments:
- Language: Supported language codes.
- Brand: Product brand
- SKU: Product SKU from manufacturer
Returns: productObject
getProductByXMLdata (xmldata)
Arguments:
- xmlData: XML data from an Icecat XML file or XML web service
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:
`js
[
{
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}
_getCategoryFeatureGroups_
returns {Array}
Example:
`js
[
{ id: '10074', name: 'Display' },
{ id: '10080', name: 'Audio' },
{ id: '10083', name: 'Ports & interfaces' },
{ id: '10073', name: 'Weight & dimensions' },
{ id: '10081', name: 'Power' },
{ id: '10084', name: 'Operational conditions' },
{ id: '10871', name: 'Technical details' },
{ id: '10078', name: 'Packaging data' },
{ id: '10101', name: 'Other features' },
{ id: '10869', name: 'Design' },
{ id: '10870', name: 'Performance' },
{ id: '16263', name: 'Computer system' }
];
``