如何使用 API 从 Aliexpress 获取产品描述?

How to get product description from Aliexpress with API?

我正在使用 beautifulsoup 从速卖通抓取产品详细信息。但这太慢了,而且太麻烦了。

所以我注册了速卖通 API。一切正常。 但是如何使用 API 获取产品描述?

我在帮助中心什么也没找到。 Google也什么都没有。我也在用

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

在我看来,使用 API 无法获得描述? API 的文档在我看来非常糟糕。


现在我正在使用这个电话:
http://gw.api.alibaba.com/openapi/param2/2/portals.open/api.listPromotionProduct/MY_API_KEY?fields=imageUrl,productId&keywords=chess&highQualityItems=yes
此调用仅 returns 具有关键字 "chess".
的产品的图片、产品 ID 但是我怎样才能得到描述呢?

Comment: how can I get the description?

API提供以下详细信息,没有description
我假设您必须从 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?

使用以下内容你会得到什么:

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)

如果您正在寻找 node.js 包,那么我已经编写了一个 scraper 并将其作为 npm 包提供。这将为您提供有关产品的完整信息作为 JSON 响应。您会收到反馈、产品图片、描述、产品信息,包括库存详情等,

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

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

安装 npm 包 npm i aliexpress-product-scraper

获取产品详情:

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

product.then(res => {
  console.log('Product Details JSON: ', res);
});