# Walgreens Store Locator - Store Links & Coordinates Scraper (`datacach/walgreens-store-locations-sitemap-scraper`) Actor

Extracts Walgreens store page URLs and GPS coordinates for every US location from the public sitemap.

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

## Pricing

from $0.50 / 1,000 links

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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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

## Walgreens Store Locator - Store Links & Coordinates Scraper

**Extract every Walgreens store page URL in the United States** — straight from Walgreens' own public sitemap, with zero configuration required. This **Walgreens store locator scraper** returns a clean, deduplicated **JSON/CSV/Excel dataset** of ~8,000 store links in seconds, ready to feed into a downstream address/phone/hours enrichment pipeline.

### What is the Walgreens Store Locator Scraper?

The **Walgreens Store Locator - Store Links & Coordinates Scraper** is an Apify Actor that **extracts Walgreens store page URLs** for every US pharmacy location directly from Walgreens' publicly published [store-details sitemap](https://www.walgreens.com/sitemap-storedetails.xml). No search terms, ZIP codes, or coordinates are required to get the full list — just click **Start**. Each result includes the store's **URL** and an **extraction timestamp**, so you always know exactly when the data was collected.

### What can this Walgreens scraper do?

- 🔗 **Scrape all Walgreens store links** from the official sitemap in one run — roughly 8,000 US locations.
- 🧹 **Deduplicated output** — every store URL appears only once, even if the sitemap lists it more than once.
- 🕒 **Timestamped extraction** — every record carries `extraction_datetime` (UTC, ISO 8601) and `extraction_date` (`mm-dd-yyyy`) so you can track data freshness.
- ⏭️ **Resumable, pay-per-result-safe crawling** — a `startIndex` input lets you page through the sitemap across multiple runs, and `excludeUrls` lets you skip links you already collected, so you're never charged twice for the same store.
- 🔁 **Crash-safe resume** — if a run is migrated or restarted mid-crawl, already-pushed links are remembered and are not re-pushed (and not re-billed under pay-per-result).
- 📤 **Export to JSON, CSV, Excel, HTML, or XML** directly from the Apify dataset — no code required.
- 🔌 **Full Apify platform integration**: trigger runs via the **API** or **scheduler**, monitor runs and get alerted on failures, and connect the output to **Zapier, Make, Google Sheets**, and hundreds of other integrations.
- 🌐 **Built-in proxy rotation support** for reliable, large-scale sitemap fetching.
- 🤝 **Pairs with the [Walgreens Store Details Scraper](https://apify.com/datacach/walgreens-store-details-scraper)** — feed these links in to enrich each store with full address, phone number, opening hours, and geolocation.

### What data does the Walgreens Store Locator Scraper extract?

| Field | Description | Example |
|---|---|---|
| `url` | Walgreens store page URL, parsed from the sitemap | `https://www.walgreens.com/locator/duane+reade-1+path+plz-jersey+city-nj-07306/id=14303` |
| `coordinate` | Label identifying which source the link was discovered under | `static source` |
| `extraction_datetime` | UTC timestamp of extraction, ISO 8601 format | `2026-07-24T14:30:00.123456+00:00` |
| `extraction_date` | Extraction date, `mm-dd-yyyy` format | `07-24-2026` |

### How do I scrape Walgreens store links with this Actor?

<!-- TODO: embed a short demo video or GIF here, e.g. https://www.youtube.com/watch?v=XXXXXXXXXXX -->

1. Open the Actor's **Input** tab in Apify Console (or pass input via the **API**).
2. Leave `maxResults` at `0` to collect every store link in the sitemap, or set a small number (e.g. `10`) for a quick, cheap test run.
3. Optionally set `startIndex` to resume collection partway through the sitemap in a later run, and/or list already-collected links in `excludeUrls` so you don't pay for them again.
4. Click **Start**.
5. When the run finishes, open the **Output** tab (or call the Dataset API) and download the results as **JSON, CSV, Excel, HTML, or XML**.
6. Optionally, chain the output into the [**Walgreens Store Details Scraper**](https://apify.com/datacach/walgreens-store-details-scraper) to enrich each link with full store details.

### Input

<!-- TODO: screenshot of the Input tab / input schema form -->

This Actor's input is intentionally minimal — no start URLs, selectors, or search terms are needed since it reads the full public sitemap directly:

- **Max store links (`maxResults`)** — the maximum number of unique store links to collect. Leave at `0` to collect all ~8,000 links in the sitemap, or set a smaller number for a fast test run. Free-plan accounts are capped at 10 links regardless of this setting.
- **Start index / skip (`startIndex`)** — a positional offset that lets you resume collection after a given number of links have already been discovered, useful for paging through the full sitemap across several runs. Free-plan accounts always run with this forced to `0`.
- **Exclude URLs (`excludeUrls`)** — a list of store link URLs to skip regardless of their position, so you never pay again for links you already have from a previous run. Free-plan accounts are capped at 1 excluded URL.

Example input:

```json
{
    "maxResults": 0,
    "startIndex": 0,
    "excludeUrls": []
}
````

### Output example

Each item pushed to the dataset represents a single Walgreens store link:

```json
{
    "url": "https://www.walgreens.com/locator/ava+drug,+powered+by+walgreens-124+w+washington+ave-ava-mo-65608/id=15726",
    "coordinate": "static source",
    "extraction_datetime": "2026-07-24T14:30:00.123456+00:00",
    "extraction_date": "07-24-2026"
}
```

You can download the full dataset in various formats such as **JSON, CSV, Excel, HTML, or XML** from the Output tab or via the Dataset API.

### Use cases

- 🏪 **Build a master list of Walgreens store URLs** as the seed input for a detail-page scraper (address, phone, hours, geolocation).
- 🗺️ **Store locator data feeds** for pharmacy-comparison apps, healthcare directories, or delivery/logistics platforms.
- 📊 **Market research and location analysis** — track how many Walgreens locations exist and where.
- 🔁 **Incremental data pipelines** — use `startIndex` and `excludeUrls` to keep a store-link dataset in sync over time without re-collecting (and re-paying for) data you already have.
- 🔗 **Input for downstream Actors or scripts** that need a reliable, deduplicated list of Walgreens store page URLs.

### Walgreens-related Actors

- **Walgreens Store Metadata Actor** — takes store links (like the ones this Actor produces) and extracts full address, phone number, opening hours, and geolocation for each store.

### FAQ

#### Is it legal to scrape Walgreens store data?

This Actor only reads data that Walgreens **already publishes publicly** for search engines — the [store-details XML sitemap](https://www.walgreens.com/sitemap-storedetails.xml). No login, paywall, or private data is involved. That said, scraping legality can depend on your jurisdiction and intended use, and you're responsible for reviewing Walgreens' Terms of Service before using the data. Apify's [legal analysis of web scraping](https://www.apify.com/legal-analysis-of-web-scraping) is a good starting reference.

#### Where does the data come from?

All store links come from a single public XML file published by Walgreens at `https://www.walgreens.com/sitemap-storedetails.xml`. This is the same sitemap search engines like Google use to discover Walgreens store pages — nothing is scraped from behind a login or paywall.

#### How many Walgreens stores does this Actor return?

The Walgreens sitemap currently lists roughly 8,000 US store locations. A full run (with `maxResults` left at `0`) returns every unique link found in the sitemap at run time.

#### Can I run this Actor on a schedule or via the API?

Yes. Like any Apify Actor, you can trigger it via the **Apify API**, set up a recurring **schedule**, and get **run-failure monitoring** — all from the Apify Console, no extra setup required.

#### What happens if the run is interrupted partway through?

The Actor persists already-collected links to the run's key-value store as it goes. If the run is migrated or restarted, it resumes from where it left off instead of re-pushing (and re-billing) links it already collected.

#### Does this Actor return full store details like address and phone number?

No — this Actor focuses on collecting **store page URLs** only, quickly and cheaply. For full address, phone, hours, and geolocation data, feed these links into the companion [**Walgreens Store Details Scraper**](https://apify.com/datacach/walgreens-store-details-scraper).

### Support

Found a bug or have a feature request? Open an issue on the Actor's **Issues** tab in Apify Console. Need a custom scraper or a modified version of this Actor for your use case? Reach out through Apify Console to discuss a custom solution.

# Actor input Schema

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

Maximum number of unique store links to collect. Leave at <strong>0</strong> to collect every store in the sitemap (~8,000 links). Set a smaller number (e.g. <strong>10</strong>) for a quick, cheap test run before scaling up. Note: accounts on the free plan are capped at 10 links regardless of this setting.

## `startIndex` (type: `integer`):

Positional skip — resume collection starting after this many store links have already been discovered, so you can page through the sitemap across multiple runs instead of re-collecting from the start. For example, set <strong>10</strong> to skip the first 10 links found. Leave at <strong>0</strong> to start from the beginning. Note: accounts on the free plan always run with this forced to <strong>0</strong>.

## `excludeUrls` (type: `array`):

Store link URLs to skip, regardless of their position in the sitemap — use this to avoid paying again for links you already collected in a previous run. Order doesn't matter. Note: accounts on the free plan are capped at 1 excluded URL regardless of how many are listed here.

## Actor input object example

```json
{
  "maxResults": 10,
  "startIndex": 0,
  "excludeUrls": []
}
```

# 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": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("datacach/walgreens-store-locations-sitemap-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": 10 }

# Run the Actor and wait for it to finish
run = client.actor("datacach/walgreens-store-locations-sitemap-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": 10
}' |
apify call datacach/walgreens-store-locations-sitemap-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Walgreens Store Locator - Store Links & Coordinates Scraper",
        "description": "Extracts Walgreens store page URLs and GPS coordinates for every US location from the public sitemap.",
        "version": "0.0",
        "x-build-id": "wzgQGAdscTaJFtiw4"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datacach~walgreens-store-locations-sitemap-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datacach-walgreens-store-locations-sitemap-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~walgreens-store-locations-sitemap-scraper/runs": {
            "post": {
                "operationId": "runs-sync-datacach-walgreens-store-locations-sitemap-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~walgreens-store-locations-sitemap-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-datacach-walgreens-store-locations-sitemap-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 store links",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of unique store links to collect. Leave at <strong>0</strong> to collect every store in the sitemap (~8,000 links). Set a smaller number (e.g. <strong>10</strong>) for a quick, cheap test run before scaling up. Note: accounts on the free plan are capped at 10 links regardless of this setting.",
                        "default": 0
                    },
                    "startIndex": {
                        "title": "Start index (skip)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Positional skip — resume collection starting after this many store links have already been discovered, so you can page through the sitemap across multiple runs instead of re-collecting from the start. For example, set <strong>10</strong> to skip the first 10 links found. Leave at <strong>0</strong> to start from the beginning. Note: accounts on the free plan always run with this forced to <strong>0</strong>.",
                        "default": 0
                    },
                    "excludeUrls": {
                        "title": "Exclude URLs",
                        "type": "array",
                        "description": "Store link URLs to skip, regardless of their position in the sitemap — use this to avoid paying again for links you already collected in a previous run. Order doesn't matter. Note: accounts on the free plan are capped at 1 excluded URL regardless of how many are listed here.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
