Flipkart Search Categories
flipkart.search.categories
Find the categories and filters behind a search, such as brands and price ranges, to narrow searches and category pages.
At a glance
- Endpoint ID
flipkart.search.categories- Price
- 3 credits per call; failed calls are free
- Runs for up to
- 30 seconds
Request
Send the endpoint ID as capability and its fields as input. Set UPSCRAPE_API_KEY to your key first.
curl --request POST \ --url https://data.upscrape.com/execute \ --header "Authorization: Bearer $UPSCRAPE_API_KEY" \ --header "Content-Type: application/json" \ --header "Prefer: wait=30" \ --data '{ "capability": "flipkart.search.categories", "input": { "max_results": 20, "query": "mobiles" }}'
import jsonimport osimport requestspayload = json.loads(r'''{ "capability": "flipkart.search.categories", "input": { "max_results": 20, "query": "mobiles" }}''')response = requests.post( "https://data.upscrape.com/execute", headers={ "Authorization": f"Bearer {os.environ['UPSCRAPE_API_KEY']}", "Content-Type": "application/json", "Prefer": "wait=30", }, json=payload,)response.raise_for_status()print(json.dumps(response.json(), indent=2))
const response = await fetch("https://data.upscrape.com/execute", { method: "POST", headers: { "Authorization": `Bearer ${process.env.UPSCRAPE_API_KEY}`, "Content-Type": "application/json", "Prefer": "wait=30", }, body: JSON.stringify({ "capability": "flipkart.search.categories", "input": { "max_results": 20, "query": "mobiles" }}),});if (!response.ok) { throw new Error(`Upscrape request failed: ${response.status}`);}console.log(JSON.stringify(await response.json(), null, 2));
Input
| Field | Type | Required | What it does | Example |
|---|---|---|---|---|
query |
string | yes | Search query. | mobiles |
include_filters |
boolean | no | Return result filters (brand, price, rating ...) alongside categories (default true) | |
max_filter_values |
integer | no | Most values returned per filter (default 10); value_count gives the full number From 1 to 100. | |
max_results |
integer | no | Most child categories returned at each level of the tree (default 20) From 1 to 100. | 20 |
Response
A finished call answers with HTTP 200; the data is in results[0].data, and billing.credits_charged is what it cost. A call still running after the wait answers 202: see jobs and results.
This is results[0].data from a real run:
{ "total_products": 7886, "breadcrumbs": [ { "name": "Home", "url": "https://www.flipkart.com/" }, { "name": "Mobiles & Accessories", "url": "https://www.flipkart.com/mobiles-accessories/pr?sid=tyy&marketplace=FLIPKART" } ], "categories": [ { "name": "Mobiles & Accessories", "category_id": "tyy", "has_children": true, "matched_source": "facets", "path": "mobiles-accessories/pr?sid=tyy", "url": "https://www.flipkart.com/mobiles-accessories/pr?sid=tyy&q=mobiles", "children": [ { "name": "Mobiles", "category_id": "tyy/4io", "has_children": false, "matched_source": "facets", "path": "mobiles/pr?sid=tyy,4io", "url": "https://www.flipkart.com/mobiles/pr?sid=tyy,4io&q=mobiles" } ] } ], "filters": [ { "name": "Brand", "id": "brand", "multi_select": true, "type": "options", "value_count": 134, "values": [ { "name": "Apple", "count": 457, "param": "facets.brand[]=Apple", "selected": false }, { "name": "Google", "count": 36, "param": "facets.brand[]=Google", "selected": false } ] }, { "name": "Ram", "id": "ram", "multi_select": false, "type": "options", "value_count": 7, "values": [ { "name": "1 GB and Below", "count": 549, "param": "facets.ram[]=1 GB and Below", "selected": false }, { "name": "1GB and Below", "count": 2217, "param": "facets.ram[]=1GB and Below", "selected": false } ] } ]}
Fields
| Field | Type | What it is | Example |
|---|---|---|---|
breadcrumbs[].name |
string | The category or filter name. | Home |
breadcrumbs[].url |
string | The page on Flipkart. | https://www.flipkart.com/ |
breadcrumbs |
array | The category path above the page. | 3 records |
categories |
array | The categories that match the search. | 1 records |
categories[].category_id |
string | Flipkart's ID for the category. | tyy |
categories[].children |
array | Subcategories under this one. | 1 records |
categories[].children[].category_id |
string | Flipkart's ID for the subcategory. | tyy/4io |
categories[].children[].has_children |
boolean | Whether the subcategory has its own subcategories. | false |
categories[].children[].matched_source |
string | Which part of the search page listed the subcategory. | facets |
categories[].children[].name |
string | The subcategory's name. | Mobiles |
categories[].children[].path |
string | The subcategory's address on Flipkart. | mobiles/pr?sid=tyy,4io |
categories[].children[].url |
string | Link to the subcategory's results for the search. | https://www.flipkart.com/mobiles/pr?sid=tyy,4io&q=mobiles |
categories[].has_children |
boolean | Whether the category has subcategories. | true |
categories[].matched_source |
string | Which part of the search page listed the category. | facets |
categories[].name |
string | The category or filter name. | Mobiles & Accessories |
categories[].path |
string | The category's address on Flipkart. | mobiles-accessories/pr?sid=tyy |
categories[].url |
string | The page on Flipkart. | https://www.flipkart.com/mobiles-accessories/pr?sid=tyy&q=mobil… |
filters |
array | The filters Flipkart offers for the search. | 3 records |
filters[].id |
string | Flipkart's ID for the filter. | brand |
filters[].multi_select |
boolean | Whether more than one value can be chosen. | true |
filters[].name |
string | The category or filter name. | Brand |
filters[].type |
string | The kind of filter. | options |
filters[].value_count |
integer | How many values the filter has. | 134 |
filters[].values |
array | The filter's values. | 3 records |
filters[].values[].count |
integer | How many products have this value. | 457 |
filters[].values[].name |
string | The value's name, such as Apple. | Apple |
filters[].values[].param |
string | The setting to send to apply this value. | facets.brand[]=Apple |
filters[].values[].selected |
boolean | Whether this value is already applied. | false |
total_products |
integer | How many products Flipkart says match. | 7886 |
If a call fails
A failed call costs nothing. The response carries an error.code you can branch on; Errors and retries lists every code and which ones to retry.
Other Flipkart Commerce endpoints
Something missing or unclear? Ask the team that builds the Flipkart Commerce endpoints.