# Website Change Monitor — Pricing, Content & Sitemap Diff (`memo23/website-change-monitor`) Actor

Fast HTTP/Cheerio competitor pricing, website content, and sitemap change monitor for scheduled runs. Tracks CSS selectors, JSON-LD & table prices with numeric deltas, line/field diffs, new or removed sitemap URLs, and sends HMAC Webhook & Telegram alerts.

- **URL**: https://apify.com/memo23/website-change-monitor.md
- **Developed by:** [Muhamed Didovic](https://apify.com/memo23) (community)
- **Categories:** Automation, E-commerce
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 page or sitemap checkeds

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/actors/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

## Website Change Monitor — Competitor Pricing, Content & Sitemap Diff

Lightweight, ultra-fast **HTTP + Cheerio** monitor built for **scheduled daily or hourly Apify runs**. Track competitor pricing tables, JSON-LD product offers, targeted CSS selectors, landing-page copy, and `sitemap.xml` publishing activity — with persistent snapshot storage, noise suppression, structured numeric price deltas, and instant **Webhook (HMAC-SHA256)** or **Telegram** alerts.

No headless browsers. No wasted compute. Margin-protecting pay-per-event pricing designed for continuous monitoring at scale.

***

### Monitor Modes

Choose your workflow from the top-level **Monitor Mode** dropdown:

1. **`Content & Pricing Diff ($1/1k checks + $5/1k changes)`** *(Default)*
   Fetches each target URL over fast HTTP (`impit` with Chrome TLS fingerprinting + `got-scraping` fallback), extracts your targeted `cssSelectors` alongside JSON-LD prices, pricing tables, `<title>`, meta description, `<h1>`/`<h2>` headings, and readable body text, strips dynamic noise via `ignoreRegexPatterns`, hashes normalized content, and compares against the previous snapshot. Emits field-level diffs, line-level diffs, and numeric price deltas (`oldPrice`, `newPrice`, `priceDelta`, `priceDeltaPct`).
2. **`Sitemap New/Removed Pages ($1/1k sitemaps + $5/1k new URLs)`**
   Parses standard `<urlset>` sitemaps, recursive `<sitemapindex>` files, and gzipped `.xml.gz` sitemaps (auto-discovered from `robots.txt` and `/sitemap.xml` when `sitemapUrls` is omitted). Compares against the prior URL set and outputs every **newly published** competitor page (`sitemap_url_added`) and **removed** URL (`sitemap_url_removed`).
3. **`Full Page + Pricing + Sitemap ($2/1k checks + $5/1k changes)`**
   Runs both Content & Pricing Diff and Sitemap New/Removed Pages in one scheduled run.

***

### Key Features

- **Numeric Price Delta Tracking:** Automatically parses international currencies (`$`, `€`, `£`, `CHF`, `¥`, `₹`, `USD`, `EUR`, `GBP`, `AUD`, `CAD`, etc.) from custom CSS selectors, JSON-LD `Offer`/`Product` blocks, and pricing tables — outputting `oldPrice`, `newPrice`, `priceDelta`, and `priceDeltaPct`.
- **Zero False Positives:** Strip dynamic timestamps, build hashes, CSRF tokens, or nonces with `ignoreRegexPatterns`, and filter minor text churn with `minChangeChars` (while numeric price changes always bypass the character threshold so `$49` → `$59` is never missed).
- **Persistent State Out of the Box:** Stores previous snapshots in a named Apify Key-Value Store (`stateStoreName`, default `website-change-monitor-state`) so scheduled runs automatically compare against the prior run — or plug in your own **BYO MongoDB** (`mongoDbConnectionString`).
- **Clean Change-Only Datasets:** Outputs baseline rows on the first run (`emitBaseline: true`), then suppresses unchanged rows (`emitUnchanged: false`) on subsequent scheduled runs so downstream automations only receive real diffs.
- **Built-In Alerts:** Delivers instant notifications on real changes to any **HTTP Webhook** (custom backend, Make, Zapier, n8n, Slack, or Discord) with optional **HMAC-SHA256** signing (`X-Monitor-Signature-256`), plus optional **Telegram Bot** alerts.

***

### Input Reference

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `monitorMode` | `string` | `Content & Pricing Diff ($1/1k checks + $5/1k changes)` | Monitoring mode dropdown (`Content & Pricing Diff`, `Sitemap New/Removed Pages`, or `Full Page + Pricing + Sitemap`). |
| `urls` | `string[]` | `["https://example.com"]` | Page URLs to monitor. Also accepts objects `{ url, label, selectors, sitemapUrl }` or `startUrls` via API. |
| `sitemapUrls` | `string[]` | `[]` | Explicit sitemap XML URLs (auto-discovered from `urls` when omitted). |
| `cssSelectors` | `object` | `{}` | Map of named CSS selectors, e.g. `{"proPrice": ".pricing-pro .amount"}`. |
| `monitorOnlySelectors` | `boolean` | `false` | Hash and diff only named `cssSelectors` + prices instead of full page text. |
| `ignoreRegexPatterns` | `string[]` | `[]` | Regex patterns stripped before hashing/diffing to ignore timestamps, nonces, or tokens. |
| `minChangeChars` | `integer` | `10` | Minimum changed characters to flag pure text changes (numeric price changes always trigger). |
| `emitUnchanged` | `boolean` | `false` | Output unchanged pages on subsequent runs after baseline capture. |
| `emitBaseline` | `boolean` | `true` | Output baseline snapshot row on the very first run for a URL or sitemap. |
| `stateStoreName` | `string` | `website-change-monitor-state` | Named Apify Key-Value Store for cross-run snapshot persistence. |
| `mongoDbConnectionString` | `string` *(secret)* | `""` | Optional BYO MongoDB connection URI (replaces KV Store persistence). |
| `webhookUrl` | `string` *(secret)* | `""` | Optional HTTP/Slack/Discord webhook URL called when changes are detected. |
| `webhookSecret` | `string` *(secret)* | `""` | Optional HMAC-SHA256 secret sent as `X-Monitor-Signature-256: sha256=<hex>`. |
| `telegramBotToken` | `string` *(secret)* | `""` | Optional Telegram Bot API token for instant change alerts. |
| `telegramChatId` | `string` | `""` | Target Telegram chat or channel ID. |
| `maxConcurrency` | `integer` | `5` | Parallel checks (1–25). |
| `requestTimeoutSecs` | `integer` | `25` | HTTP timeout per request in seconds. |
| `proxy` | `object` | `{ "useApifyProxy": false }` | Optional proxy configuration for protected sites. |

***

### Output Examples

#### 1. Competitor Pricing & Content Change

```json
{
    "recordType": "page",
    "status": "changed",
    "changeType": "price_and_content_changed",
    "url": "https://competitor.example/pricing",
    "finalUrl": "https://competitor.example/pricing",
    "label": "Competitor Pricing",
    "httpStatus": 200,
    "checkedAt": "2026-11-27T09:00:00.000Z",
    "previousCheckedAt": "2026-11-26T09:00:00.000Z",
    "firstSeenAt": "2026-11-20T09:00:00.000Z",
    "checkCount": 8,
    "oldPrice": 49,
    "newPrice": 59,
    "currency": "USD",
    "priceDelta": 10,
    "priceDeltaPct": 20.41,
    "selectorValues": {
        "proPrice": "$59/mo",
        "headline": "Simple Pricing for Growing Teams"
    },
    "priceChanges": [
        {
            "key": "selector:proPrice",
            "label": "proPrice",
            "source": "selector",
            "currency": "USD",
            "oldPrice": 49,
            "newPrice": 59,
            "priceDelta": 10,
            "priceDeltaPct": 20.41,
            "direction": "increased"
        }
    ],
    "fieldChanges": [
        {
            "field": "selector.proPrice",
            "changeType": "modified",
            "oldValue": "$49/mo",
            "newValue": "$59/mo"
        }
    ],
    "addedLines": ["Pro Plan — $59/mo (includes AI Copilot)"],
    "removedLines": ["Pro Plan — $49/mo"],
    "totalChangedChars": 58,
    "unifiedDiff": "- Pro Plan — $49/mo\n+ Pro Plan — $59/mo (includes AI Copilot)",
    "changeSummary": "proPrice increased USD 49 -> 59 (+20.41%); 1 field modified; +1/-1 lines (58 chars)"
}
```

#### 2. Newly Published Sitemap Page

```json
{
    "recordType": "sitemap",
    "status": "changed",
    "changeType": "sitemap_url_added",
    "url": "https://competitor.example/blog/new-enterprise-tier-2026",
    "sitemapUrl": "https://competitor.example/sitemap.xml",
    "lastmod": "2026-11-27",
    "totalUrls": 142,
    "previousTotalUrls": 141,
    "addedCount": 1,
    "removedCount": 0,
    "checkedAt": "2026-11-27T09:00:02.000Z",
    "changeSummary": "New page published in sitemap (141 -> 142 URLs)"
}
```

***

### Pricing (Pay-Per-Event)

You only pay for actual URL/sitemap checks (`page-checked`) and real detected changes (`change-detected`). Baseline captures and unchanged pages **never** incur `change-detected`.

#### `page-checked` — per monitored page or sitemap checked

| Apify Plan | Price per Event | Price per 1,000 Checks |
| :--- | :--- | :--- |
| **Free / Bronze** | $0.00100 | **$1.00** |
| **Silver (-10%)** | $0.00090 | **$0.90** |
| **Gold / Platinum / Diamond (-20%)** | $0.00080 | **$0.80** |

#### `change-detected` — per real page diff or new/removed sitemap URL emitted

| Apify Plan | Price per Event | Price per 1,000 Changes |
| :--- | :--- | :--- |
| **Free / Bronze** | $0.00500 | **$5.00** |
| **Silver (-10%)** | $0.00450 | **$4.50** |
| **Gold / Platinum / Diamond (-20%)** | $0.00400 | **$4.00** |

> **Free Plan Limit:** Free Apify accounts can monitor up to **25 URLs per run**. Paid plans lift this cap and respect your `maxTotalChargeUsd` budget limit automatically before fetching.

***

### Verifying Webhook HMAC Signatures

When `webhookSecret` is set, every outgoing webhook POST includes `X-Monitor-Signature-256: sha256=<hex>`. Verify it in Node.js:

```js
import { createHmac, timingSafeEqual } from 'node:crypto';

function verifySignature(rawBody, signatureHeader, secret) {
    const expected = `sha256=${createHmac('sha256', secret).update(rawBody).digest('hex')}`;
    return signatureHeader.length === expected.length
        && timingSafeEqual(Buffer.from(signatureHeader), Buffer.from(expected));
}
```

***

### Setting Up Scheduled Monitoring

1. Run the Actor once with your target `urls`, optional `cssSelectors`, and a persistent `stateStoreName` (e.g. `competitor-pricing-watch`). The first run captures baselines and writes baseline rows.
2. Create an **Apify Schedule** (hourly, every 6 hours, or daily) pointing to the same saved input and `stateStoreName`.
3. Add a `webhookUrl` (Slack, Discord, Make, Zapier, n8n, or your API) or `telegramBotToken` + `telegramChatId` to receive alerts only when real changes occur.

# Actor input Schema

## `monitorMode` (type: `string`):

Choose what to monitor. Content & Pricing Diff tracks HTML/CSS/JSON-LD pricing and page copy. Sitemap New/Removed Pages detects newly published or deleted competitor pages. Full runs both.

## `urls` (type: `array`):

List of page URLs to check (e.g. `https://competitor.com/pricing`). In Sitemap or Full mode, sitemaps are automatically discovered from these domains when `sitemapUrls` is empty. Also accepts objects `{ "url": "...", "label": "Acme Pricing", "selectors": { "proPrice": ".price" } }` or `startUrls` via API.

## `sitemapUrls` (type: `array`):

Explicit `sitemap.xml` or sitemap index URLs (supports `.xml` and `.xml.gz`). Leave empty to auto-discover from each URL's domain (`/sitemap.xml` and `robots.txt`).

## `cssSelectors` (type: `object`):

Map of field names to CSS selectors for targeted tracking and price delta detection, e.g. `{"proPrice": ".pricing-pro .amount", "enterpriseCta": ".plan-ent button"}`.

## `monitorOnlySelectors` (type: `boolean`):

When `cssSelectors` is configured, compare only the named selector values and extracted prices instead of full page body text. Ideal for noisy marketing pages.

## `ignoreRegexPatterns` (type: `array`):

Regular expressions stripped from extracted text before hashing and diffing (e.g. `"nonce-[a-f0-9]+"`, `"Updated: \\d{4}-\\d{2}-\\d{2}"`, `"csrf_token=[^&\\s]+"`).

## `minChangeChars` (type: `integer`):

Suppress pure text diffs smaller than this many added + removed characters (default 10). Numeric price changes always bypass this threshold so `$49` -> `$59` is never missed.

## `emitUnchanged` (type: `boolean`):

Output dataset rows even when a previously baselined URL has not changed. Keep `false` (default) so scheduled runs emit clean change-only datasets. Initial baseline capture still outputs baseline rows.

## `emitBaseline` (type: `boolean`):

Output a baseline snapshot row on the first run for a URL or sitemap (default `true`). Baseline rows charge only the check event, never the change event.

## `stateStoreName` (type: `string`):

Named Apify Key-Value Store holding previous page and sitemap snapshots across scheduled runs. Use different names to isolate separate monitoring projects.

## `mongoDbConnectionString` (type: `string`):

Optional MongoDB URI (e.g. `mongodb+srv://...`) to store snapshots in your own database instead of Apify Key-Value Store.

## `mongoDbDatabase` (type: `string`):

Database name used when `mongoDbConnectionString` is configured.

## `mongoDbCollection` (type: `string`):

Collection name used when `mongoDbConnectionString` is configured.

## `webhookUrl` (type: `string`):

HTTP endpoint to receive a JSON POST payload when changes are detected. Automatically formats payloads for Slack and Discord webhook URLs.

## `webhookSecret` (type: `string`):

Optional shared secret used to sign webhook payloads with header `X-Monitor-Signature-256: sha256=<hex>`.

## `telegramBotToken` (type: `string`):

Bot token from `@BotFather` for instant Telegram change alerts (requires `telegramChatId`).

## `telegramChatId` (type: `string`):

Target Telegram user, group, or channel ID (e.g. `-1001234567890`).

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

Number of URLs checked in parallel (1–25, default 5).

## `requestTimeoutSecs` (type: `integer`):

Per-request HTTP timeout in seconds (5–120, default 25).

## `maxSitemapsPerDomain` (type: `integer`):

Maximum child sitemap XML files to follow inside a `<sitemapindex>` (1–100, default 20).

## `maxNewUrlsPerSitemap` (type: `integer`):

Safety cap on how many newly added or removed URL rows are emitted per sitemap per run (1–5000, default 200).

## `customHeaders` (type: `object`):

Optional extra HTTP request headers (e.g. `{"Accept-Language": "en-US,en;q=0.9"}`).

## `proxy` (type: `object`):

Optional proxy settings for anti-bot protected competitor sites. Direct HTTP works out of the box for most public pages and sitemaps.

## Actor input object example

```json
{
  "monitorMode": "Content & Pricing Diff ($1/1k checks + $5/1k changes)",
  "urls": [
    "https://example.com"
  ],
  "cssSelectors": {},
  "monitorOnlySelectors": false,
  "minChangeChars": 10,
  "emitUnchanged": false,
  "emitBaseline": true,
  "stateStoreName": "website-change-monitor-state",
  "mongoDbDatabase": "website_change_monitor",
  "mongoDbCollection": "snapshots",
  "maxConcurrency": 5,
  "requestTimeoutSecs": 25,
  "maxSitemapsPerDomain": 20,
  "maxNewUrlsPerSitemap": 200,
  "proxy": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (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 = {
    "urls": [
        "https://example.com"
    ],
    "cssSelectors": {}
};

// Run the Actor and wait for it to finish
const run = await client.actor("memo23/website-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": ["https://example.com"],
    "cssSelectors": {},
}

# Run the Actor and wait for it to finish
run = client.actor("memo23/website-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": [
    "https://example.com"
  ],
  "cssSelectors": {}
}' |
apify call memo23/website-change-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,memo23/website-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/x4bmWdnOPh30aexQY/builds/09HljMqaFJxUA3flJ/openapi.json
