> ## Documentation Index
> Fetch the complete documentation index at: https://docs.querying.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AliExpress API

> 搜索 AliExpress 的商品，以 JSON 获取结果：按商城显示的顺序返回商品排名、价格和评分。

通过异步任务 API 搜索 AliExpress（aliexpress.com）的商品。发送 `COMMERCE_SERP` 并设置 `site` `aliexpress`，按商城的顺序获取搜索结果中的商品。`COMMERCE_PRODUCT` 不读取这家商城的商品页面。每次完成的搜索消耗 **0.5 积分**。

## 搜索

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "COMMERCE_SERP", "payload": { "site": "aliexpress", "query": "wireless earbuds", "limit": 3 } }'
```

提交任务后，轮询 `GET /v1/async/task/{id}` 或通过 webhook 接收。参见[异步任务](https://docs.querying.ai/zh/concepts/async-tasks.md)。

### 参数

* `site`：必填。值为 `aliexpress`。
* `query`：必填。搜索词，1-500 个字符。
* `limit`：可选整数，范围 1-40，默认 20。
* `country`：可选。默认是商城所在国家 `US`。其他国家会以 `422 REGION_UNSUPPORTED` 拒绝。

仅接受上方列出的载荷字段。请省略 `include`：即使是 `include: {}`，也会在冻结积分前返回针对 `payload.include` 的 `422 VALIDATION_ERROR`。

### 响应示例

```json theme={"theme":"css-variables"}
{
  "site": "aliexpress",
  "query": "wireless earbuds",
  "country": "US",
  "returnedCount": 3,
  "products": [
    {
      "rank": 1,
      "productId": "3256813273775472",
      "title": "Wireless Earbuds, Bluetooth 5.4 Earbuds Stereo Bass, Bluetooth Headphones in Ear Noise Cancelling Mic, Earphones IP7 Waterproof Sports, 36H Playtime USB C Mini Charging Case Ear Buds for Android iOS",
      "url": "https://www.aliexpress.com/item/3256813273775472.html",
      "price": 13.95,
      "currency": "USD",
      "imageUrl": "https://ae-pic-a1.aliexpress-media.com/kf/Seafc726f8c6247c48e492e80361dbb0ah.jpg"
    },
    {
      "rank": 2,
      "productId": "3256811621288203",
      "title": "2026 New Air 3【 Pro3 】 Bluetooth Wireless Earbuds With Heart Rate Monitoring, Active Noise Cancellation Headphones, Waterproof for Daily Use, For IPhone IOS Smartphone, Gaming /Sports /Fitness Earphones.",
      "url": "https://www.aliexpress.com/item/3256811621288203.html",
      "price": 13.25,
      "currency": "USD",
      "rating": 4.9,
      "imageUrl": "https://ae-pic-a1.aliexpress-media.com/kf/Sa57a4580c1274b01988d5df3fa8e76cbx.jpg"
    },
    {
      "rank": 3,
      "productId": "3256813271161904",
      "title": "Smart Touch Control True Wireless Earbuds, Active Noise Cancelling, Portable Mini Charging Case Easy To Carry, Low Latency For Gaming, Long Battery Life, Instant Connection, Spatial Audio, Ergonomic In-Ear Comfort Fit, Air Bluetooth Headphones.",
      "url": "https://www.aliexpress.com/item/3256813271161904.html",
      "price": 27.39,
      "currency": "USD",
      "imageUrl": "https://ae-pic-a1.aliexpress-media.com/kf/S9675a1dc8aa545959180535f79ea4ddd2.jpg"
    }
  ]
}
```

### 结果字段

* `site`、`query` 和 `country` 回显请求。`returnedCount` 是 `products` 中的商品数。
* 每个商品包含 `rank`、`productId`、`title` 和 `url`。`productId` 是商城自己的商品 ID。`rank` 遵循商城的默认排序，商城标为广告的商品会被跳过。
* 搜索结果页显示时返回 `price`、`rating` 和 `imageUrl`。`price` 是以商品的 `currency`（ISO 4217）计的数字；不同规格分别定价时，取最低价。 AliExpress 的价格是向未登录的美国买家显示的促销价。
* `rating` 为五分制。 AliExpress 只显示星级、不显示评价数，因此其商品没有 `reviewCount`。
* 每次搜索从商城搜索结果的第一页获取商品。

## 错误与计费

* 没有返回任何商品的搜索以失败任务结束。
* 只对完成的搜索计费，每次 0.5 积分。

## 相关

* [Amazon](https://docs.querying.ai/zh/engines/amazon.md)
* [Walmart](https://docs.querying.ai/zh/engines/walmart.md)
* [Target](https://docs.querying.ai/zh/engines/target.md)
* [全部 Commerce 商城](https://docs.querying.ai/zh/engines/overview.md#commerce)
* [积分与限制](https://docs.querying.ai/zh/concepts/credits-and-limits.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.