# Website Change Monitor: Text Diff Alerts for Any Page (`pj_pai/website-change-monitor`) Actor

Monitor any web pages for content changes. Each run compares visible text with the previous snapshot and returns changed status, % changed, and the exact added and removed lines. Optional regex focus and ignore rules. Schedule it for price, policy or competitor alerts.

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

## Pricing

$3.00 / 1,000 checks

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: Text Diff Alerts for Any Page

Monitor any web pages for content changes. Each run compares visible text with the previous snapshot and returns changed status, % changed, and the exact added and removed lines. Optional regex focus and ignore rules. Schedule it for price, policy or competitor alerts.

**Data source:** the public HTML of the pages you list; snapshots are stored in a named key-value store in your own Apify account so each run compares against the last one. It needs no login, proxy or browser. Results are returned as clean, flat JSON that is ready for spreadsheets, databases, BI tools and AI agents.

### How it works

The first run for a URL saves a snapshot and returns `status: first-check`. Every later run compares the page with the saved snapshot and returns `changed`, `unchanged` or `error`, plus the added and removed lines. Schedule the Actor (for example hourly or daily) and set **Output** to `changedOnly` so you only get, and only pay for, pages that changed. Use a separate snapshot store name for each watch list.

### What can you use it for?

- Track competitor pricing, feature and landing pages
- Get alerts when terms of service, privacy policies or regulatory pages change
- Watch job, press or product pages for new entries
- Feed only changed pages to AI summarizers or Slack/email alerts
- Use it as a tool from AI agents through the Apify MCP server, or schedule it and send new results to Slack, Google Sheets or a webhook

### Input

| Field | Name | Description |
|---|---|---|
| `urls` | Page URLs | Pages to monitor |
| `outputMode` | Output | all = one row per page every run; changedAndFirst = changed pages plus first snapshots; changedOnly = only pages that changed (you only pay for those) |
| `extractPattern` | Focus regex (optional) | Only compare the part of the HTML matching this regex (first capture group if present), e.g. \<main\[\s\S]\*?</main> |
| `ignorePatterns` | Ignore lines matching (regex) | Lines matching any of these are ignored, e.g. timestamps or counters |
| `compareRawHtml` | Compare raw HTML | Compare HTML source lines instead of visible text |
| `maxDiffLines` | Max diff lines | Max added/removed lines returned per page |
| `stateStoreName` | Snapshot store name | Named key-value store for snapshots. Use different names for separate watch lists. |
| `concurrency` | Concurrency | Pages in parallel |

#### Example input

```json
{
  "urls": [
    "https://apify.com/pricing",
    "https://news.ycombinator.com",
    "https://www.allbirds.com"
  ],
  "outputMode": "all"
}
```

### Output

Each result is one dataset item with these fields: `url`, `finalUrl`, `title`, `httpStatus`, `status`, `changed`, `contentHash`, `lineCount`, `charCount`, `previousHash`, `previousCheckedAt`, `addedCount`, `removedCount`, `changePct`, `addedLines`, `removedLines`, `checkedAt`, `textPreview`.

#### Example output (real result, long fields shortened)

```json
{
  "url": "https://apify.com/pricing",
  "finalUrl": "https://apify.com/pricing",
  "title": "Apify pricing - flexible plan + pay as you go · Apify",
  "httpStatus": 200,
  "status": "first-check",
  "changed": false,
  "contentHash": "d9eb98bf333d49eb58ce8ad74fda130ebc4526c7fb14a64382baa75fc6ba99fb",
  "lineCount": 430,
  "charCount": 13510,
  "previousHash": null,
  "previousCheckedAt": null,
  "addedCount": 0,
  "removedCount": 0,
  "changePct": 0,
  "addedLines": [],
  "removedLines": [],
  "checkedAt": "2026-11-02T17:38:19.633Z",
  "textPreview": "Apify pricing - flexible plan + pay as you go · Apify\nSkip to content\nGet started Log in\nSolutions\nBack\nMCP server configuration\nConfigure your Apify MCP server..."
}
```

Download the results as JSON, CSV, Excel or XML, or read them through the Apify API.

### Pricing

This Actor uses **pay-per-event** pricing. You pay **$0.003 per page check** returned, plus standard Apify platform usage, which is small because the Actor uses lightweight HTTP requests (no browser). You are never charged for results that are not returned. To cap spending, set a maximum cost per run in the run options.

### Tips

- Start with a small max-results value to check your filters, then scale up.
- Schedule the Actor (for example daily) to monitor changes over time.
- The data comes straight from the source, so its freshness and completeness depend on that publisher.

### Disclaimer

This Actor is not affiliated with or endorsed by any website, platform or data publisher named here. Use it in line with the target sites' terms and applicable privacy laws (e.g. GDPR/CAN-SPAM for contact data). Verify critical decisions against the official source.

# Actor input Schema

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

Pages to monitor

## `outputMode` (type: `string`):

all = one row per page every run; changedAndFirst = changed pages plus first snapshots; changedOnly = only pages that changed (you only pay for those)

## `extractPattern` (type: `string`):

Only compare the part of the HTML matching this regex (first capture group if present), e.g. \<main\[\s\S]\*?</main>

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

Lines matching any of these are ignored, e.g. timestamps or counters

## `compareRawHtml` (type: `boolean`):

Compare HTML source lines instead of visible text

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

Max added/removed lines returned per page

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

Named key-value store for snapshots. Use different names for separate watch lists.

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

Pages in parallel

## Actor input object example

```json
{
  "urls": [
    "https://www.apify.com/pricing",
    "https://news.ycombinator.com"
  ],
  "outputMode": "all",
  "compareRawHtml": false,
  "maxDiffLines": 50,
  "stateStoreName": "website-change-monitor-state",
  "concurrency": 5
}
```

# Actor output Schema

## `results` (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://www.apify.com/pricing",
        "https://news.ycombinator.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pj_pai/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.apify.com/pricing",
        "https://news.ycombinator.com",
    ] }

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

```

## MCP server setup

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