# Website Change Monitor - Page Diff Tracker (CSS selector) (`admirala/website-change-monitor-diff`) Actor

Website change detection: monitor pages on a schedule and get the exact added and removed lines. Watch a CSS selector, ignore dates and counters. $0.0007 per page checked.

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

## Pricing

from $0.47 / 1,000 per 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Diff Tracker (CSS selector)

> ✅ **Tested daily** with its default input (Apify's automated QA plus our own smoke test before every release).

**Website change monitor**: know when a page changes and see exactly what changed. Run this Actor on a schedule and it compares each page's visible text (or one CSS selector) with the previous run, returning the **added and removed lines**. **$0.0007 per page checked**.

### Typical uses

- Competitor pricing pages, plans and feature lists
- Terms of service, privacy policies and legal notices
- Changelogs, release pages, job boards of your own company, documentation
- Stock or availability text on a product page (watch only that element with a CSS selector)

### How it works

1. The page is downloaded (no browser, so it is fast and cheap) and scripts and styles are stripped.
2. The visible text — of the whole page or only of the elements matching `cssSelector` — is split into lines.
3. Text matching your `ignorePatterns` (dates, counters, session IDs) is removed so it cannot trigger false alarms.
4. A SHA-256 hash is compared with the snapshot of the previous run; when it differs you get a line diff.

Snapshots live in a named key-value store `website-change-monitor-<monitorName>` in your own Apify account, so history survives between runs. Use different `monitorName` values to keep separate watch lists apart.

### Output per page

| Field | Meaning |
|---|---|
| `changeStatus` | `new` (first run), `unchanged`, `changed` or `error` |
| `changed` | true / false |
| `added`, `removed` | Lines added and removed since the last run (capped by `maxDiffLines`) |
| `addedCount`, `removedCount`, `changeRatio` | Size of the change |
| `previousCheckAt`, `lastChangeAt`, `checkedAt` | Timestamps |
| `hash`, `previousHash`, `httpStatus`, `finalUrl` | Technical details |

The `OUTPUT` record in the default key-value store lists only the changed pages — connect it to an email, Slack or webhook integration and use `onlyChanges: true` for a quiet dataset.

### Input

| Field | Default | Description |
|---|---|---|
| `urls` | – | Pages to watch |
| `cssSelector` | – | Watch only this part of the page |
| `ignorePatterns` | – | Regular expressions removed before comparing |
| `monitorName` | default | Name of the snapshot store |
| `onlyChanges` | false | Output only changed pages (and errors) |
| `maxDiffLines` | 200 | Cap on reported diff lines |
| `timeoutSecs` | 30 | Per-request timeout |

### Pricing (pay per event)

- **$0.0007 per page checked**, whether it changed or not. Pages that fail to load are not charged.

### Limits

Pages that build their content only with JavaScript in the browser show little text without a browser; this Actor reads the HTML the server sends. Only public pages you list are requested — no logins, no personal data.

### Use with AI agents (MCP)

This Actor can be used as a tool by AI agents (Claude, Cursor, VS Code, other MCP clients) through the official [Apify MCP server](https://docs.apify.com/platform/integrations/mcp):

- Add only this Actor as a tool: `https://mcp.apify.com?tools=admirala/website-change-monitor-diff` (sign in with OAuth or an Apify API token).
- Or connect `https://mcp.apify.com` and let the agent find it with `search-actors` (e.g. "website change monitor"), read the input schema with `fetch-actor-details` and run it with `call-actor`.

Example input an agent can pass:

```json
{
  "urls": [
    "https://www.python.org/downloads/"
  ],
  "cssSelector": "",
  "monitorName": "default"
}
```

Cost per call: $0.0007 per page checked (changed or not); pages that fail to load are free. Results come back as dataset items (`get-dataset-items`).

### FAQ

**How do I get notified when a web page changes?**
Schedule the Actor (hourly or daily), set `onlyChanges: true` and connect an email, Slack or webhook integration to the run.

**Can I watch only the price or one part of a page?**
Yes, set `cssSelector`, e.g. `#price`.

**Does it work on JavaScript-only pages?**
It reads the HTML the server sends, without a browser; pages that render only in the browser show little text.

### Related actors

- [Wayback Machine Scraper - Archived Snapshots & Page Text](https://apify.com/admirala/wayback-machine-snapshots)
- [Website Uptime Monitor - Status, Response Time & SSL](https://apify.com/admirala/website-uptime-ssl-monitor)

# Actor input Schema

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

Public pages to watch, e.g. \["https://www.python.org/downloads/"]. Schedule the Actor (e.g. hourly or daily); each run compares with the previous run. $0.0007 per page.

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

Optional CSS selector to watch only part of the page, e.g. '#price' or 'main .changelog'. Empty = all visible text.

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

Regular expressions whose matches are removed before comparing, to avoid false alarms, e.g. \["\d{1,2} (minutes|hours) ago", "Views: \d+"].

## `monitorName` (type: `string`):

Name of the snapshot store 'website-change-monitor-<name>' in your account. Use different names for independent watch lists.

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

true = leave unchanged pages out of the dataset (they are still checked and charged).

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

Maximum number of added + removed lines reported per page (1-5000).

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

Per-request timeout in seconds (3-120).

## Actor input object example

```json
{
  "urls": [
    "https://www.python.org/downloads/"
  ],
  "monitorName": "default",
  "onlyChanges": false,
  "maxDiffLines": 200,
  "timeoutSecs": 30
}
```

# Actor output Schema

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

No description

## `summary` (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.python.org/downloads/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("admirala/website-change-monitor-diff").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.python.org/downloads/"] }

# Run the Actor and wait for it to finish
run = client.actor("admirala/website-change-monitor-diff").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.python.org/downloads/"
  ]
}' |
apify call admirala/website-change-monitor-diff --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,admirala/website-change-monitor-diff"
        }
    }
}
```

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/1h68EGnONXgfbHgMo/builds/YD7H04gk6dltGLkBi/openapi.json
