# Website Change Monitor: Page Diff & Change Alerts API (`eliai/website-change-monitor`) Actor

Track webpage changes: give page URLs, run on a schedule, and get only what changed since the last check (added and removed text, line diff) as JSON. For competitor, pricing and policy-page watching, and for AI agents. $0.005 per page checked, no login; failed checks are free.

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

## Pricing

$5.00 / 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

Check web pages for changes on every scheduled run and get only what changed: added and removed text with a diff. $0.005 per page checked, no login or API key, failed checks free.

## Website Change Monitor: Page Diff & Change Alerts API

Website Change Monitor does page change detection for any list of public web pages. Each run fetches
the pages, reduces each one to the text a reader sees, compares it with the snapshot from the last
run, and returns a website diff: the lines that were added, the lines that were removed, and a
`changed` flag. No login, no API key, no proxy. Pages that fail are free.

### How scheduling works

1. Create a task with your pages and put it on an **Apify schedule** (hourly, daily, weekly).
2. The **first run is the baseline**: every page is saved and returned with `status: "baseline"`.
3. **Every later run** compares against the saved snapshot and returns `changed` or `unchanged`,
   with exactly what changed. Then the new version becomes the snapshot.

Snapshots live in a named key-value store in your account (`website-change-monitor-snapshots` by
default), so they survive between runs. The Actor creates the store on its first run. Each snapshot is
keyed by the page URL plus your `cssSelector` and `ignorePatterns`, so several tasks can watch the same
page with different settings, in the same store, without resetting each other. To get an alert, add an Apify
integration or webhook on the run, and turn on `onlyChanged` so the dataset holds only real changes.

### Input

```json
{ "url": "https://example.com/" }
```

A scheduled watch list:

```json
{
  "urls": ["https://example.com/pricing", "https://example.com/terms", "https://example.com/changelog"],
  "ignorePatterns": ["\\d{4}-\\d{2}-\\d{2}", "\\d+ views"],
  "onlyChanged": true
}
```

| Field | Type | Notes |
|---|---|---|
| `url` / `urls` | string / string\[] | The pages to check, up to 500 per run. **You are charged per page checked.** |
| `cssSelector` | string | Compare only part of the page, like `#price` or `main .article-body`. Supports tag, `#id`, `.class`, `[attr="value"]` (also `~= ^= $= *=`), descendant and `>` combinators, and comma lists. |
| `ignorePatterns` | string\[] | Regular expressions for text that changes on every visit (dates, counters, "updated 3 minutes ago"). Matching text is blanked before comparing. |
| `snapshotStore` | string | Name of the key-value store that keeps the snapshots. Default `website-change-monitor-snapshots`. |
| `onlyChanged` | boolean | Leave unchanged pages out of the dataset. They are still checked, saved and charged, and listed in the run's `OUTPUT` record. |

Without a selector, the comparison skips scripts, styles, comments, menus (`<nav>`), footers,
sidebars and dropdowns. Lines follow the page as it renders, one per heading, paragraph, list item or
table row, with every run of whitespace inside them (line breaks, tabs, non-breaking spaces)
collapsed to one space, so a new tracking script or a re-wrapped, re-indented template never reads
as a change. A page that answers 200 but comes back empty or nearly empty (an error shell, a bot
page) is not compared: it is a free row and the saved snapshot is kept. Changing `cssSelector` or
`ignorePatterns` starts a fresh baseline for a page instead of reporting a false change; switching
back picks up the old history again.

Unknown input fields are refused for free, so a typo never checks the demo page. Options with no
page are refused too: `{"cssSelector": "#price"}` alone does not check example.com. To check the demo
page on purpose, pass `{"urls": ["https://example.com/"]}`.

### Output

One row per page:

```json
{
  "ok": true,
  "url": "https://example.com/pricing",
  "status": "changed",
  "changed": true,
  "title": "Pricing | Example",
  "addedCount": 2,
  "removedCount": 1,
  "addedLines": ["$12 per month", "Enterprise: contact sales"],
  "removedLines": ["$10 per month"],
  "diff": ["- $10 per month", "+ $12 per month", "+ Enterprise: contact sales"],
  "previousCheckedAt": "2026-11-07T09:00:04.112Z",
  "checkedAt": "2026-11-08T09:00:03.871Z",
  "contentHash": "5f1c0e2b7a9d4c3e8f6a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f6a",
  "previousHash": "9a8b7c6d5e4f30211a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f7a8b",
  "lineCount": 48,
  "httpStatus": 200
}
```

`status` is `baseline`, `changed` or `unchanged`. `addedLines` and `removedLines` hold up to 200
lines each and `diff` up to 400, in page order; `addedCount` and `removedCount` are always the full
counts (`listsCapped: true` says a list was cut). A page that could not be checked comes back as a free
row like `{"ok": false, "url": "...", "reason": "Page not found (HTTP 404)."}`. The run's `OUTPUT`
record sums it up: how many pages were baseline, changed, unchanged or failed, and which URLs changed.

### Pricing

**$0.005 per page checked**: a page that answered 2xx with HTML, plain text or markdown, was compared and
whose new snapshot was saved, including the first baseline run. No start fee. **Free:** pages that
fail to load, any non-2xx answer, redirects to another site, pages a site's robots.txt disallows,
non-HTML files (PDF, images), private or internal hosts, a page that came back empty or nearly
empty, a selector that matched nothing, a page that switched between HTML and markdown since the
last run (a fresh baseline is saved), and a
duplicate URL in the same run. If you set a max-charge limit, the run stops there: pages after it are
not fetched, compared or charged, and their snapshots stay as they were.

### How it treats each site

- Reads each site's `robots.txt` first and **obeys it**. A disallowed page is skipped and recorded, not
  charged. A robots.txt Crawl-delay is honoured (up to 60 seconds).
- One request per second per site at most. A site that rate-limits the run is not retried around.
- Redirects within the same site (http to https, a trailing slash) are followed, each one checked
  against robots.txt. A redirect to another site is not followed; the row names where it pointed.
- Only public websites: IP addresses, localhost, internal names and hosts that resolve to private
  addresses are refused.
- Public pages only. It does not log in, fill forms or run JavaScript, so content drawn only by
  scripts in the browser is not seen.

### Use it from an AI agent

Website Change Monitor works as an LLM tool through Apify's MCP server: an AI agent passes a list of
pages in one batch API call and gets back clean JSON for agents, one row per page with `changed`,
`addedLines` and `removedLines`, so it can act on what changed without reading whole pages. With
`onlyChanged` the agent sees nothing but real changes, and failed pages come back as free rows that
say why.
Runs with limited permissions, so AI agents can call and pay for it through Apify's x402 agentic payments (experimental).

### FAQ

**Why is the first run all "baseline"?** There is nothing to compare with yet. From the second run on
you get `changed` or `unchanged`.

**A page shows as changed on every run.** Something on it changes per visit, like a date, a counter or
a random tip. Add a pattern for it to `ignorePatterns`, or point `cssSelector` at the part you care about.

**Can I watch several lists on different schedules?** Yes. Tasks share the default store safely, even
on the same page with different settings. A separate `snapshotStore` name per list is optional, for
keeping histories apart or deleting one list's snapshots on its own.

**Does it see content loaded by JavaScript?** No. It reads the HTML the server sends, which covers
most pricing, terms, policy, docs and news pages.

# Actor input Schema

## `url` (type: `string`):

One web page to check, like https://example.com/pricing. Leave it as the demo, or use "urls" for many pages.

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

Many pages in one run (batch API), up to 500. AI agents and LLM tools can pass a whole watch list in one call. Each page is charged once per successful check.

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

Compare only the matching elements, like "#price", "main .article-body" or "table.plans, .changelog". Supports tag, #id, .class, \[attr="value"], descendant and > combinators. Empty: the whole page minus scripts, menus, footers and sidebars.

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

Regular expressions for text that changes on every visit and should not count as a change, like "\d{4}-\d{2}-\d{2}" for dates or "\d+ views" for counters. Matching text is blanked before comparing.

## `snapshotStore` (type: `string`):

The named key-value store where each page's last snapshot is kept between runs. Snapshots are keyed by URL plus cssSelector and ignorePatterns, so tasks can share one store safely; a separate name is optional. This Actor creates the store on its first run.

## `onlyChanged` (type: `boolean`):

Leave unchanged pages out of the dataset, so an AI agent, webhook or integration sees only real changes. Unchanged pages are still checked, saved and charged; their URLs are listed in the run's OUTPUT record.

## Actor input object example

```json
{
  "url": "https://example.com/",
  "urls": [],
  "ignorePatterns": [],
  "snapshotStore": "website-change-monitor-snapshots",
  "onlyChanged": false
}
```

# Actor output Schema

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

One row per page checked, with what changed. Export as JSON, CSV or Excel from the dataset view.

## `summary` (type: `string`):

Counts of baseline, changed and unchanged pages and the URLs that changed (plus unchanged URLs when onlyChanged 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 = {
    "url": "https://example.com/",
    "urls": [],
    "ignorePatterns": []
};

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

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

```

## MCP server setup

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