# Website Change Monitor — Page Diffs for Agents & Price Alerts (`fabrikit/website-change-monitor`) Actor

Watch a list of URLs for content changes over plain HTTP: the first run stores a baseline per URL in a named key-value store, later runs report added and removed lines, similarity and hashes. Text, CSS selector or HTML mode; ignore numbers or patterns. From US$3.50 per 1,000 pages checked.

- **URL**: https://apify.com/fabrikit/website-change-monitor.md
- **Developed by:** [Fabrikit](https://apify.com/fabrikit) (community)
- **Categories:** Automation, AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 16.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 page checkeds

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

## Website Change Monitor — Page Diffs for AI Agents & Price Alerts

Website Change Monitor watches any list of web pages for content changes and tells you which lines were added or removed since the previous run. It works over plain HTTP (no browser), keeps one snapshot per URL in a named key-value store, and writes one flat row per page with the status (`baseline`, `changed`, `unchanged`, `error`), both hashes, a readable diff summary and a similarity score. Schedule it and feed the dataset to an AI agent, a webhook or a spreadsheet.

It reuses the fetch and text-extraction core of our [Website to Markdown Scraper](https://apify.com/fabrikit/website-to-markdown-scraper): that Actor turns sites into Markdown for RAG; this one remembers what a page looked like and reports only the difference.

### How it works

1. **First run = baseline.** Each URL is fetched, normalised and hashed; the snapshot goes to the key-value store named by `monitorId` (default `fabrikit-page-monitor`; if a store with that name in your account belongs to another Actor, the run uses `fabrikit-wcm-<monitorId>` and says so in `note`). Rows get `status: "baseline"`.
2. **Next runs = comparison.** Each URL is fetched again and compared with its snapshot: `"changed"` (with `added[]`, `removed[]`, `diffSummary`, `similarity`) or `"unchanged"`. The snapshot is updated, so every run compares against the newest version.
3. **Errors are rows, not silence.** A 404, timeout, anti-bot block or unsupported file type gives `status: "error"` with the message; the old snapshot is kept and nothing is charged.

Named key-value stores never expire, so the baseline survives between runs. Use one `monitorId` per monitor (`competitor-prices`, `docs-changelog`); changing the comparison settings for an existing `monitorId` stores a fresh baseline and says so in `note`.

### What is compared

| `mode` | Content |
|---|---|
| `text` (default) | Main content as plain text: navigation, footers, cookie banners and scripts removed, title included, one line per paragraph, list item or table row. |
| `selector` | Text inside the elements matched by `cssSelector` (`.price`, `#stock-status`, `table.specs`). Best for price and availability tracking. |
| `html` | Outer HTML of the matched elements (or the whole `<body>`), one tag per line. Catches attribute changes such as links and images. |

JSON, XML, CSV and plain-text endpoints are compared as text (JSON is pretty-printed first, so the diff shows the changed keys). Pages that are only an empty JavaScript shell are reported as an error with `needsBrowser: true` instead of a meaningless empty baseline.

Noise control: `ignoreWhitespace` (default on) collapses spacing and blank lines; `ignoreNumbers` turns every number into `#` so counters and dates stop counting as changes (keep it off when tracking prices); `ignorePatterns` removes anything matching your regular expressions (`Last updated.*`, `\d{2}:\d{2}:\d{2}`, session tokens) before comparing.

### Output fields

`url`, `finalUrl`, `monitorId`, `mode`, `cssSelector`, `status`, `checkedAt`, `previousCheckedAt`, `lastChangedAt`, `previousHash`, `currentHash`, `addedCount`, `removedCount`, `added[]`, `removed[]` (up to `maxDiffLines` lines each; counts are always complete), `diffSummary` (a counts line, then `- removed` and `+ added` lines), `similarity` (share of common lines, 0 to 1), `httpStatus`, `title`, `textLength`, `textPreview`, `needsBrowser`, `note`, `error`.

### Use cases

AI agents that need a cheap "did anything change?" tool (read only the `changed` rows, act on `added[]`/`removed[]`); price and stock tracking with `mode: "selector"` on product pages; competitor pricing, feature and careers pages; documentation, changelogs and terms of service; status pages and JSON endpoints compared key by key.

### How to use

Paste the URLs, keep the defaults and run twice: the first run stores baselines, the second reports changes. Then add a **schedule** in the Apify Console.

```json
{
  "urls": [
    "https://www.iana.org/help/example-domains",
    "https://www.rfc-editor.org/rfc/rfc2606.html",
    "https://www.iana.org/domains/reserved",
    "https://docs.python.org/3/library/difflib.html"
  ],
  "monitorId": "fabrikit-page-monitor",
  "mode": "text",
  "emitUnchanged": true
}
```

Track one element and ignore a "last updated" stamp:

```json
{
  "urls": ["https://shop.example/products/widget"],
  "monitorId": "widget-price",
  "mode": "selector",
  "cssSelector": ".product-price",
  "ignorePatterns": ["Last updated.*"],
  "emitUnchanged": false
}
```

`emitUnchanged` decides what lands in the dataset. **On (default):** one row per URL on every run, so a run always has output and you filter by `status`. **Off:** only `baseline`, `changed` and `error` rows are written; unchanged pages are still fetched, compared and charged as page checks, and the run status message says how many were skipped.

Other options: `maxDiffLines` (added/removed lines kept per row, default 50), `concurrency` (default 5) and `proxyConfiguration` (datacenter by default; a page answering 403/429/503 or a challenge page is retried through a residential proxy).

### Output example

A `changed` row in `text` mode after one sentence of an 8-line page was edited (long lines shortened, a few fields omitted):

```json
{
  "url": "https://www.iana.org/help/example-domains",
  "monitorId": "fabrikit-page-monitor",
  "mode": "text",
  "status": "changed",
  "checkedAt": "2026-10-20T05:26:44.038Z",
  "previousCheckedAt": "2026-10-20T05:23:35.012Z",
  "previousHash": "0000000000000000000000000000000000000000000000000000000000000000",
  "currentHash": "f2b9308dbe29630a95753f1581df5a033bffa8e95c9a79274ed81ebe7be20bae",
  "addedCount": 1,
  "removedCount": 1,
  "added": ["A number of domains such as example.com … They are not available for registration or transfer."],
  "removed": ["A number of domains such as example.com … They are now available for registration (tampered)."],
  "diffSummary": "+1 added, -1 removed lines (similarity 0.875)\n- A number of domains … (tampered).\n+ A number of domains … or transfer.",
  "similarity": 0.875,
  "httpStatus": 200,
  "title": "Example Domains",
  "error": null
}
```

In `selector` mode with `cssSelector: ".price"` the row carries just the price lines (`"removed": ["$19.99"]`, `"added": ["$17.49"]`). An `unchanged` row has `similarity: 1` and empty arrays; a `baseline` row has `previousHash: null`.

### Pricing

Pay per event, no compute or proxy surcharges:

| Event | Price | When |
|---|---|---|
| `page-checked` | US$0.0035 (US$3.50 per 1,000) | Each URL fetched and compared (baseline, changed or unchanged) |
| `change-detected` | US$0.005 (US$5.00 per 1,000) | Added once per URL whose content differs from its snapshot |

1,000 page checks = US$3.50. 100 pages checked daily for a month = 3,000 checks = US$10.50, plus US$0.005 per change found (150 changes = US$0.75). Failed fetches, blocked pages and JavaScript-only shells are free. The run stops at your maximum charge per run.

### How it compares

- **Browser-based change detectors** render JavaScript and take screenshots but pay compute per minute and are slow for hundreds of URLs. This Actor is HTTP-only (dozens of pages in seconds) and says so when a page is a JavaScript shell.
- **Other monitors on Apify Store** charge from about US$5 up to US$100 per 1,000 checks or need a paid notification service; here the snapshot and the diff stay in your own storage for US$3.50 per 1,000 checks.
- **[Website to Markdown Scraper](https://apify.com/fabrikit/website-to-markdown-scraper)** is the right tool when you want the content itself (Markdown for RAG, whole-site crawls); this one only tells you what changed.

### Integrations

Apify API and clients (JavaScript, Python); schedules plus a webhook on `ACTOR.RUN.SUCCEEDED` for Slack, email or your backend; n8n, Make and Zapier through the Apify app; AI agents through the Apify MCP server (`diffSummary` is written to be pasted into a prompt). The key-value store named by `monitorId` also holds an `INDEX` record (URL, key, last status, last hash) and the latest snapshot of every page for other tools to read.

### FAQ

**Is it legal?** It fetches public pages like a browser, without logging in, and stores only the text of the pages you choose. Respect the site's terms, keep schedules reasonable and do not monitor personal data.

**Do I need a proxy?** Usually not; public pages work with the default datacenter proxy. Protected pages are retried through a residential proxy; if they still block, the row says so.

**Limits and JavaScript?** Up to 1,000 URLs per run, pages up to 8 MB, content hashed up to 500,000 characters (longer content is cut and noted). Server-rendered HTML is required: single-page apps shipping an empty shell are reported as `needsBrowser` errors.

**How do I reset a baseline?** Delete the record in the key-value store (keys are `page-<sha1 of the URL>`; `INDEX` maps URLs to keys), use a new `monitorId`, or change any comparison setting. Different `monitorId`s can watch the same URL with different settings.

### Changelog

- **0.1.0 (2026-10-20)**: first release — text / selector / html modes, named snapshot store, line diff with similarity, ignore options, JSON endpoints, residential fallback.

### En español

Website Change Monitor vigila una lista de URLs y reporta qué líneas se agregaron o quitaron desde la corrida anterior. La primera corrida guarda la línea base de cada página en un key-value store con nombre (`monitorId`); las siguientes comparan el texto, un selector CSS o el HTML, con opciones para ignorar números, espacios o patrones. Sirve para agentes de IA, seguimiento de precios y competencia, cambios en documentación o términos, y endpoints JSON. Sin navegador: decenas de páginas en segundos. US$3,50 por cada 1.000 páginas revisadas más US$5 por cada 1.000 cambios detectados. Construido sobre el núcleo de nuestro [Website to Markdown Scraper](https://apify.com/fabrikit/website-to-markdown-scraper).

# Actor input Schema

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

Pages to check, one per line. Each run compares every URL with its previous snapshot. JSON, XML and plain-text endpoints work too.

## `monitorId` (type: `string`):

Name of the key-value store that keeps one snapshot per URL between runs (letters, digits and dashes). Use a different name for each monitor or set of settings. If a store with this name in your account belongs to another Actor, snapshots go to fabrikit-wcm-<name> instead.

## `mode` (type: `string`):

Text: main content of the page (menus, footers and cookie banners removed), title included. Selector: text inside the elements matched by the CSS selector. HTML: outer HTML of the selector (or of the whole body), one tag per line.

## `cssSelector` (type: `string`):

Limits the comparison to the matched elements, e.g. .price, #stock, table.specs or main article. Required in selector mode; optional in text and HTML mode.

## `ignoreWhitespace` (type: `boolean`):

Collapse repeated spaces and drop blank lines before comparing (recommended).

## `ignoreNumbers` (type: `boolean`):

Replace every number with # so view counters, dates and stock figures do not count as changes. Leave off when you track prices.

## `ignorePatterns` (type: `array`):

Regular expressions removed from the content before comparing, e.g. Last updated.\* or \d{2}:\d{2}:\d{2}. Case-insensitive.

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

On: one row per URL on every run (status baseline, changed, unchanged or error). Off: only baseline, changed and error rows are written; unchanged pages are still checked and charged.

## `maxDiffLines` (type: `integer`):

How many added and removed lines to keep in each row (counts are always complete).

## `concurrency` (type: `integer`):

Pages fetched in parallel.

## `proxyConfiguration` (type: `object`):

Datacenter proxy by default. If a site blocks it, the Actor retries that page through a residential proxy automatically.

## Actor input object example

```json
{
  "urls": [
    "https://www.iana.org/help/example-domains",
    "https://www.rfc-editor.org/rfc/rfc2606.html",
    "https://www.iana.org/domains/reserved",
    "https://docs.python.org/3/library/difflib.html"
  ],
  "monitorId": "fabrikit-page-monitor",
  "mode": "text",
  "ignoreWhitespace": true,
  "ignoreNumbers": false,
  "ignorePatterns": [],
  "emitUnchanged": true,
  "maxDiffLines": 50,
  "concurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `checks` (type: `string`):

One row per URL checked in this 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": [
        "https://www.iana.org/help/example-domains",
        "https://www.rfc-editor.org/rfc/rfc2606.html",
        "https://www.iana.org/domains/reserved",
        "https://docs.python.org/3/library/difflib.html"
    ],
    "monitorId": "fabrikit-page-monitor",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("fabrikit/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://www.iana.org/help/example-domains",
        "https://www.rfc-editor.org/rfc/rfc2606.html",
        "https://www.iana.org/domains/reserved",
        "https://docs.python.org/3/library/difflib.html",
    ],
    "monitorId": "fabrikit-page-monitor",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("fabrikit/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://www.iana.org/help/example-domains",
    "https://www.rfc-editor.org/rfc/rfc2606.html",
    "https://www.iana.org/domains/reserved",
    "https://docs.python.org/3/library/difflib.html"
  ],
  "monitorId": "fabrikit-page-monitor",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call fabrikit/website-change-monitor --silent --output-dataset

```

## MCP server setup

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