> ## 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)에서 상품을 비동기 task API로 검색합니다. `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 } }'
```

task를 제출한 뒤 `GET /v1/async/task/{id}`를 폴링하거나 웹훅으로 받습니다. 참고: [비동기 task](https://docs.querying.ai/ko/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+처럼 줄여 표시한 리뷰 수는 담지 않습니다.
* 검색마다 쇼핑몰의 첫 결과 페이지에서 상품을 가져옵니다.

## 오류와 과금

* 상품이 하나도 없는 검색은 실패한 task로 끝납니다.
* 완료된 검색에만 과금하며, 검색당 0.5크레딧입니다.

## 관련 문서

* [Amazon](https://docs.querying.ai/ko/engines/amazon.md)
* [Walmart](https://docs.querying.ai/ko/engines/walmart.md)
* [Target](https://docs.querying.ai/ko/engines/target.md)
* [Commerce 쇼핑몰 전체](https://docs.querying.ai/ko/engines/overview.md#commerce)
* [크레딧과 한도](https://docs.querying.ai/ko/concepts/credits-and-limits.md)


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