# Swiggy Public Restaurant Scraper (`w3crawler/swiggy-restaurant-scraper`) Actor

Extract normalized restaurant records from public Swiggy pages and endpoints without login or private access.

- **URL**: https://apify.com/w3crawler/swiggy-restaurant-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 Restaurant Scraper

Extract normalized public restaurant records from Swiggy city, restaurant, JSON, or JSON-LD pages. The Actor uses bounded direct HTTPS, filters records to official Swiggy URLs, deduplicates identities, and reports access boundaries as diagnostics.

On Apify, runs can be called through the API, scheduled, monitored, and connected to downstream datasets and integrations. The default uses Swiggy's public same-domain restaurant listing JSON endpoint for Bangalore because the corresponding city HTML page may return an AWS WAF interstitial.

### Why use Swiggy Public Restaurant Scraper?

Use it for restaurant discovery, cuisine and price analysis, locality coverage, delivery-time snapshots, public ratings research, and directory enrichment. Hard page and item limits keep scheduled runs predictable and source URLs make every row traceable.

### How to use Swiggy Public Restaurant Scraper

1. Open the Actor Input tab.
2. Keep the default endpoint for a quick Bangalore test or provide another public Swiggy URL.
3. Set a small `maxItems` while validating your input.
4. Start the run and inspect normal rows, diagnostics, and `OUTPUT`.
5. Export results or connect the dataset through the Apify API.

### Input

```json
{
  "startUrls": [{ "url": "https://www.swiggy.com/dapi/restaurants/list/v5?lat=12.9716&lng=77.5946&is-seo-homepage-enabled=true&page_type=DESKTOP_WEB_LISTING" }],
  "maxItems": 25,
  "maxPages": 1,
  "followPagination": false,
  "requestDelayMs": 600,
  "maxConcurrency": 1,
  "fixtureFile": "fixtures/sample.html"
}
```

`startUrls` accepts 1–50 public HTTPS Swiggy URLs. `maxItems` accepts 1–1000 and `maxPages` accepts 1–100. Pagination is disabled by default. Requests are sequential and bounded; `maxConcurrency` remains a compatibility input and is not used to fan out requests.

For deterministic local QA, `fixtureFile` may point to an HTML file inside this Actor directory. Fixture mode never makes a network request. Remove it for a live public probe.

### Output

Restaurant records include public IDs, names, canonical URLs, descriptions, images, brands/categories, cuisines, prices, ratings, reviews, locations, delivery hints, and a bounded `data` projection. Each normal row contains source/provenance, rank, and timestamp fields; transport and extraction-stage details stay in `OUTPUT`.

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

### Main data fields

| Field | Meaning |
| --- | --- |
| `restaurantId`, `name`, `restaurantUrl` | Public identity and canonical restaurant URL |
| `cuisines`, `costForTwo` | Published cuisine and price information |
| `rating`, `reviewCount` | Public rating snapshot |
| `locality`, `deliveryTime` | Service-area and delivery estimate |
| `sourceUrl`, `provenance`, `scrapedAt` | Traceability metadata |

When the public page is blocked, unsupported, empty, or redirected outside Swiggy, the Actor emits exactly four diagnostic fields (`url`, `error`, `errorCode`, and `scrapedAt`) and still writes `OUTPUT`. It does not invent records to satisfy a limit.

### 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 Actor does not use a browser, proxy, login, private account data, order placement, or CAPTCHA bypass.

### How much does it cost to scrape Swiggy restaurants?

This HTTP-only Actor avoids browser startup costs. Actual cost depends on pages, response size, and run frequency. Keep `maxPages` and `maxItems` bounded, test one page first, and schedule only as often as the data needs to be refreshed.

### Tips and limitations

Prefer Swiggy's public JSON endpoints when a city HTML page reports `BLOCKED_SOURCE`. Coordinates determine the returned delivery area, and page structures may change. A diagnostic row is an access report, not restaurant data.

### FAQ, disclaimer, and support

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 page structure and fields may change.

When reporting an issue, include the run ID, public input URL, and diagnostic code in the Actor Issues tab. Custom solutions can build on the dataset while preserving the same public-access boundaries.

# Actor input Schema

## `startUrls` (type: `array`):

Public HTTPS Swiggy city, restaurant, JSON, or JSON-LD pages.

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

Hard result limit for a bounded run.

## `maxPages` (type: `integer`):

Maximum public pages requested when pagination is enabled.

## `followPagination` (type: `boolean`):

Follow same-host rel=next links up to maxPages.

## `requestDelayMs` (type: `integer`):

Polite delay between direct public requests.

## `maxConcurrency` (type: `integer`):

Retained for input compatibility; direct requests run sequentially for bounded load.

## `userAgent` (type: `string`):

Optional consistent user agent for public requests.

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

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

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.swiggy.com/dapi/restaurants/list/v5?lat=12.9716&lng=77.5946&is-seo-homepage-enabled=true&page_type=DESKTOP_WEB_LISTING"
    }
  ],
  "maxItems": 25,
  "maxPages": 1,
  "followPagination": false,
  "requestDelayMs": 600,
  "maxConcurrency": 1
}
```

# 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-restaurant-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-restaurant-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-restaurant-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,w3crawler/swiggy-restaurant-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/kekIVqJdw4zjTeDjp/builds/BEsRuYclYsZlhudhl/openapi.json
