# Business Change Monitor: closures, hours, contacts (`satelink/business-change-monitor`) Actor

Monitor PUBLIC business listings and get an event the moment one closes, moves, or changes hours, phone, website, or category. Pay only per detected change.

- **URL**: https://apify.com/satelink/business-change-monitor.md
- **Developed by:** [Satelink](https://apify.com/satelink) (community)
- **Categories:** Business
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 business checkeds

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?

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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Local Business Closure & Change Monitor (OSM)

**Monitor local businesses for closures and changes.** Get a structured event the moment a
business **closes, moves, or changes its hours, phone, address, website, or category** —
sourced from **OpenStreetMap** (free, public, datacenter-friendly). Point it at a list of
businesses or a whole city/region, run it daily or weekly. Billing is **pay-per-event**: a
small **`business_checked`** fee for every business checked each run, plus **`change_detected`**
when something actually changes (see [Billing](#billing)).

### What it does

1. **Fetch** current public data for each business.
2. **Normalize** to one shape regardless of source.
3. **Snapshot** to the key-value store, keyed by business id.
4. **Diff** against the previous snapshot.
5. **Bill + emit**: charge one `business_checked` per business checked, and emit + charge
   one `change_detected` per real change (`changed_field`, `old_value`, `new_value`,
   `confidence`, `detected_at`).

> **No-change runs still produce a dataset item.** If a run detects zero changes, it
> writes exactly one status item — `{ status: 'no_changes', businesses_checked, source,
> checked_at }` — to the default dataset. This item is **not billed** as `change_detected`;
> it exists only so the dataset is never empty. Don't be surprised to see it mixed in with
> real change events.

### Data source & the margin rule

Default source is **OpenStreetMap (Overpass API)** — free, **datacenter-proxy-friendly,
no anti-bot**. That matters: **residential proxy (~$12.5/GB) is the #1 thing that kills
margin** on a change-monitor. This Actor ships a **pre-flight margin guard** that
estimates cost vs revenue *before* doing any work and **rejects** any run projected
below the margin floor (default 50%), logging which cost driver dominated. Only **public
business listings** are read — no login-gated data, no personal-data resale, no anti-bot
circumvention.

### Billing

**Pay-per-event only** — two events, no rental, no flat fee, no other payment method (as
required by the Apify Store):

- **`business_checked`** — **$0.0005** per business checked, **every run**, whether or not it changed.
- **`change_detected`** — **$0.02** per change found.

For example, a **2,000-business weekly run costs $1.00 in check fees** (2,000 × $0.0005)
**plus $0.02 per change found**.

### Input (`.actor/INPUT_SCHEMA.json`)

- `urls_or_businesses` — OSM ids (`node/123`, `way/456`), 500–10,000; or leave empty and set…
- `region_bbox` — `"south,west,north,east"` to auto-discover a whole area
- `osm_category_filter` — one vertical, e.g. `amenity=restaurant`, `amenity=cafe`, `shop=hairdresser`
- `monitoring_interval` — `daily` | `weekly` (drives the guard's expected change rate)
- `change_types` — any of `rating, review_count, hours, phone, address, website, category, disappeared`
- `price_per_event_usd`, `price_per_business_checked_usd`, `margin_floor` — guard tunables

> Pick **one vertical × one region** (e.g. *independent cafés in Austin*). General-purpose
> is a crowded, low-margin category.

### Modes

- **Scheduled run** (default): batch-check a list/region, emit changes.
- **Standby** (low-RAM HTTP): `GET /?id=node/123&category=amenity=restaurant&change_types=hours,phone`
  for on-demand single-business checks — billed on RAM × wall-clock, cheap when idle.

### Local dev

```bash
npm install && npm run build
node test/margin_guard.mjs      # margin-guard unit tests (no platform needed)
```

# Actor input Schema

## `urls_or_businesses` (type: `array`):

Business identifiers to monitor. For the OpenStreetMap source these are OSM element ids like "node/123456", "way/987654". Leave empty and set region\_bbox to auto-discover all matching businesses in an area (500–10,000).

## `source` (type: `string`):

PUBLIC listing source. OpenStreetMap (Overpass) is free and datacenter-proxy-friendly — no residential proxy needed, which is what keeps margin intact.

## `region_bbox` (type: `string`):

"south,west,north,east" lat/lon. If set, auto-discovers matching businesses in this area instead of (or in addition to) an explicit id list. Example: "30.20,-97.80,30.35,-97.68" (Austin, TX core).

## `osm_category_filter` (type: `string`):

Narrow the niche. e.g. "amenity=restaurant", "amenity=cafe", "shop=hairdresser". Pick ONE vertical × region — general-purpose is a crowded, low-margin category.

## `monitoring_interval` (type: `string`):

How often you intend to schedule this Actor. Used to estimate the expected change rate for the pre-flight margin guard.

## `change_types` (type: `array`):

Which field changes should produce (and bill) an event. rating/review\_count are unavailable on sources without reviews (e.g. OSM) and are silently skipped there.

## `price_per_event_usd` (type: `string`):

Your 'change\_detected' pay-per-event price. Used by the pre-flight margin guard. Must exceed per-business cost by the margin floor.

## `price_per_business_checked_usd` (type: `string`):

Your 'business\_checked' pay-per-event price. Every business actually checked earns this, even when nothing changed, so a no-change run still earns. Fed into the pre-flight margin guard's revenue estimate.

## `margin_floor` (type: `string`):

The run is REJECTED before doing any work if projected margin falls below this. Default 0.50 = reject anything under 50% margin.

## Actor input object example

```json
{
  "urls_or_businesses": [
    "node/1",
    "node/2"
  ],
  "source": "osm-overpass",
  "osm_category_filter": "amenity=restaurant",
  "monitoring_interval": "weekly",
  "change_types": [
    "hours",
    "phone",
    "address",
    "website",
    "category",
    "disappeared"
  ],
  "price_per_event_usd": "0.02",
  "price_per_business_checked_usd": "0.0005",
  "margin_floor": "0.50"
}
```

# Actor output Schema

## `changes` (type: `string`):

Dataset of change\_detected events emitted by the run.

# 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 = {
    "urls_or_businesses": [
        "node/1",
        "node/2"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("satelink/business-change-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 = { "urls_or_businesses": [
        "node/1",
        "node/2",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("satelink/business-change-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 '{
  "urls_or_businesses": [
    "node/1",
    "node/2"
  ]
}' |
apify call satelink/business-change-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,satelink/business-change-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/avx3k4hQoIihkfrcX/builds/vLkVt8ehvekzEmRLc/openapi.json
