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

# Google Shopping API

> Google Shopping에서 상품을 검색하고 상품 페이지를 읽어 JSON으로 받습니다. 검색 결과의 순위와 가격, 평점, 리뷰 수, 판매처, 상품 페이지의 가격, 재고, 판매자, 이미지, 사양 정보를 담습니다.

Google Shopping(shopping.google.com)에서 상품을 검색하고 상품 페이지를 비동기 task API로 읽습니다. `COMMERCE_SERP`(`site`: `google_shopping`)를 보내면 검색 결과의 상품을 쇼핑몰 순서대로 받고, `COMMERCE_PRODUCT`에 상품 `url`을 보내면 그 상품 하나를 읽습니다. 완료된 검색이나 상품 페이지 하나에 **2크레딧**입니다.

## 검색

```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": "google_shopping", "query": "wireless earbuds", "limit": 3 } }'
```

task를 제출한 뒤 `GET /v1/async/task/{id}`를 폴링하거나 웹훅으로 받습니다. 참고: [비동기 task](https://docs.querying.ai/ko/concepts/async-tasks.md).

### 입력

* `site`: 필수. `google_shopping`입니다.
* `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": "google_shopping",
  "query": "wireless earbuds",
  "country": "US",
  "returnedCount": 3,
  "products": [
    {
      "rank": 1,
      "productId": "1067219252613399794",
      "title": "JLab Go Air Sport True Wireless Earbuds",
      "url": "https://www.google.com/search?q=wireless+earbuds&udm=28&gl=us&hl=en#product=1067219252613399794&title=JLab+Go+Air+Sport+True+Wireless+Earbuds",
      "price": 9.88,
      "currency": "USD",
      "rating": 4.1,
      "seller": "Walmart"
    },
    {
      "rank": 2,
      "productId": "5295866786049939613",
      "title": "JBL Vibe Beam 2 Noise Cancelling True Wireless Earbuds",
      "url": "https://www.google.com/search?q=wireless+earbuds&udm=28&gl=us&hl=en#product=5295866786049939613&title=JBL+Vibe+Beam+2+Noise+Cancelling+True+Wireless+Earbuds",
      "price": 39.95,
      "currency": "USD",
      "rating": 4.2,
      "seller": "Best Buy",
      "imageUrl": "https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcTxk4D_LlWLl4n-ponPRc2ihvXVxc8LIg5CGbLCdzmKDbN8zVii50zLQ0tUpH6TwjuCdY2RS3wRw93no9--JdlU6yG_udswoQ"
    },
    {
      "rank": 3,
      "productId": "549048356659243400",
      "title": "Beats Solo Buds True Wireless Earbuds",
      "url": "https://www.google.com/search?q=wireless+earbuds&udm=28&gl=us&hl=en#product=549048356659243400&title=Beats+Solo+Buds+True+Wireless+Earbuds",
      "price": 69.99,
      "currency": "USD",
      "rating": 3.8,
      "seller": "Target",
      "imageUrl": "https://encrypted-tbn2.gstatic.com/shopping?q=tbn:ANd9GcSQnGg6ee9gh0KOOWZFMqbmbUGjWa3kZ5V5EBOzJjb6JRM9z6TdPAoGlSi5_f6cPsEXle-oiBJ8EJ-FaREc98Wqt8jC8WzmfQ"
    }
  ]
}
```

### 결과 필드

* `site`, `query`, `country`는 요청 값입니다. `returnedCount`는 `products`에 담긴 상품 수입니다.
* 각 상품은 `rank`, `productId`, `title`, `url`을 담습니다. `productId`는 Google 상품 ID이고, Google이 상품으로 묶지 않은 판매 목록은 판매 항목(offer) ID입니다. `rank`는 쇼핑몰의 기본 정렬 순서이며, 쇼핑몰이 광고로 표시한 상품은 건너뜁니다.
* `price`, `rating`, `reviewCount`, `imageUrl`, `seller` 필드는 검색 결과 화면에 있을 때 담습니다. `price`는 상품별 `currency`(ISO 4217) 기준의 숫자이며, 용량별 가격이 다르면 가장 낮은 가격입니다.
* `rating`은 5점 만점입니다. 999+처럼 줄여 표시한 리뷰 수는 담지 않습니다. `reviewCount`는 Google이 정확한 개수를 보여 줄 때(1,000개 미만)만 담습니다.
* 검색마다 쇼핑몰의 첫 결과 페이지에서 상품을 가져옵니다.
* Google 페이지에는 상품이나 판매처 페이지 링크가 없어, `url`은 상품이 노출된 Google Shopping 결과 페이지 끝에 `#product={productId}&title={title}`를 붙인 주소입니다. 이 `url`을 `COMMERCE_PRODUCT`에 넣으면 상품의 판매처, 사양, 설명을 읽습니다. `seller`는 Google이 먼저 보여 주는 판매처입니다.

## 상품 페이지

```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_PRODUCT", "payload": { "url": "https://www.google.com/search?q=wireless+earbuds&udm=28&gl=us&hl=en#product=5295866786049939613&title=JBL+Vibe+Beam+2+Noise+Cancelling+True+Wireless+Earbuds" } }'
```

### 입력

* `url`: 필수. Google Shopping 검색이 돌려준 상품 `url`이며 2,048자 이하입니다. 주소 형식은 `google.com/search?q={query}&udm=28&gl={market}#product={productId}&title={title}`입니다. [Google 검색](https://docs.querying.ai/ko/engines/google-serp.md), [Google AI 개요](https://docs.querying.ai/ko/engines/google-ai-overviews.md), [Google AI 모드](https://docs.querying.ai/ko/engines/google-ai-mode.md) 결과 상품의 `productDetailUrl`도 그대로 넣을 수 있습니다.
* `country`: 선택. 기본값은 `url`의 `gl`이며 `US`, `GB`, `AU`, `CA`, `KR`, `JP`, `TW`, `HK`, `DE`, `FR`, `ES`, `IT`, `PL`, `PT`, `BR`, `IN`, `ID`, `TH`, `VN` 중 하나입니다. 다른 국가는 `422 REGION_UNSUPPORTED`로 거절합니다.

위에 나열한 페이로드 필드만 받습니다. `include`는 생략합니다. `include: {}`도 크레딧을 확보하기 전에 `payload.include`의 `422 VALIDATION_ERROR`를 반환합니다.

### 응답 예시

```json theme={"theme":"css-variables"}
{
  "site": "google_shopping",
  "country": "US",
  "url": "https://www.google.com/search?q=wireless+earbuds&udm=28&gl=us&hl=en#product=5295866786049939613&title=JBL+Vibe+Beam+2+Noise+Cancelling+True+Wireless+Earbuds",
  "productId": "5295866786049939613",
  "title": "JBL Vibe Beam 2 Noise Cancelling True Wireless Earbuds",
  "brand": "JBL",
  "price": 39.95,
  "listPrice": 65,
  "currency": "USD",
  "inStock": true,
  "seller": "Scheels",
  "rating": 4.2,
  "images": [
    "https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcTxk4D_LlWLl4n-ponPRc2ihvXVxc8LIg5CGbLCdzmKDbN8zVii50zLQ0tUpH6TwjuCdY2RS3wRw93no9--JdlU6yG_udswoQ",
    "https://encrypted-tbn2.gstatic.com/shopping?q=tbn:ANd9GcQ64EZlooEjcI4GdHBULPySzyZvLSCxjsMi8raMFjbWdZv_KK0cL6P2pIc7nts3uk7G0_XBWBBhVjcuz92sCo2lcDw4hW2H"
  ],
  "description": "The JBL Vibe Beam 2 is a true wireless in-ear earbud system designed to deliver strong audio performance, effective noise control, and seamless everyday usability. Equipped with Bluetooth 5.3, it…",
  "specs": [
    { "name": "Brand", "value": "JBL" },
    { "name": "Noise Canceling", "value": "Yes" },
    { "name": "With Microphone", "value": "Yes" }
  ],
  "offers": [
    {
      "price": 39.95,
      "title": "JBL Vibe Beam 2 headphones",
      "seller": "Scheels",
      "inStock": true,
      "currency": "USD",
      "listPrice": 65
    },
    {
      "url": "https://www.walmart.com/ip/JBL-Vibe-Beam-2-True-Wireless-Noise-Cancelling-In-Ear-Earbuds-Black/21106652379?wmlspartner=wlpa&selectedSellerId=609&veh=seo_fpl&cn=google",
      "price": 39.77,
      "title": "Jbl Vibe Beam 2 True Wireless Noise Cancelling In-Ear Earbuds, Black",
      "seller": "Walmart - Electronics Expo (Authorized Dealer)",
      "inStock": true,
      "currency": "USD"
    }
  ]
}
```

### 결과 필드

* `site`, `country`, `url`, `productId`로 페이지를 구분합니다. `url`은 읽은 페이지이고, `productId`는 검색 결과의 ID와 같습니다.
* `title`은 항상 담습니다. `brand`, `price`, `listPrice`, `currency`, `inStock`, `seller`, `rating`, `reviewCount`, `images`, `description`, `specs`, `offers` 필드는 페이지에 있을 때 담습니다.
* `price`는 쿠폰과 배송비를 적용하기 전, 페이지가 처음 보여 주는 구매 가격이며 `currency`(ISO 4217) 기준입니다. `listPrice`는 페이지가 취소선으로 보여 주는 정가이며, `price`보다 높을 때만 담습니다. `inStock`은 재고 여부입니다. `seller`는 판매자입니다.
* `rating`은 소수 둘째 자리까지의 5점 만점 점수입니다. `reviewCount`는 리뷰 수입니다. `reviewCount`는 Google이 정확한 개수를 보여 줄 때(1,000개 미만)만 담습니다.
* `images`는 상품 갤러리의 사진을 페이지 순서대로 최대 30장 담습니다.
* `description`은 문단마다 한 줄인 일반 텍스트이며 최대 10,000자입니다. 이미지 안에만 있는 글은 담지 않습니다.
* `specs`는 상품 정보의 `{ name, value }` 쌍을 최대 100개 담습니다.
* 읽기는 `url`의 검색어를 그 시장의 Google Shopping에서 다시 검색하고, Google이 더 이상 그 검색어에 상품을 보여 주지 않으면 상품명으로 검색한 뒤 상품 패널을 엽니다. 그래서 쇼핑몰 페이지보다 오래 걸립니다. 두 검색 모두에 상품이 없으면 task는 `PAGE_UNAVAILABLE`로 끝납니다.
* `offers`는 Google이 보여 주는 판매처를 Google이 최저가로 표시한 판매처부터 담습니다. 각 판매처는 `seller`, `title`(판매처의 상품명), `url`(Google이 연결할 때 판매처의 상품 페이지), `price`, `listPrice`, `currency`, `inStock`을 담습니다. 상품의 `price`, `listPrice`, `seller`, `inStock`은 첫 판매처 기준입니다. 가격은 표시 언어와 관계없이 그 시장 Shopping 탭의 통화(ISO 4217)입니다.
* Google AI 개요나 AI 모드 상품의 `productDetailUrl`은 상품명으로 검색하며, 결과에 그 상품의 `productDocid`를 담습니다.

## 오류와 과금

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

## 관련 문서

* [Google 검색](https://docs.querying.ai/ko/engines/google-serp.md)
* [Google AI 개요](https://docs.querying.ai/ko/engines/google-ai-overviews.md)
* [Google AI 모드](https://docs.querying.ai/ko/engines/google-ai-mode.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.