aliexpress-typescript-api
v0.2.0
Published
AliExpress API Wrapper made with Typescript and RxJS
Downloads
4
Maintainers
Readme
aliexpress-typescript-api
AliExpress API Wrapper made with Typescript and RxJS
Install
npm i aliexpress-typescript-api
Usage
let client: AliClient = new AliClient('<API_KEY>', '<LOCALE>', '<TRACKING_ID>');
let productApi = client.products;
// Get information about product by it's ID:
productApi.getById('<PRODUCT_ID>').subscribe(product => {
console.log(`"${product.productTitle}" has a price of ${product.originalPrice}`);
});
// Generate promotionlinks
const productLinks = ['https://nl.aliexpress.com/item/33055088980.html','https://nl.aliexpress.com/item/4000013160765.html'];
productApi.getPromotionLinks(productLinks).subscribe(results => {
results.promotionUrls.forEach((promotion : PromotionLink) => {
console.log(promotion.url);
});
});