# eBay 关键词搜索 API (ebay.search)

- Canonical page: https://everyinfra.com/ebay-api/search
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "ebay", "action": "search", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 50 per call
- Mode: sync; add "mode": "async" for slow tasks

eBay 关键词搜索按 `keyword` 找在售商品，每条返回商品 ID `item_id`、标题、链接、价格 `price`、成色 `condition`、运费说明 `shipping`、卖家 `seller` 和抓取时间 `scraped_at`。拍卖类价格变化快，用 `scraped_at` 判断数据新不新；在售价格是挂牌价，不是成交价。

`sold_only` 设为 true 就只请求已售出的商品。`min_price` 和 `max_price` 圈价格区间，不要假定运费或税费已包含在内。查某个卖家名下的在售商品，用店铺那一页，不用关键词搜索。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=ebay&action=search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | search 的在售商品搜索词；sold 的已结束/售出商品搜索词。两者的价格含义不同，不把挂牌价当作实际成交价。 |
| condition | not declared | no | not declared | search 的商品成色条件，保留大小写和空格：New 全新、Used 二手、Refurbished 翻新、For parts or not working 零件或故障品。它不是正面/负面评价筛选。 |
| country | not declared | no | not declared | domain 的兼容输入，同样接收 ebay.com 等站点域名，不是 US/DE 国家码；domain 同时存在时优先 domain。 |
| domain | not declared | no | not declared | eBay 站点域名，例如 ebay.com、ebay.de、ebay.co.uk，不带协议或路径，默认 ebay.com；search/store/reviews 使用它构造页面地址。 |
| max_price | not declared | no | not declared | search 商品价格上限，数值，与 min_price 配合限定范围；不要将运费或税费假定为已包含。 |
| min_price | not declared | no | not declared | 商品价格下限，数值；search 指搜索列表价格，sold 指已结束/售出列表价格，币种以站点及记录为准，不是 API 计费金额。sold 按整数筛选，带小数时向下取整。 |
| sold_only | not declared | no | not declared | search 的布尔开关，true 仅请求已售出商品，false 不启用。使用 JSON 布尔值，不要传字符串 false。 |
| limit | integer (1–50) | no | 20 | 这次调用最多返回的条数，整数，1–50；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| item_id | 商品 ID。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| url | 该记录在原平台上的可访问链接。 |
| price | 价格数值，不含货币符号；币种见 currency。 |
| price_text | 价格的原始展示文本，可能是区间。 |
| currency | 价格币种代码（如 CNY、USD）。price 存在但 currency 为 null 时不要假定币种。 |
| condition | 成色（全新/翻新/二手）。**eBay 上价格差异的第一决定因素**。 |
| shipping | 运费说明。 |
| seller | 卖家名。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| scraped_at | 数据抓取时刻。拍卖类价格变化快，用它判断新鲜度。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "ebay",
  "action": "search",
  "params": {
    "keyword": "mechanical keyboard"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "ebay",
        "action": "search",
        "params": {
            "keyword": "mechanical keyboard",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 10. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "ebay",
  "action": "search",
  "results": [
    {
      "item_id": "•••",
      "title": "Lenovo ThinkBook 15-IIL Laptop 15.6” HD Core i5 16GB RAM 256GB SSD Win 11 Pro",
      "url": "https://www.ebay.com/itm/267594157065",
      "price": 319.99,
      "currency": "USD",
      "seller": {
        "name": null,
        "username": null,
        "feedbackScore": null,
        "feedbackPercentage": null
      },
      "image_url": "https://i.ebayimg.com/images/g/TnAAAeSwGRBqtbQP/s-l500.webp",
      "platform": "ebay"
    },
    {
      "item_id": "•••",
      "title": "Lenovo X1 Yoga Gen 3 2-in-1 Laptop 14” FHD Core i5 8GB RAM 512GB SSD Windows 11",
      "url": "https://www.ebay.com/itm/267147782259",
      "price": 242.22,
      "currency": "USD",
      "seller": {
        "name": null,
        "username": null,
        "feedbackScore": null,
        "feedbackPercentage": null
      },
      "image_url": "https://i.ebayimg.com/images/g/wDMAAeSwq8Rqq4ip/s-l500.webp",
      "platform": "ebay"
    }
  ],
  "count": 10,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 怎么查已售出的商品？

把 `sold_only` 设为 true，要用 JSON 布尔值，不要传字符串 false。在售结果的价格是挂牌价，不要拿它当实际成交价。

### `condition` 怎么填？

只用 New（全新）、Used（二手）、Refurbished（翻新）和 For parts or not working（零件或故障品），大小写和空格照写；它是商品成色，不是好评差评的筛选。返回里的 `condition` 是 eBay 上价格差异的第一决定因素，比较价格前先按它分组。

### 换站点怎么搜，币种怎么看？

`domain` 填站点域名，如 ebay.com、ebay.de、ebay.co.uk，默认 ebay.com；`country` 是它的兼容写法，同样收域名而不是 US、DE 这样的国家码，两者都给时以 `domain` 为准。`price` 不含货币符号，币种看 `currency`，`currency` 为 null 时不要假定币种。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=ebay
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
