# Website Change Monitor: Detect Page Text Changes (`firebrick_zamia/website-change-monitor`) Actor

Website change detection without AI costs: track pages or CSS selectors, compare visible text with the previous run, get new/changed/unchanged status, added and removed lines and word counts. Ignore dates and numbers. Respects robots.txt. Schedule it on Apify.

- **URL**: https://apify.com/firebrick_zamia/website-change-monitor.md
- **Developed by:** [Aadam Ahmed](https://apify.com/firebrick_zamia) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

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: Detect Page Text Changes Without AI Costs

**Monitor web pages for content changes. For each URL the actor extracts the visible text, hashes it, compares it with the snapshot from the previous run and returns one row: new, changed, unchanged or error, with added and removed lines and word counts. No LLM, no browser, no API key. Run it on an Apify schedule.**

### What you get

One row per URL:
`{url, status, changedAt, checkedAt, diffSummary, wordCountBefore, wordCountAfter, contentHash, error}` (plus `finalUrl` when the URL redirected).

- `status`: `new` (first time this URL and selector are seen, nothing to compare), `changed`, `unchanged` or `error`.
- `changedAt`: when this actor detected the change (the time of the run that saw it, not when the site was edited). For `unchanged` rows it keeps the time of the last detected change, or null if none was seen yet.
- `diffSummary`: `addedLines`, `removedLines` and `firstChanges`, the first N changed lines prefixed with `+` (added) or `-` (removed).

### Use cases

- Watch a competitor's pricing, terms, careers or documentation page and get alerted when the text changes.
- Track a supplier, regulator or government notice page for updates.
- Notice when a page you depend on (policy, API docs, changelog) is quietly edited.
- Feed changes into an Apify webhook, a Zap, a sheet or an AI agent (callable through Apify's MCP server, https://mcp.apify.com).

### How it works

1. Reads `robots.txt` of the site and skips URLs it disallows (error row "Disallowed by robots.txt"). If `robots.txt` cannot be fetched because of a server error or timeout, the page is not fetched either.
2. Fetches each page one at a time, at most 1 request per second per host, with an identifying User-Agent, a timeout and manual redirect following (each hop is checked against that host's `robots.txt`).
3. Extracts visible text: scripts, styles and comments are removed, block elements become lines, whitespace and HTML entities are normalised. With no selector the main text is used (`main`, else `article`, else `body` without nav, header, footer and aside). With a selector, only that element.
4. Hashes the text (SHA-256) and compares it with the snapshot stored in a **named key-value store** (default `website-change-monitor-snapshots`) by the previous run. Named stores persist between runs, which is what makes scheduling work. The new text then replaces the snapshot.
5. The diff is a line-level comparison: lines that appear now but not before, and the reverse. A page whose lines were only reordered is reported as changed with `reorderedOnly: true`.

### Input

| Field | Meaning |
|---|---|
| `urls` | Pages to check (required, up to `maxUrls`) |
| `selector` | Optional single simple selector: `tag`, `#id`, `.class`, `tag.class`, `tag#id` |
| `ignoreNumbers` | Treat all numbers as equal (counters, prices, view counts) |
| `ignoreDates` | Treat dates and clock times as equal (copyright year, "last updated") |
| `maxDiffLines` | How many changed lines to list (default 10; counts are always complete) |
| `onlyChanges` | Leave unchanged pages out of the dataset |
| `snapshotStoreName` | Named key-value store for snapshots; use one per monitoring job |
| `timeoutSecs`, `maxUrls` | Per-request timeout (default 20 s) and URL cap (default 100) |

The noise options are applied when comparing, to both the stored and the new text, so switching them on or off does not by itself create a false change. The diff shows the original text of changed lines.

### Example

Input (bundled `test-input.json`): one URL with `ignoreDates` on. The record below uses **illustrative values only**; our tests use synthetic HTML pages.

```json
{
  "url": "https://example.com/pricing", "status": "changed", "changedAt": "2026-10-25T06:00:03.120Z",
  "diffSummary": { "addedLines": 1, "removedLines": 1, "firstChanges": ["+ Plan A costs 12 USD.", "- Plan A costs 10 USD."], "reorderedOnly": false },
  "wordCountBefore": 21, "wordCountAfter": 21, "error": null
}
```

### Scheduling

Create an Apify Schedule for this actor (for example daily) with your input and keep `snapshotStoreName` the same between runs. Use `onlyChanges` so each run returns only what needs attention, and attach a webhook or integration to the run.

### Limitations (read before relying on it)

- **No JavaScript rendering.** Pages whose text is built in the browser by scripts show little or no text; such a page yields an error row ("No visible text found") or only its static parts.
- **Not every change is a text change.** Images, layout, styling, hidden elements and attributes are ignored. Only visible text is compared, up to about 500,000 characters per page, and responses are read up to 5 MB.
- **Selector support is deliberately small**: one simple selector, no combinators, attributes or comma lists. The first matching element is used; if nothing matches, that URL gets an error row.
- **The first run only records snapshots** (`new`); changes can only be detected from the second run on. Changing the selector for a URL starts a new snapshot for it. Deleting the named store resets all snapshots.
- **Dynamic text produces changes.** Ads, rotating banners, timestamps and counters can look like changes; use `ignoreNumbers`, `ignoreDates` and a selector to narrow the watched region. The number and date patterns cover common formats, not all of them.
- Respects `robots.txt` and does not bypass logins, paywalls, CAPTCHAs or blocks; a 403 or 429 is reported as an error. Only monitor pages you are allowed to access, and check the site's terms.
- Pages are fetched sequentially, so a large list takes a while (at least one second per page).

### Pricing (pay per result)

Pay-per-event with Apify's built-in dataset-item event: each row pushed to the dataset is one result, including `unchanged` and `error` rows unless you switch on `onlyChanges` (which removes unchanged rows only). The live price is set in Apify Console and shown on the Store page.

### FAQ

**Does it use AI?** No. It compares text and hashes; it costs nothing beyond the platform usage and the per-result price.

**Where are snapshots stored?** In a named key-value store in your own Apify account, one record per URL and selector, holding the extracted text lines.

**Why `new` and not `unchanged` on the first run?** There is nothing to compare with yet.

**Can it watch a single section of a page?** Yes, pass a simple selector such as `#pricing` or `div.content`.

# Actor input Schema

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

Pages to check, one http(s) URL per line. Each is compared with its own snapshot from the previous run. Pages that need JavaScript to show their text are not supported.

## `selector` (type: `string`):

Watch only one part of the page. One simple selector is supported: tag, #id, .class, tag.class or tag#id (for example #pricing or div.content). Empty means the main text: the main element, else article, else the body without navigation, header, footer and sidebar.

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

Treat every number as the same when comparing, so counters, prices and view counts do not trigger a change. Words that change are still detected.

## `ignoreDates` (type: `boolean`):

Treat dates (2026-10-25, 25/10/2026, 25 October 2026, October 25, 2026) and clock times as unchanged noise, for example a copyright year or a 'last updated' stamp.

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

How many added and removed lines to list in the diff summary of a changed page (0 to 100). Counts of all added and removed lines are always reported.

## `onlyChanges` (type: `boolean`):

Skip unchanged pages in the dataset so a scheduled run only returns new, changed and failed pages. Every pushed row is one billed result.

## `snapshotStoreName` (type: `string`):

Name of the named key-value store holding the previous text of each page. Use a different name for each independent monitoring job. Letters, digits and hyphens only.

## `timeoutSecs` (type: `integer`):

Give up on a page after this many seconds. A timeout produces an error row for that URL only.

## `maxUrls` (type: `integer`):

Safety cap on the number of URLs per run (1 to 500). The run is rejected if you list more. Pages are fetched one at a time, at most 1 request per second per host.

## Actor input object example

```json
{
  "urls": [
    "https://www.gov.uk/",
    "https://www.python.org/"
  ],
  "ignoreNumbers": false,
  "ignoreDates": false,
  "maxDiffLines": 10,
  "onlyChanges": false,
  "snapshotStoreName": "website-change-monitor-snapshots",
  "timeoutSecs": 20,
  "maxUrls": 100
}
```

# Actor output Schema

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

All result records.

# 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.gov.uk/",
        "https://www.python.org/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("firebrick_zamia/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.gov.uk/",
        "https://www.python.org/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("firebrick_zamia/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.gov.uk/",
    "https://www.python.org/"
  ]
}' |
apify call firebrick_zamia/website-change-monitor --silent --output-dataset

```

## MCP server setup

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