> ## 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 で受け取ります。ストアが表示する順に、商品の順位と価格、評価、レビュー数を返します。

eBay（ebay.com）の商品を非同期タスク API で検索します。`COMMERCE_SERP` に `site` `ebay` を指定すると、検索結果の商品をストアの順に受け取ります。このストアの商品ページは `COMMERCE_PRODUCT` では読み取りません。完了した検索 1 件につき **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/ja/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` は 5 点満点です。 999+ のように省略表示されたレビュー数は含みません。
* 検索ごとに、ストアの検索結果の 1 ページ目から商品を取得します。

## エラーと課金

* 商品が 1 つもない検索は、失敗したタスクとして終了します。
* 課金は完了した検索だけで、1 件につき 0.5 クレジットです。

## 関連

* [Amazon](https://docs.querying.ai/ja/engines/amazon.md)
* [Walmart](https://docs.querying.ai/ja/engines/walmart.md)
* [Target](https://docs.querying.ai/ja/engines/target.md)
* [Commerce のストア一覧](https://docs.querying.ai/ja/engines/overview.md#commerce)
* [クレジットと上限](https://docs.querying.ai/ja/concepts/credits-and-limits.md)


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