> ## 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.

# eBay API

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

通过异步任务 API 搜索 eBay（ebay.com）的商品。发送 `COMMERCE_SERP` 并设置 `site` `ebay`，按商城的顺序获取搜索结果中的商品。`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": "ebay", "query": "wireless earbuds", "limit": 3 } }'
```

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

### 参数

* `site`：必填。值为 `ebay`。
* `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": "ebay",
  "query": "wireless earbuds",
  "country": "US",
  "returnedCount": 3,
  "products": [
    {
      "rank": 1,
      "productId": "265983500898",
      "title": "Skullcandy SESH ANC Wireless In-ear Bluetooth Earbuds (Certified Refurb)-BLACK",
      "url": "https://www.ebay.com/itm/265983500898",
      "price": 16.14,
      "currency": "USD",
      "rating": 4.5,
      "reviewCount": 76,
      "imageUrl": "https://i.ebayimg.com/images/g/YmgAAOSwdBRjH640/s-l500.jpg"
    },
    {
      "rank": 2,
      "productId": "377628519624",
      "title": "TWS Bluetooth 5.1 Earbuds Wireless Noise Cancelling Waterproof Headset",
      "url": "https://www.ebay.com/itm/377628519624",
      "price": 6.9,
      "currency": "USD",
      "imageUrl": "https://i.ebayimg.com/images/g/8HkAAeSwYV1q7y3W/s-l500.jpg"
    },
    {
      "rank": 3,
      "productId": "366736231992",
      "title": "Apple AirPods Pro 3rd Wireless Active Noise Cancelling Earbuds - White MFHP4LL/A",
      "url": "https://www.ebay.com/itm/366736231992",
      "price": 136.99,
      "currency": "USD",
      "rating": 5,
      "reviewCount": 13,
      "imageUrl": "https://i.ebayimg.com/images/g/19QAAeSw8KJq9UoX/s-l500.jpg"
    }
  ]
}
```

### 结果字段

* `site`、`query` 和 `country` 回显请求。`returnedCount` 是 `products` 中的商品数。
* 每个商品包含 `rank`、`productId`、`title` 和 `url`。`productId` 是 eBay 商品编号。`rank` 遵循商城的默认排序，商城标为广告的商品会被跳过。
* 搜索结果页显示时返回 `price`、`rating`、`reviewCount` 和 `imageUrl`。`price` 是以商品的 `currency`（ISO 4217）计的数字；不同规格分别定价时，取最低价。
* `rating` 为五分制。像 999+ 这样的缩写评价数不会返回。
* 每次搜索从商城搜索结果的第一页获取商品。

## 错误与计费

* 没有返回任何商品的搜索以失败任务结束。
* 只对完成的搜索计费，每次 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.