# Swiggy Food Delivery Restaurants (`w3crawler/swiggy-delivery-scraper`) Actor

Collect source-backed public Swiggy food-delivery restaurant listings with optional public menu data.

- **URL**: https://apify.com/w3crawler/swiggy-delivery-scraper.md
- **Developed by:** [w3crawler](https://apify.com/w3crawler) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 restaurants

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Swiggy Public Food Delivery Restaurants

Collect source-backed public Swiggy food-delivery restaurant listings for an Indian city. The Actor uses bounded direct HTTPS first, then Swiggy's public location and restaurant-listing JSON endpoints, and finally one reusable browser session only if both faster paths are unavailable.

### Input

```json
{
  "city": "chennai",
  "maxItems": 10,
  "getMenus": true,
  "getAddons": true,
  "getVariants": true,
  "browserFallback": true,
  "timeoutSecs": 30,
  "fixtureFile": "fixtures/sample.html"
}
```

`city` is normalized to a Swiggy city-page slug. `maxItems` accepts 1–100. Menu enrichment is enabled by default; it performs one bounded public restaurant-page request per listing whose menu is not already embedded. `timeoutSecs` accepts 5–120 seconds per request.

If the city page is stripped, the Actor resolves the city through Swiggy's public autocomplete/address endpoints and requests its public restaurant-listing v5 JSON. Output keeps the city page in `sourcePageUrl` and records the endpoint in `sourceApiUrl`. If that API chain is also unavailable, `browserFallback` starts one bounded Playwright session, reuses it for listing and optional menu pages, blocks images/fonts/media, and closes it at the end of the run. Set it to `false` to disable only this final browser fallback.

For deterministic local QA, `fixtureFile` may point to an HTML file inside this Actor directory. Fixture mode never makes a network request and is not intended to bypass Swiggy access controls.

### Output

Restaurant records contain the public ID, name, canonical URL, city, locality, cuisines, pricing, ratings, delivery estimates, availability, badges, offers, image, and optional menu categories. Each normal record includes `source`, `provenance`, `sourcePageUrl`, `rank`, and `scrapedAt`; transport and extraction-stage metadata is retained only in the KVS summary.

If Swiggy returns a challenge, access-control response, non-success response, or no usable restaurant evidence, the dataset contains exactly four diagnostic fields: `url`, `error`, `errorCode`, and `scrapedAt`; the run still writes `OUTPUT`. Optional menu failures keep the restaurant with a source-backed `menuError`; run status remains in `OUTPUT`.

`OUTPUT` is a key-value run summary with counts, options, city, fixture mode, and overall status.

### Local checks

```powershell
npm ci --ignore-scripts
npm test
npm run lint
npm run schema
apify run --purge --input-file .actor/input.json
npm run validate
```

The checked-in input is offline and reproducible. Remove `fixtureFile` for a live public probe. The Actor does not log in, place orders, spoof fingerprints, solve CAPTCHA, bypass access controls, or access account data.

### Cloud checks

```powershell
apify push --wait-for-finish 600 --json
apify call <actor-id> --input '{"city":"Chennai","maxItems":2,"getMenus":false,"browserFallback":true,"timeoutSecs":15}' --memory 512 --timeout 120 --json
```

Keep cloud validation inputs bounded. Inspect the returned default dataset rather than relying only on the run status.

### Disclaimer

Use this Actor only for public information you are permitted to collect. Respect Swiggy terms, access controls, robots directives, copyright, privacy requirements, and applicable law. Public fields and URLs may change.

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

# Changelog

This Actor's version history is a separate document: https://apify.com/w3crawler/swiggy-delivery-scraper/changelog.md

# Actor input Schema

## `city` (type: `string`):

Indian city name used to build Swiggy's public city page URL.

## `maxItems` (type: `integer`):

Maximum source-backed restaurants to emit.

## `getMenus` (type: `boolean`):

Fetch a public restaurant page when menu data is not embedded in the listing response.

## `getAddons` (type: `boolean`):

Include source-backed menu add-on groups when available.

## `getVariants` (type: `boolean`):

Include source-backed menu variants when available.

## `browserFallback` (type: `boolean`):

Use one bounded reusable Playwright session when direct HTTPS returns a stripped or blocked public page.

## `timeoutSecs` (type: `integer`):

Timeout for each bounded public HTTPS request.

## `fixtureFile` (type: `string`):

Optional Actor-relative .html fixture for deterministic local QA. Fixture mode never makes a network request.

## Actor input object example

```json
{
  "city": "chennai",
  "maxItems": 10,
  "getMenus": true,
  "getAddons": true,
  "getVariants": true,
  "browserFallback": true,
  "timeoutSecs": 30
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/swiggy-delivery-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/swiggy-delivery-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call w3crawler/swiggy-delivery-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,w3crawler/swiggy-delivery-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/EFmvM1d2yZ8V4TdK5/builds/fCgsf6Aif5trA58ME/openapi.json
