Flipkart Suggestions Search
flipkart.search.suggestions
Get the autocomplete suggestions Flipkart shows for what a shopper types.
At a glance
- Endpoint ID
flipkart.search.suggestions- Price
- 1.5 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.suggestions", "input": { "max_results": 10, "query": "iphone" }}'
import jsonimport osimport requestspayload = json.loads(r'''{ "capability": "flipkart.search.suggestions", "input": { "max_results": 10, "query": "iphone" }}''')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.suggestions", "input": { "max_results": 10, "query": "iphone" }}),});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. | iphone |
max_results |
integer | no | Maximum number of results to return. From 1 to 50. | 10 |
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:
{ "suggestions": [ { "text": "iphone 18 pro", "rank": 1, "store": "Mobiles", "type": "QUERY_STORE", "url": "https://www.flipkart.com/search?q=iphone+18+pro&sid=tyy,4io" }, { "text": "iphone 17", "rank": 2, "store": "Mobiles", "type": "QUERY_STORE", "url": "https://www.flipkart.com/search?q=iphone+17&sid=tyy,4io" } ]}
Fields
| Field | Type | What it is | Example |
|---|---|---|---|
suggestions[].text |
string | The suggested search. | iphone 18 pro |
suggestions[].rank |
integer | The suggestion's place in the list, starting at 1. | 1 |
suggestions[].store |
string | The Flipkart store the suggestion belongs to. | Mobiles |
suggestions[].type |
string | The kind of suggestion, such as a query or a store. | QUERY_STORE |
suggestions[].url |
string | The page on Flipkart. | https://www.flipkart.com/search?q=iphone+18+pro&sid=tyy,4io |
suggestions |
array | The search suggestions. | 3 records |
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.