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

> Search Flipkart and read its product pages as JSON: ranked products with prices, ratings, review counts and brands, and each product's price, stock and images.

Search Flipkart (flipkart.com) and read its product pages through the async task API. Send `COMMERCE_SERP` with `site` `flipkart` to get the products a search shows, in the store's order, or `COMMERCE_PRODUCT` with a product's `url` to read that product. A completed search or product page costs **0.5 credits**.

## Search

```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 } }'
```

Submit the task, then poll `GET /v1/async/task/{id}` or receive its webhook. See [Async tasks](https://docs.querying.ai/concepts/async-tasks.md).

### Parameters

* `site`: Required. `flipkart`.
* `query`: Required. The search query, 1-500 characters.
* `limit`: Optional integer from 1 to 40, default 20.
* `country`: Optional. Defaults to `IN`, the store's country. Any other country is rejected with `422 REGION_UNSUPPORTED`.

Only the payload fields listed above are accepted. Omit `include`: even `include: {}` returns `422 VALIDATION_ERROR` on `payload.include` before credits are held.

### Response example

```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"
    }
  ]
}
```

### Result fields

* `site`, `query` and `country` echo the request. `returnedCount` is the number of entries in `products`.
* Each product includes `rank`, `productId`, `title` and `url`. `productId` is the store's own product ID. `rank` follows the store's default order, and listings the store marks as sponsored are left out.
* `price`, `rating`, `reviewCount`, `imageUrl` and `brand` appear when the results page shows them. `price` is a number in the product's `currency` (ISO 4217); when sizes are priced apart, it is the lowest one.
* `rating` uses a five-point scale. Abbreviated review counts such as 999+ are left out.
* Each search returns products from the store's first results page, which has 40 places, sponsored listings included.

## Product page

```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" } }'
```

### Parameters

* `url`: Required. A product page on Flipkart, up to 2,048 characters: `flipkart.com/{name}/p/{itm}?pid={pid}`. Product `url` values from a search work as they are. Parameters the result does not depend on, such as tracking codes, are dropped before the page is read.
* `country`: Optional. Defaults to `IN`, the page's country. Any other country is rejected with `422 REGION_UNSUPPORTED`.

Only the payload fields listed above are accepted. Omit `include`: even `include: {}` returns `422 VALIDATION_ERROR` on `payload.include` before credits are held.

### Response example

```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…"
}
```

### Result fields

* `site`, `country`, `url` and `productId` identify the page. `url` is the page that was read, and `productId` matches the one a search returns.
* `title` is always present. `brand`, `price`, `currency`, `inStock`, `rating`, `reviewCount`, `images` and `description` appear when the page shows them.
* `price` is what a shopper pays as the page first shows it, before coupons and delivery, in `currency` (ISO 4217). `inStock` is the product's stock status.
* `rating` uses a five-point scale with two decimals. `reviewCount` is the number of reviews.
* `images` lists up to 30 photos from the product's gallery, in page order.
* `description` is plain text with one line per paragraph, up to 10,000 characters; text that appears only inside images is not included. `description` is the short summary the store publishes for search engines.

## Errors and billing

* A search that returns no products ends as a failed task.
* A product page the store answers with 404 or 410, such as a removed product, ends the task with `PAGE_UNAVAILABLE`, and the message carries the store's answer. When the store refuses the read with 403, 412, 429 or 435, the task waits and asks again for up to 6 minutes. Other failed reads, and a refusal that lasts longer, end with `ENGINE_NO_RESULT`.
* Only completed tasks are charged: 0.5 credits for a search or a product page.

## Related

* [Myntra](https://docs.querying.ai/engines/myntra.md)
* [Nykaa](https://docs.querying.ai/engines/nykaa.md)
* [All Commerce stores](https://docs.querying.ai/engines/overview.md#commerce)
* [Credits and limits](https://docs.querying.ai/concepts/credits-and-limits.md)


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