swiggy.search.restaurants
Search Swiggy restaurants by keyword near an Indian delivery location, with ratings, cuisines, cost for two and delivery time.
At a glance
- Endpoint ID
swiggy.search.restaurants- 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.restaurants", "input": { "latitude": 12.9121181, "limit": 5, "longitude": 77.6445548, "query": "rolls" }}'
import jsonimport osimport requestspayload = json.loads(r'''{ "capability": "swiggy.search.restaurants", "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.restaurants", "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:
results[0].data
{ "summary": { "latitude": 12.9121181, "longitude": 77.6445548, "query": "rolls", "total_items": 5 }, "items": [ { "name": "Olive Street Food Cafe", "rating": 4.4, "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", "cost_for_two_minor": 30000, "cost_for_two_text": "₹300 FOR TWO", "cuisines_text": "Burgers, Cafe", "delivery_time_minutes": 19, "is_open": true, "last_mile_travel_km": 0.9, "last_mile_travel_text": "0.9 km", "latitude": 12.9121181, "locality": "HSR Layout", "longitude": 77.6445548, "offer_text": "ITEMS", "parent_id": "12754", "promoted": true, "query": "rolls", "rating_text": "4.4", "restaurant_id": "856738", "serviceability": "SERVICEABLE", "sla_text": "15-20 MINS", "slug": "olive-street-food-cafe-hsr-hsr", "total_ratings_text": "1.6K+", "cuisines": [ "Burgers", "Cafe" ], "offer_headers": [ "ITEMS" ] }, { "name": "Faasos - Wraps, Rolls & Shawarma", "rating": 4.1, "city": "1", "area_name": "HSR Layout", "cost_for_two_minor": 20000, "cost_for_two_text": "₹200 FOR TWO", "cuisines_text": "Wraps, rolls, Fast Food, Burger, shawarma, Rice Bowls", "delivery_time_minutes": 21, "is_open": true, "last_mile_travel_km": 1.5, "last_mile_travel_text": "1.5 km", "latitude": 12.9121181, "locality": "Sector 2, 27th Main Road", "longitude": 77.6445548, "offer_text": "ITEMS", "parent_id": "21809", "query": "rolls", "rating_text": "4.1", "restaurant_id": "17750", "restaurant_url": "https://www.swiggy.com/city/1/faasos-hsr-rest17750", "serviceability": "SERVICEABLE", "sla_text": "20-25 MINS", "slug": "faasos-hsr", "total_ratings_text": "25K+", "cuisines": [ "Wraps", "rolls" ], "offer_headers": [ "ITEMS" ] } ]}
Fields
| Field | Type | Example |
|---|---|---|
items[].name |
string | Olive Street Food Cafe |
items[].rating |
number | 4.4 |
items[].city |
string | 1 |
items[].ad_tracking_id |
string | cid=00132c9a-9bfd-43b9-b49c-cfe0163ad5c9~p=0~adgrpid=00132c9a-9… |
items[].area_name |
string | HSR |
items[].cost_for_two_minor |
integer | 30,000 |
items[].cost_for_two_text |
string | ₹300 FOR TWO |
items[].cuisines |
array | Burgers, Cafe |
items[].cuisines_text |
string | Burgers, Cafe |
items[].delivery_time_minutes |
integer | 19 |
items[].is_open |
boolean | true |
items[].last_mile_travel_km |
number | 0.9 |
items[].last_mile_travel_text |
string | 0.9 km |
items[].latitude |
number | 12.91 |
items[].locality |
string | HSR Layout |
items[].longitude |
number | 77.64 |
items[].offer_headers |
array | ITEMS |
items[].offer_text |
string | ITEMS |
items[].parent_id |
string | 12754 |
items[].promoted |
boolean | true |
items[].query |
string | rolls |
items[].rating_text |
string | 4.4 |
items[].restaurant_id |
string | 856738 |
items[].serviceability |
string | SERVICEABLE |
items[].sla_text |
string | 15-20 MINS |
items[].slug |
string | olive-street-food-cafe-hsr-hsr |
items[].total_ratings_text |
string | 1.6K+ |
items |
array | 3 records |
summary |
object | 4 fields |
summary.latitude |
number | 12.91 |
summary.longitude |
number | 77.64 |
summary.query |
string | rolls |
summary.total_items |
integer | 5 |
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.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 search
Something missing or unclear? Ask the team that builds the Swiggy endpoints.