# store-locator-monitor (`make100/store-locator-monitor`) Actor

Turn any chain's store locator into clean location data: names, addresses, phone numbers, coordinates, and opening hours. Runs daily checks for new openings, closures, and updates. Works with hundreds of Yext Pages locators, like Petco, Taco Bell, and Advance Auto Parts.

- **URL**: https://apify.com/make100/store-locator-monitor.md
- **Developed by:** [Ben Purvis](https://apify.com/make100) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 store location scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Store Locator Monitor (Apify Actor)

Crawls a chain's **Yext Pages** store locator and outputs every location as
normalized JSON — then diffs against the previous run and emits
`store.opening` / `store.closing` / `store.updated` events.

### What it extracts

| Field | Example |
|---|---|
| `id` | Yext entity id (stable across runs) |
| `name` | `Petco` |
| `phone` | `+15735146404` |
| `address` | line1/line2, city, region, postalCode, country |
| `latitude`, `longitude` | when the source exposes them |
| `hours` | full open-interval JSON per weekday |
| `sourceUrl` | the locator URL crawled |

### Sample input

```json
{
  "locatorUrls": ["https://stores.petco.com"],
  "maxLocations": 1000,
  "diffEnabled": true,
  "crawlDelaySec": 1
}
```

### Sample output (locations dataset)

```json
{
  "id": "2636",
  "brand": "Petco",
  "name": "Petco",
  "phone": "+15735146404",
  "line1": "400 N Stadium Blvd",
  "city": "Columbia",
  "region": "MO",
  "postalCode": "65203",
  "hours": "{\"monday\": {\"openIntervals\": [{\"end\": \"21:00\", \"start\": \"09:00\"}]}, ...}"
}
```

### Use cases

1. **Commercial real estate**: monitor retail footprints — new openings and
   closures by brand, city, or state.
2. **Market research**: track chain expansion rates over time.
3. **Competitive intelligence**: get an alert the day a competitor opens
   near your market.

### Honest limits (v1)

- **Yext Pages locators only** in v1 (hundreds of brands: Petco, and most
  retail/food brands using Yext Listings). The actor auto-detects the
  pattern; non-Yext locators are skipped with a clear log message.
- Latitude/longitude depend on what the source page exposes; some brands
  include them only on detail pages.
- Politeness delay defaults to 1s — a full ~10k-location brand takes a few
  hours by design. Raise `crawlDelaySec` for polite crawling of small sites.

### Development

- `src/extract.py` — pure parsing (offline-testable)
- `main.py` — crawl + diff + storage
- Test locally: `python3 -c "import sys; sys.path.insert(0,'src'); from extract import extract_directory_children; print(len(extract_directory_children(open('page.html').read())))"`

# Actor input Schema

## `locatorUrls` (type: `array`):

Base URLs of the store locators to monitor. Example: https://stores.petco.com

## `maxLocations` (type: `integer`):

Safety cap on location pages fetched per brand. Set high for full runs.

## `diffEnabled` (type: `boolean`):

Compare against the last stored snapshot and emit store.opening / store.closing / store.updated events. First run always stores the baseline.

## `crawlDelaySec` (type: `integer`):

Politeness delay between page fetches. Keep >= 1 for large brands.

## Actor input object example

```json
{
  "locatorUrls": [
    "https://stores.petco.com"
  ],
  "maxLocations": 1000,
  "diffEnabled": true,
  "crawlDelaySec": 1
}
```

# Actor output Schema

## `locations` (type: `string`):

One dataset item per store location: id, brand, name, phone, address, coordinates, opening hours, and source URL. Change events (store.opening, store.closing, store.updated) appear in the same dataset when diffEnabled is on.

# 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 = {
    "locatorUrls": [
        "https://stores.petco.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("make100/store-locator-monitor").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 = { "locatorUrls": ["https://stores.petco.com"] }

# Run the Actor and wait for it to finish
run = client.actor("make100/store-locator-monitor").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 '{
  "locatorUrls": [
    "https://stores.petco.com"
  ]
}' |
apify call make100/store-locator-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,make100/store-locator-monitor"
        }
    }
}
```

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/cAllGBGhtqAn32HQz/builds/nZfcVwmYuDsU6zCTi/openapi.json
