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

# Flipkart API

> Flipkart の商品を検索し、商品ページを読み取って JSON で受け取ります。検索結果の順位と価格、評価、レビュー数、ブランド、商品ページの価格、在庫、画像を返します。

Flipkart（flipkart.com）の商品を検索し、商品ページを非同期タスク API で読み取ります。`COMMERCE_SERP` に `site` `flipkart` を指定すると検索結果の商品をストアの順に受け取り、`COMMERCE_PRODUCT` に商品の `url` を渡すとその商品を 1 つ読み取ります。完了した検索または商品ページ 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": "flipkart", "query": "wireless earbuds", "limit": 3 } }'
```

タスクを送信したあと、`GET /v1/async/task/{id}` をポーリングするか Webhook で受け取ります。[非同期タスク](https://docs.querying.ai/ja/concepts/async-tasks.md)を参照してください。

### パラメータ

* `site`: 必須。`flipkart` です。
* `query`: 必須。検索語で、1-500 文字です。
* `limit`: 任意の整数、1-40。デフォルトは 20 です。
* `country`: 任意。デフォルトはストアの国の `IN` です。ほかの国は `422 REGION_UNSUPPORTED` で拒否されます。

受け付けるペイロードフィールドは上記のみです。`include` は省略してください。`include: {}` でも、クレジットを確保する前に `payload.include` の `422 VALIDATION_ERROR` を返します。

### レスポンス例

```json theme={"theme":"css-variables"}
{
  "site": "flipkart",
  "query": "wireless earbuds",
  "country": "IN",
  "returnedCount": 3,
  "products": [
    {
      "rank": 1,
      "productId": "ACCHQGW2GYZXP57R",
      "title": "GWALBROS New Trending BUDS R2 True Wireless Earbuds with Mic, 12.4mm Drivers F03 Bluetooth",
      "url": "https://www.flipkart.com/gwalbros-new-trending-buds-r2-true-wireless-earbuds-mic-12-4mm-drivers-f03-bluetooth/p/itm07d92543aca98?pid=ACCHQGW2GYZXP57R",
      "price": 361,
      "currency": "INR",
      "rating": 3.7,
      "reviewCount": 504,
      "brand": "GWALBROS",
      "imageUrl": "https://rukmini1.flixcart.com/image/416/416/xif0q/headphone/e/2/r/bx-2r-techio-original-imahpyystsr3y4dt.jpeg?q=70"
    },
    {
      "rank": 2,
      "productId": "ACCH77MF4NYVHZTE",
      "title": "Aroma NB121 Pods Upto 40 Hours Playtime* Type C Fast Charging Dual Pairing Earbuds Bluetooth",
      "url": "https://www.flipkart.com/aroma-nb121-pods-upto-40-hours-playtime-type-c-fast-charging-dual-pairing-earbuds-bluetooth/p/itm911b47c91c5dd?pid=ACCH77MF4NYVHZTE",
      "price": 300,
      "currency": "INR",
      "rating": 3.5,
      "reviewCount": 143763,
      "brand": "Aroma",
      "imageUrl": "https://rukmini1.flixcart.com/image/416/416/xif0q/headphone/d/u/0/nb121-pods-upto-40-hours-playtime-type-c-fast-charging-dual-original-imahh4a72k7jbk2h.jpeg?q=70"
    },
    {
      "rank": 3,
      "productId": "ACCHH9JJMVTHTGBN",
      "title": "DSSB Black Edition TWS Bluetooth Earbuds with Mic, Noise Cancellation Bluetooth",
      "url": "https://www.flipkart.com/dssb-black-tws-bluetooth-earbuds-mic-noise-cancellation/p/itmd48a4d77fe026?pid=ACCHH9JJMVTHTGBN",
      "price": 283,
      "currency": "INR",
      "rating": 3.6,
      "reviewCount": 28696,
      "brand": "DSSB",
      "imageUrl": "https://rukmini1.flixcart.com/image/416/416/xif0q/headphone/b/m/k/black-edition-tws-bluetooth-earbuds-with-mic-noise-cancellation-original-imahmrgh5eh2dhns.jpeg?q=70"
    }
  ]
}
```

### 結果フィールド

* `site`、`query`、`country` はリクエストの値です。`returnedCount` は `products` の件数です。
* 各商品は `rank`、`productId`、`title`、`url` を含みます。`productId` はストア独自の商品 ID です。`rank` はストアのデフォルトの並び順で、ストアが広告と表示した商品は除きます。
* `price`、`rating`、`reviewCount`、`imageUrl`、`brand` は、検索結果の画面に表示されている場合に含みます。`price` は商品ごとの `currency`（ISO 4217）の数値で、容量ごとに価格が異なる場合は最も低い価格です。
* `rating` は 5 点満点です。 999+ のように省略表示されたレビュー数は含みません。
* 検索ごとに、ストアの検索結果の 1 ページ目から商品を取得します。このページは広告商品を含めて 40 枠です。

## 商品ページ

```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.flipkart.com/gwalbros-new-trending-buds-r2-true-wireless-earbuds-mic-12-4mm-drivers-f03-bluetooth/p/itm07d92543aca98?pid=ACCHQGW2GYZXP57R" } }'
```

### パラメータ

* `url`: 必須。Flipkart の商品ページで、2,048 文字以内です。形式は `flipkart.com/{name}/p/{itm}?pid={pid}` です。検索結果の商品 `url` はそのまま渡せます。トラッキングコードなど結果に影響しないパラメータは読み取り前に取り除きます。
* `country`: 任意。デフォルトはページの国の `IN` です。ほかの国は `422 REGION_UNSUPPORTED` で拒否されます。

受け付けるペイロードフィールドは上記のみです。`include` は省略してください。`include: {}` でも、クレジットを確保する前に `payload.include` の `422 VALIDATION_ERROR` を返します。

### レスポンス例

```json theme={"theme":"css-variables"}
{
  "site": "flipkart",
  "country": "IN",
  "url": "https://www.flipkart.com/gwalbros-new-trending-buds-r2-true-wireless-earbuds-mic-12-4mm-drivers-f03-bluetooth/p/itm07d92543aca98?pid=ACCHQGW2GYZXP57R",
  "productId": "ACCHQGW2GYZXP57R",
  "title": "GWALBROS New Trending BUDS R2 True Wireless Earbuds with Mic, 12.4mm Drivers F03 Bluetooth",
  "brand": "GWALBROS",
  "price": 361,
  "currency": "INR",
  "inStock": true,
  "rating": 3.7,
  "reviewCount": 504,
  "images": [
    "https://rukmini1.flixcart.com/image/1500/1500/xif0q/headphone/e/2/r/bx-2r-techio-original-imahpyystsr3y4dt.jpeg?q=70",
    "https://rukmini1.flixcart.com/image/1500/1500/xif0q/headphone/x/f/b/nord-buds-2r-tws-bluetooth-earbuds-with-deep-bass-enc-mic-touch-original-imahpyhynh6e3f9w.jpeg?q=70"
  ],
  "description": "Buy GWALBROS New Trending BUDS R2 True Wireless Earbuds with Mic, 12.4mm Drivers F03 Bluetooth for Rs.1499.0 Online, Also get GWALBROS New Trending BUDS R2 True Wireless Earbuds with Mic, 12.4mm…"
}
```

### 結果フィールド

* `site`、`country`、`url`、`productId` でページを識別します。`url` は読み取ったページで、`productId` は検索結果の ID と同じです。
* `title` は常に含みます。`brand`、`price`、`currency`、`inStock`、`rating`、`reviewCount`、`images`、`description` は、ページに表示されている場合に含みます。
* `price` は、クーポンと送料を適用する前にページが最初に表示する購入価格で、`currency`（ISO 4217）の値です。 `inStock` は在庫の有無です。
* `rating` は小数第 2 位までの 5 点満点の評価です。 `reviewCount` はレビュー数です。
* `images` は商品ギャラリーの写真を、ページの順に最大 30 枚含みます。
* `description` は段落ごとに 1 行のプレーンテキストで、最大 10,000 文字です。画像の中にしかない文字は含みません。 `description` は、ストアが検索エンジン向けに公開している短い要約です。

## エラーと課金

* 商品が 1 つもない検索は、失敗したタスクとして終了します。
* ストアが 404 または 410 で応答する商品ページ（削除された商品など）は `PAGE_UNAVAILABLE` で終了し、メッセージにストアの応答が入ります。ストアが 403、412、429、435 で読み取りを拒否した場合、タスクは待機して最大 6 分間再試行します。ほかの読み取り失敗と、それより長く続く拒否は `ENGINE_NO_RESULT` で終了します。
* 課金は完了したタスクだけで、検索または商品ページ 1 件につき 0.5 クレジットです。

## 関連

* [Myntra](https://docs.querying.ai/ja/engines/myntra.md)
* [Nykaa](https://docs.querying.ai/ja/engines/nykaa.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.