Swiggy Search
swiggy.search
Search Swiggy restaurants near a delivery location by keyword and return the matching restaurant list.
At a glance
- Endpoint ID
swiggy.search- Price
- 1 credit per call; failed calls are free
- Runs for up to
- 60 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": "swiggy.search", "input": { "latitude": 12.9121181, "limit": 5, "longitude": 77.6445548, "query": "rolls" }}'
import jsonimport osimport requestspayload = json.loads(r'''{ "capability": "swiggy.search", "input": { "latitude": 12.9121181, "limit": 5, "longitude": 77.6445548, "query": "rolls" }}''')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": "swiggy.search", "input": { "latitude": 12.9121181, "limit": 5, "longitude": 77.6445548, "query": "rolls" }}),});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 keyword. | rolls |
latitude |
number | no | Latitude of the location. | 12.9121181 |
limit |
integer | no | Maximum number of results. | 5 |
longitude |
number | no | Longitude of the location. | 77.6445548 |
metadata |
string | no | Additional metadata. | |
query_unique_id |
string | no | Unique query identifier. | |
selected_tab |
string | no | Selected search tab. | |
tracking_id |
string | no | Tracking identifier. |
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:
{ "count": 5, "raw_meta": { "selected_tab": "RESTAURANT", "suggest_url": "https://www.swiggy.com/dapi/restaurants/search/suggest?includeIMItem=true&lat=12.9121181&lng=77.6445548&str=rolls&trackingId=undefined" }, "results": [ { "name": "Olive Street Food Cafe", "city": "1", "ad_tracking_id": "cid=00132c9a-9bfd-43b9-b49c-cfe0163ad5c9~p=0~adgrpid=00132c9a-9bfd-43b9-b49c-cfe0163ad5c9#ag1~mp=SWIGGY_IN~bl=FOOD~aet=RESTAURANT~aeid=8567…", "area_name": "HSR", "avg_rating": 4.4, "avg_rating_string": "4.4", "cost_for_two": 30000, "cost_for_two_message": "₹300 FOR TWO", "delivery_time_minutes": 19, "id": "856738", "is_open": true, "last_mile_travel_km": 0.9, "last_mile_travel_string": "0.9 km", "locality": "HSR Layout", "parent_id": "12754", "promoted": true, "serviceability": "SERVICEABLE", "sla_string": "15-20 MINS", "slug": "olive-street-food-cafe-hsr-hsr", "total_ratings_string": "1.6K+", "cuisines": [ "Burgers", "Cafe" ], "offers": [ { "header": "ITEMS", "sub_header": "AT ₹89" } ] }, { "name": "Faasos - Wraps, Rolls & Shawarma", "city": "1", "area_name": "HSR Layout", "avg_rating": 4.1, "avg_rating_string": "4.1", "cost_for_two": 20000, "cost_for_two_message": "₹200 FOR TWO", "delivery_time_minutes": 21, "id": "17750", "is_open": true, "last_mile_travel_km": 1.5, "last_mile_travel_string": "1.5 km", "locality": "Sector 2, 27th Main Road", "parent_id": "21809", "restaurant_url": "https://www.swiggy.com/city/1/faasos-hsr-rest17750", "serviceability": "SERVICEABLE", "sla_string": "20-25 MINS", "slug": "faasos-hsr", "total_ratings_string": "25K+", "cuisines": [ "Wraps", "rolls" ], "offers": [ { "header": "ITEMS", "sub_header": "AT ₹10" } ] } ], "suggestions": [ { "text": "Roll", "cloudinary_id": "btrmbvwdfin5wp4dw1v7", "deep_link": "swiggy://explore?query=Roll&metadata=%7B%22type%22%3A%22DISH%22%2C%22data%22%3A%7B%22vegIdentifier%22%3A%22NA%22%2C%22cloudinaryId%22%3A%22…", "metadata": "{\"type\":\"DISH\",\"data\":{\"vegIdentifier\":\"NA\",\"cloudinaryId\":\"btrmbvwdfin5wp4dw1v7\",\"dishFamilyId\":\"846516\",\"dishFamilyIds\":[\"846516\"]},\"busi…", "tag": "Dish", "type": "DISH" }, { "text": "Rolls On Wheels - Shawarma & Wraps", "restaurant_id": "612", "tag": "Restaurant", "type": "RESTAURANT" } ]}
Fields
| Field | Type | Example |
|---|---|---|
results[].name |
string | Olive Street Food Cafe |
results[].city |
string | 1 |
results[].ad_tracking_id |
string | cid=00132c9a-9bfd-43b9-b49c-cfe0163ad5c9~p=0~adgrpid=00132c9a-9… |
results[].area_name |
string | HSR |
results[].avg_rating |
number | 4.4 |
results[].avg_rating_string |
string | 4.4 |
results[].cost_for_two |
integer | 30,000 |
results[].cost_for_two_message |
string | ₹300 FOR TWO |
results[].cuisines |
array | Burgers, Cafe |
results[].delivery_time_minutes |
integer | 19 |
results[].id |
string | 856738 |
results[].is_open |
boolean | true |
results[].last_mile_travel_km |
number | 0.9 |
results[].last_mile_travel_string |
string | 0.9 km |
results[].locality |
string | HSR Layout |
results[].offers |
array | 1 records |
results[].offers[].header |
string | ITEMS |
results[].offers[].sub_header |
string | AT ₹89 |
results[].parent_id |
string | 12754 |
results[].promoted |
boolean | true |
results[].serviceability |
string | SERVICEABLE |
results[].sla_string |
string | 15-20 MINS |
results[].slug |
string | olive-street-food-cafe-hsr-hsr |
results[].total_ratings_string |
string | 1.6K+ |
count |
integer | 5 |
raw_meta |
object | 2 fields |
raw_meta.selected_tab |
string | RESTAURANT |
raw_meta.suggest_url |
string | https://www.swiggy.com/dapi/restaurants/search/suggest?includeI… |
results |
array | 3 records |
suggestions |
array | 3 records |
suggestions[].cloudinary_id |
string | btrmbvwdfin5wp4dw1v7 |
suggestions[].deep_link |
string | swiggy://explore?query=Roll&metadata=%7B%22type%22%3A%22DISH%22… |
suggestions[].metadata |
string | {"type":"DISH","data":{"vegIdentifier":"NA","cloudinaryId":"btr… |
suggestions[].tag |
string | Dish |
suggestions[].text |
string | Roll |
suggestions[].type |
string | DISH |
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 Swiggy endpoints
swiggy.ads.listAdsswiggy.ads.searchAds searchswiggy.area.ads.searchArea ads searchswiggy.area.menu_itemsArea menu items gridswiggy.area.restaurantsArea restaurantsswiggy.categoriesCategoriesswiggy.listListswiggy.list.all_restaurantsAll restaurantsswiggy.list.restaurantsRestaurantsswiggy.menuMenuswiggy.menu.area_itemsArea menu itemsswiggy.menu.itemsMenu itemsswiggy.search.dishesDishes searchswiggy.search.restaurantsRestaurants search
Something missing or unclear? Ask the team that builds the Swiggy endpoints.