# Website Change Monitor (Text Diff + Webhook) (`ninja.dev/website-change-monitor`) Actor

Monitor any list of web pages for changes: prices, terms, job pages, competitor sites, government notices. Each run compares the page (or one CSS section) with the last run and returns added and removed lines. Schedule it daily, get a webhook on change.

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

## Pricing

from $2.00 / 1,000 page 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 + Webhook)

Watch any list of web pages and find out exactly what changed. Every run fetches each page, extracts the visible text (or just the part you care about, with a CSS selector) and compares it with the previous run. You get one row per page with its status (`new`, `changed`, `unchanged` or `error`) and the **added and removed lines**.

Put it on a daily or hourly schedule and you have a change tracker for prices, policies, job openings or any page that matters to you, with an optional webhook to Slack, Zapier, Make or your own API.

### Use cases

- **Competitor monitoring**: pricing pages, feature lists, plan names.
- **Legal and compliance**: terms of service, privacy policies, regulatory notices.
- **Jobs and procurement**: careers pages, tender or grant listings, "open positions" sections.
- **E-commerce**: product availability text, promotions, shipping policies.
- **Research and journalism**: government pages, public statements, documentation.
- **Your own sites**: catch accidental content changes after a deploy.

### How it works

1. You list the pages (and optionally a CSS selector such as `#pricing` or `main`).
2. The first run saves a snapshot of each page (`status: "new"`).
3. Every following run compares with the last snapshot and returns `changed` with the exact lines added and removed, or `unchanged`.
4. Snapshots live in a named key-value store (`wcm-snapshots-<monitorName>`) in your account, so they persist between runs and schedules. Use a different `monitorName` per task to keep monitors separate.

### Input

| Field | What it does |
|---|---|
| `urls` | Pages to watch. |
| `cssSelector` | Only watch part of the page, e.g. `#pricing`, `.jobs`, `main`. |
| `ignorePatterns` | Regular expressions removed before comparing, e.g. `\d+ minutes ago` or `Updated .*`, to skip noise. |
| `compareMode` | `text` (recommended) or `html`. |
| `monitorName` | Keeps snapshots separate per monitor. |
| `onlyChanges` | Output only changed pages (and errors). |
| `webhookUrl` | POST a JSON summary when a page changes. |
| `includeContent` | Also return the full current text. |
| `maxDiffLines` | Cap on returned diff lines. Default 200. |

### Output

```json
{
  "recordType": "check",
  "url": "https://example.com/pricing",
  "status": "changed",
  "changed": true,
  "title": "Pricing",
  "checkedAt": "2026-10-13T09:00:00.000Z",
  "previousCheckedAt": "2026-10-12T09:00:00.000Z",
  "addedLines": ["Pro plan $49 / month"],
  "removedLines": ["Pro plan $39 / month"],
  "addedCount": 1,
  "removedCount": 1
}
```

Webhook payload: `url`, `title`, `checkedAt`, `addedLines`, `removedLines` (first 50 each) and the counts.

### Pricing

Pay per page check. With `onlyChanges` on, you are only charged for pages that changed or failed.

### Limits and good practice

- Pages are fetched with plain HTTP, which is fast and cheap. Pages that need a login, render all content with JavaScript, or block bots will return an `error` row with a hint.
- Only monitor pages you are allowed to access, and keep the schedule reasonable (daily or hourly is plenty for most pages).
- Dynamic bits like "5 minutes ago" or view counters show up as changes. Use `ignorePatterns` or a tighter `cssSelector` to remove them.

### Related Actors

- [Domain Availability & WHOIS](https://apify.com/ninja.dev/domain-availability-whois): check domain availability and WHOIS data in bulk.
- [Telegram Channel Scraper](https://apify.com/ninja.dev/telegram-channel-scraper): public Telegram channel posts, with monitor mode.
- [US Government Contracts & Grants](https://apify.com/ninja.dev/us-gov-contracts-grants): federal contract winners and open grants.

# Actor input Schema

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

Full URLs, e.g. https://example.com/pricing. Each run compares every page with the previous run.

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

Only watch one part of the page, e.g. #pricing, .job-list or main. Empty = whole page body.

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

Regular expressions removed before comparing, to skip noise like dates or counters, e.g. \d+ views or Updated .\*

## `compareMode` (type: `string`):

Text ignores layout and markup changes. HTML also catches link and attribute changes.

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

Snapshots are kept per name in a named key-value store, so separate tasks can watch the same page independently.

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

Skip unchanged and first-seen pages in the dataset (errors are still reported).

## `webhookUrl` (type: `string`):

POST a JSON summary here whenever a page changes, e.g. a Slack, Zapier or Make webhook.

## `includeContent` (type: `boolean`):

Add the current extracted text (up to 100k characters) to each row.

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

Maximum added and removed lines returned per page.

## Actor input object example

```json
{
  "urls": [
    "https://www.iana.org/domains/reserved"
  ],
  "compareMode": "text",
  "monitorName": "default",
  "onlyChanges": false,
  "includeContent": false,
  "maxDiffLines": 200
}
```

# Actor output Schema

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

Status and text diff for every monitored page.

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

Counts of changed, new, unchanged and failed pages.

# 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.iana.org/domains/reserved"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninja.dev/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.iana.org/domains/reserved"] }

# Run the Actor and wait for it to finish
run = client.actor("ninja.dev/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.iana.org/domains/reserved"
  ]
}' |
apify call ninja.dev/website-change-monitor --silent --output-dataset

```

## MCP server setup

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