3

I was scraping product details with beautifulsoup from aliexpress. But that is too slow and too much of a hassle.

So I signed up for the aliexpress API. Everything works. But how can I get the description of products using the API?

I found nothing in the help center. Google also does not have anything. I am also using

https://github.com/EitherSoft/python-aliexpress-api-client

It seems to me that it is not possible to get the description with the API? The documentation for the API is very poor imo.


Right now I am using this call:
http://gw.api.alibaba.com/openapi/param2/2/portals.open/api.listPromotionProduct/MY_API_KEY?fields=imageUrl,productId&keywords=chess&highQualityItems=yes
This call only returns the image, product id for products with the keyword "chess".
But how can I also get the description?

stovfl
  • 14,998
  • 7
  • 24
  • 51
Wramana
  • 183
  • 1
  • 4
  • 16
  • The `Get product details:` doesn't fit you need? – stovfl Aug 23 '17 at 11:33
  • Thanks for your answer. I do not quite know what you mean? Right now I am using this call: http://gw.api.alibaba.com/openapi/param2/2/portals.open/api.listPromotionProduct/MY_API_KEY?fields=imageUrl,productId&keywords=chess&highQualityItems=yes This call only returns the image, product id for products with the keyword "chess". But how can I also get the description? – Wramana Aug 23 '17 at 12:36

2 Answers2

2

Comment: how can I get the description?

The API provide the following details, there is no description.
I assume you have to get it from the productUrl.

config.py
'details': [ 'productId', 'productTitle', 'productUrl', 'imageUrl', 'originalPrice', 'salePrice', 'discount', 'evaluateScore', 'commission', 'commissionRate', '30daysCommission', 'volume', 'packageType', 'lotNum', 'validTime', 'storeName', 'storeUrl', 'allImageUrls',


Question: . I do not quite know what you mean?

What do you get using the following:

from aliexpress_api_client import AliExpress
aliexpress = AliExpress('api_key', 'affiliate_id')

#Get product details:
product = aliexpress.get_product_details(['productId', 'productTitle', 'salePrice'], product_id)
print(product)
stovfl
  • 14,998
  • 7
  • 24
  • 51
  • It returns a dictionary with the product id, the title and the price. But how can I get the description? – Wramana Aug 24 '17 at 08:34
  • I will then scrape the description from the URL.Do you maybe know how I can get the "product-ids" for the variations? – Wramana Sep 05 '17 at 08:45
  • @Wramana: Didn't you get this using `&keywords=chess`? Read [What should I do when someone answers my question?](http://stackoverflow.com/help/someone-answers) – stovfl Sep 05 '17 at 09:47
0

If you are looking for a node.js package then, I have written a scraper and made it available as an npm package. This would give you complete information about the product as JSON response. You would receive feedbacks, product images, description, product info including stock details etc.,

https://github.com/sudheer-ranga/aliexpress-product-scraper

https://www.npmjs.com/package/aliexpress-product-scraper

Install the npm package npm i aliexpress-product-scraper

Get product details:

const scrape = require('aliexpress-product-scraper');
const product = scrape('32958933105');

product.then(res => {
  console.log('Product Details JSON: ', res);
});
SpiritOfDragon
  • 1,404
  • 2
  • 15
  • 27