# Website Change Monitor: text and visual diffs on a schedule (`examsens.ai/website-change-monitor`) Actor

Checks a list of web pages, or one part of each page by CSS selector, against the version saved on the last run and reports added and removed text, with an optional screenshot comparison.

- **URL**: https://apify.com/examsens.ai/website-change-monitor.md
- **Developed by:** [Ed Rayyis](https://apify.com/examsens.ai) (community)
- **Categories:** Automation, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 89.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 url 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: text and visual diffs on a schedule

Give it a list of web pages and run it on a schedule. Each run compares every page with the version saved on the run before and tells you what changed: the lines of text added and removed, a unified diff, and, if you turn it on, how many pixels of a screenshot changed, with an image that marks them in red.

Watch a whole page, or only the part you care about with a CSS selector such as `#pricing` or `main .price`. You can set one selector for every page, or a different one per page.

### How it keeps the last version

The last version of each page is saved in a named key value store in your Apify account (`website-change-snapshots` unless you choose another name). The next run, scheduled or manual, reads it from there. Use one store name per watch list. The first run of a page reports `new` and saves the starting version. The actor can only open a store it created, so pick a name no other tool in your account uses. If another tool already uses the name, the run still checks every page, reports each one as `new`, and says so in the log.

### How it reads a page

By default it reads the HTML the server sends. This is the fastest mode. Turn on Render JavaScript for pages that build their content in the browser. Screenshot comparison always uses the headless browser.

Text is compared line by line. Spacing is evened out and blank lines are dropped, so a change in indentation is not a change. Add regular expressions to Ignore lines matching to leave out a clock, a counter or a date stamp. Pages that are not HTML, such as JSON or plain text, are compared as text.

### Input

- Pages to watch (required). To give one page its own selector, add `"userData": {"cssSelector": "#pricing"}` to that entry in JSON input.
- Snapshot store name (default `website-change-snapshots`)
- CSS selector (optional, applies to every page without its own)
- Render JavaScript (default off)
- Screenshot comparison (default off), whole page screenshot (default off: first screen, or the selected part when a selector is set), and the visual change threshold (default 0.1% of pixels)
- Ignore lines matching (regular expressions)
- Output changes only (default off)
- Maximum diff lines listed per page (default 200)
- Timeout per page (default 45 seconds)

### Output

Dataset: one item per page with `url`, `selector`, `status` (`new`, `changed`, `unchanged` or `error`), `changed`, `textChanged`, `addedCount`, `removedCount`, `addedLines`, `removedLines`, `diff` (unified diff), `lineCount`, `httpStatus`, `finalUrl`, `title`, `checkedAt`, and `previousCheckedAt` (the run it was compared with).

With screenshot comparison: `visualChangePercent`, `visualChanged`, `screenshotUrl` (the latest screenshot) and `diffImageUrl` (the changed pixels in red over a faded copy of the new screenshot, saved when the change is over the threshold).

The key value store of each run holds a `SUMMARY` record with the counts of new, changed, unchanged and failed pages.

A page that cannot be loaded, or whose selector matches nothing, gets `status: error` and an `error`, and its saved version is kept for the next run. Export as JSON, CSV or Excel, or read it over the API.

### Pricing

Pay per event: one event per page checked, whether it changed or not. A page that fails is not charged. The run stops when it reaches the maximum charge you set.

### Scope and conduct

Only the pages you list are loaded, one at a time, with no cookies carried between runs. The actor does not log in anywhere, click anything, or collect personal data. Watch pages you are allowed to monitor, and pick a schedule that keeps the load on the site light.

### Support

Questions and problems: the Issues tab on this page.

# Actor input Schema

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

Web pages to check on every run.

## `storeName` (type: `string`):

Name of the key value store in your account that keeps the last version of each page between runs. Use the same name on every scheduled run of one watch list, and a different name for each separate watch list. Lowercase letters, digits and hyphens. Pick a name no other tool in your account uses.

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

Watch only the part of each page that matches this selector, such as #pricing or main .price. Leave empty to watch the whole page.

## `renderJavaScript` (type: `boolean`):

Open each page in a headless browser before reading its text. Turn on for pages that build their content with JavaScript. Off reads the HTML the server sends, which is faster.

## `visualDiff` (type: `boolean`):

Also take a screenshot of each page (or of the selected part) and compare it with the last one. Uses the headless browser.

## `fullPageScreenshot` (type: `boolean`):

With screenshot comparison on and no CSS selector: capture the whole scrollable page. When off, the first screen is captured.

## `visualThresholdPercent` (type: `number`):

Report a visual change only when more than this percentage of pixels differ.

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

Regular expressions. Text lines that match any of them are left out before comparing, so a clock, a visitor counter or a date stamp does not count as a change. Example: ^Updated .\* ago$

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

Write to the dataset only pages that changed, pages checked for the first time, and pages that failed. When off, every page gets a row.

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

Most added or removed lines listed per page. The counts are always complete.

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

Give up on a page after this many seconds.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://example.com"
    }
  ],
  "storeName": "website-change-snapshots",
  "renderJavaScript": false,
  "visualDiff": false,
  "fullPageScreenshot": false,
  "visualThresholdPercent": 0.1,
  "onlyChanges": false,
  "maxDiffLines": 200,
  "timeoutSecs": 45
}
```

# 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": [
        {
            "url": "https://example.com"
        }
    ]
};

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

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

```

## MCP server setup

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