# Subway Store Locator Scraper (`datacach/subway-store-locator-scraper`) Actor

Scrape all Subway US restaurant locations from the official store locator. Crawls the restaurants.subway.com state/city directory and outputs every restaurant page URL as structured data.

- **URL**: https://apify.com/datacach/subway-store-locator-scraper.md
- **Developed by:** [DataCach](https://apify.com/datacach) (community)
- **Categories:** Automation, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.99 / 1,000 stores

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Subway Store Locator Scraper

Extract every **Subway restaurant location URL** in the United States from the official Subway store locator — no coordinates, no API key, no code required.

### What is Subway Store Locator Scraper?

**Subway Store Locator Scraper** is a fast, zero-configuration **web scraper** that collects the page link of every **Subway restaurant in the US** by crawling the public [Subway restaurant directory](https://restaurants.subway.com/united-states). It walks the directory's **state → city → restaurant** hierarchy and returns each location's URL as clean, deduplicated **JSON data** you can **export to CSV, Excel, or JSON**.

This Actor is the **discovery layer** of a two-step Subway data pipeline: it builds the complete list of restaurant pages, which you then feed into a metadata scraper to extract full details for each store. Run it with a single click — the only optional input is a result limit.

<!-- TODO: add a demo video URL on its own line here (videos improve search ranking) -->

### What can Subway Store Locator Scraper do?

- 🗺️ **Scrape the full US Subway store locator** — every state, every city, every restaurant page URL.
- ⚡ **Runs without any input** — click Start and it crawls the entire public directory.
- 🔢 **Limit your results** — cap the run with a single `Max restaurant links` field for fast, cheap test runs.
- 🧹 **Automatic deduplication** — each restaurant URL appears exactly once in the dataset.
- 📤 **Export Subway data as JSON, CSV, Excel, HTML, or XML** straight from the Output tab.
- 🔌 **Full REST API access** — start runs and pull results programmatically from **Python**, **JavaScript**, or any HTTP client via the Apify API.
- ⏰ **Schedule recurring runs** to keep your Subway location list fresh as stores open and close.
- 📊 **Monitoring and alerts** built into the Apify platform, so you know immediately if a run fails.
- 🔗 **Integrations with Zapier, Make, Google Sheets, Slack, and webhooks** — push new restaurant links straight into your own stack.
- 🌐 **Proxy rotation support** through Apify Proxy for reliable, uninterrupted crawling.

### What data does Subway Store Locator Scraper extract?

Each dataset item represents one Subway restaurant page discovered in the store locator:

| Field | Type | Description |
|---|---|---|
| `url` | string | Full URL of the Subway restaurant page on `restaurants.subway.com`, including state, city, and street slug |
| `coordinate` | string | How the link was discovered. This Actor crawls the static directory, so the value is `static source` |

The `url` field encodes useful location data on its own — state code, city, and street address all appear in the slug, so you can parse a rough location breakdown without any extra requests.

### How do I scrape Subway restaurant locations?

1. Open the Actor and go to the **Input** tab.
2. *(Optional)* Set **Max restaurant links** to a small number such as `100` for a quick first run, or leave it at `0` to scrape the **entire US Subway directory**.
3. Click **Start** and watch the log as the scraper walks the state and city directory pages.
4. When the run finishes, open the **Output** tab and **download your Subway restaurant data** as JSON, CSV, or Excel — or fetch it through the Apify API.
5. *(Optional)* Feed the collected URLs into the **Subway Restaurant Metadata** Actor to extract addresses, phone numbers, geolocation, and opening hours for each store.

<!-- TODO: screenshot of the Actor input form — save as subway-store-locator-scraper-input.png with alt text "Subway Store Locator Scraper input form on Apify" -->

### Input

The Actor is designed to run with **no configuration at all**. There is a single optional input:

- **Max restaurant links** (`maxResults`) — the maximum number of unique restaurant URLs to collect. Set it to `0` for **unlimited**, which crawls the whole directory and returns roughly 20,000 US locations. A small value keeps test runs quick. Accounts on the Apify free plan are capped at 10 links per run.

Example input:

```json
{
  "maxResults": 100
}
````

### Output example

Every item in the dataset is one Subway restaurant link:

```json
{
  "url": "https://restaurants.subway.com/united-states/al/abbeville/644-ozark-road",
  "coordinate": "static source"
}
```

A run returns a list of these records, which you can **download in JSON, CSV, Excel, HTML, or XML format** from the Output tab, or retrieve through the dataset API endpoint.

### Use cases

- 🍽️ **Restaurant location intelligence** — build a complete map of Subway's US footprint for market and territory analysis.
- 📈 **Competitive analysis** — compare Subway's store density against other QSR chains by state or city.
- 🏢 **Site selection and real estate research** — identify underserved cities or saturated markets before opening a new location.
- 🔄 **Data pipelines** — use these URLs as the input list for a metadata scraper that extracts addresses, hours, and phone numbers.
- 📰 **Store opening and closing tracking** — schedule recurring runs and diff the results to detect new or removed restaurants.
- 🎓 **Academic and journalistic research** on fast-food distribution, food access, and franchise growth.
- 🤖 **Enriching internal datasets** — join Subway locations with your own delivery, logistics, or CRM data.

### Subway and restaurant-related Actors

| Actor | What it does |
|---|---|
| **Subway Restaurant Metadata** | Takes the URLs from this Actor and extracts full restaurant details — address, phone, geolocation, and opening hours |
|  | |

### FAQ

#### Is it legal to scrape Subway restaurant data?

This Actor collects only **publicly available information** from the same public directory pages that Subway serves to any visitor. It does not collect personal data and does not access anything behind a login. That said, laws and Terms of Service vary by jurisdiction and use case — if you plan to use the data commercially, review Subway's Terms of Service and consult legal counsel. For general guidance, see Apify's [ethical web scraping resources](https://blog.apify.com/is-web-scraping-legal/).

#### How many Subway locations will this scraper return?

With **Max restaurant links** set to `0`, the Actor crawls the entire US directory, which currently contains roughly **20,000 restaurant pages**. Set a lower limit if you only need a sample.

#### Can I get Subway restaurant addresses and opening hours?

Not from this Actor — it returns **restaurant page URLs only**. Pair it with the **Subway Restaurant Metadata** Actor, which takes these URLs and extracts the address, phone number, geolocation, and hours for each store.

#### Can I use this Subway scraper through an API?

Yes. Every Apify Actor exposes a **REST API**, so you can start runs and download results from **Python**, **JavaScript**, or any HTTP client. Official API clients are available for both languages, and you can also trigger runs on a **schedule** or through **Zapier, Make, and webhook integrations**.

#### Why did my run return no links?

The most common cause is anti-bot blocking on the target site. Blocked requests are logged as warnings, and the run fails only if **no links at all** were collected. If this happens, retry the run, or enable **Apify Proxy** with residential proxies for more reliable access.

#### Can I scrape Subway locations outside the United States?

Not currently. This Actor targets the **US store directory** at `restaurants.subway.com/united-states`. If you need another country, open an issue and it can be considered for a future version.

### Support

Found a bug, or is a field missing from the output? Open a ticket on the **Issues tab** of this Actor — issues are monitored and addressed as quickly as possible.

Need a **custom scraping solution**, a different output format, or coverage for another restaurant chain? Get in touch through the Issues tab and describe what you need.

# Actor input Schema

## `maxResults` (type: `integer`):

Maximum number of unique restaurant page links to collect. Set to <b>0</b> for unlimited — the Actor then crawls the entire state → city → store directory and returns every US Subway location (roughly 20,000 links, which takes longer and costs more). A small value like <b>100</b> is ideal for a quick first run. On the free plan this is capped at 10 links regardless of the value entered.

## Actor input object example

```json
{
  "maxResults": 100
}
```

# Actor output Schema

## `dataset` (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 = {
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("datacach/subway-store-locator-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 = { "maxResults": 100 }

# Run the Actor and wait for it to finish
run = client.actor("datacach/subway-store-locator-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "maxResults": 100
}' |
apify call datacach/subway-store-locator-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datacach/subway-store-locator-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Subway Store Locator Scraper",
        "description": "Scrape all Subway US restaurant locations from the official store locator. Crawls the restaurants.subway.com state/city directory and outputs every restaurant page URL as structured data.",
        "version": "0.0",
        "x-build-id": "wJvgnYZ9jRVfWVDrW"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datacach~subway-store-locator-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datacach-subway-store-locator-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/datacach~subway-store-locator-scraper/runs": {
            "post": {
                "operationId": "runs-sync-datacach-subway-store-locator-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/datacach~subway-store-locator-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-datacach-subway-store-locator-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "maxResults": {
                        "title": "Max restaurant links",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of unique restaurant page links to collect. Set to <b>0</b> for unlimited — the Actor then crawls the entire state → city → store directory and returns every US Subway location (roughly 20,000 links, which takes longer and costs more). A small value like <b>100</b> is ideal for a quick first run. On the free plan this is capped at 10 links regardless of the value entered.",
                        "default": 0
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
