# Visual + Text Change Monitor (screenshot diff) (`saksham1341/visual-change-monitor`) Actor

Screenshot and text change monitor: each run compares a page with the previous run and returns the percentage changed, the changed regions, a highlighted diff image, before and after screenshots and a text diff. Ignore selectors for ads and timestamps.

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

## Pricing

from $10.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

## Visual + Text Change Monitor

Watch web pages for changes and see **what changed and where**. Each run takes a full-page screenshot with headless Chromium, reads the page's visible text, and compares both with the previous snapshot. You get back only the pages that changed, with:

- the **share of the page that changed** (% of pixels),
- **boxes around the changed regions** (nearby changes merged into one box),
- a **diff image** with the changes highlighted in red, plus **before and after screenshots** (links you can open),
- a **text diff**: lines added and removed, and a unified diff,
- a one-line **summary**.

Screenshot tools give you an image but no comparison; most change monitors give you a text diff but no picture. This does both, and tells you where on the page the change is.

Built for people who watch competitors' pricing and landing pages, QA and marketing teams checking their own sites for unexpected changes, and anyone tracking pages that have no feed.

### How it works

1. For each URL it checks `robots.txt`, loads the page, waits (network idle, a CSS selector, or a fixed delay), and takes a screenshot of the full page or only the first screen.
2. Elements you list in `ignoreSelectors` (ads, timestamps, carousels, cookie banners) are painted grey in the screenshot and removed from the text, so they never count as changes.
3. The screenshot is compared with the stored one at a normalised width. A pixel counts as changed when its colour differs by more than `pixelThreshold`. A visual change is reported when at least `minChangedPercent` of the page changed. Any text change is reported.
4. The snapshot is kept in a named key-value store **in your own account** (`stateKey`).

The **first run** for a URL saves a baseline and returns it with its screenshot. Changes are reported from the second run on.

The baseline only moves forward when a change is reported. Pages that change a tiny bit every day (below your thresholds) are still compared with the last reported version, so small changes add up and get reported once they cross the threshold.

### Input example

```json
{
  "urls": ["https://example.com/pricing", "https://competitor.com/"],
  "stateKey": "competitor-pages",
  "viewport": "desktop",
  "fullPage": true,
  "waitFor": "networkidle",
  "ignoreSelectors": [".ad", "time", ".carousel", "#cookie-banner"],
  "pixelThreshold": 10,
  "minChangedPercent": 0.1
}
```

Schedule it (for example daily) with the same `stateKey`. Use a different `stateKey` per watch list.

### Output example

```json
{
  "url": "https://competitor.com/",
  "status": "changed",
  "changed": true,
  "summary": "4.82% of the page changed in 2 regions; page 120 px taller; 3 text line(s) added, 1 removed.",
  "visualChange": true,
  "textChange": true,
  "changedPercent": 4.82,
  "regionCount": 2,
  "regions": [
    {"x": 96, "y": 640, "width": 1248, "height": 310, "changedPercent": 41.3},
    {"x": 0, "y": 5210, "width": 1440, "height": 120, "changedPercent": 100}
  ],
  "heightBefore": 5210, "heightAfter": 5330, "heightChange": 120, "heightTruncated": false,
  "diffImageUrl": "https://api.apify.com/v2/key-value-stores/.../records/url-...-diff.png",
  "beforeScreenshotUrl": "https://api.apify.com/v2/key-value-stores/.../records/url-...-before.png",
  "afterScreenshotUrl": "https://api.apify.com/v2/key-value-stores/.../records/url-...-after.png",
  "text": {
    "changed": true, "addedLines": 3, "removedLines": 1,
    "added": ["Pro plan $49/month", "..."], "removed": ["Pro plan $39/month"],
    "unifiedDiff": "--- before\n+++ after\n@@ -12,1 +12,1 @@\n-Pro plan $39/month\n+Pro plan $49/month",
    "truncated": false
  },
  "checkedAt": "2026-11-09T09:00:00+00:00",
  "previousSnapshotAt": "2026-11-08T09:00:00+00:00",
  "httpStatus": 200,
  "finalUrl": "https://competitor.com/",
  "pageHeight": 5330,
  "notes": []
}
```

`status` is `baseline`, `changed` or `unchanged` (only returned with `alwaysReturn`). Pages that could not be checked come back as `status: "error"` or `"blocked"` with the reason, and are not charged.

Region coordinates are in pixels of the after screenshot. `changedPercent` is measured over the larger of the two page heights: when a page gets taller or shorter, the added or lost strip counts as changed.

### Text-only mode

Set `textOnly: true` to compare only the visible text, with no screenshots. It is faster and only the per-URL check is charged.

### Pricing

- **$0.01 per URL checked**
- **$0.03 per changed page returned** in screenshot mode (visual or text change; comes with regions, diff image and before/after screenshots)

Text-only mode is charged only the $0.01 check, also when the text changed. URLs that fail or are blocked are not charged.

Example: 20 pages checked daily, 2 of them changing on a typical day: 20 x $0.01 + 2 x $0.03 = $0.26 a day.

### Honest limits

- **It is a pixel comparison.** Content inserted near the top pushes everything below it down, so most of the page shows as changed. The regions and text diff still show what was added.
- Pages with rotating content (carousels, ads, "time ago" stamps, A/B tests, personalised blocks) change on every run. Use `ignoreSelectors`, raise `minChangedPercent`, or use text-only mode.
- Lazy-loaded images below the first screen may not have loaded when the full-page screenshot is taken.
- Full-page screenshots are cut at `maxPageHeight` (default 15,000 px; flagged as `heightTruncated`). Very large screenshots are stored as JPEG to stay within storage limits.
- Changing the viewport, full-page setting, page height limit or ignore list starts a new baseline for each URL instead of reporting a change.
- It identifies itself honestly (Chromium's user agent plus `VisualChangeMonitor/1.0`) and obeys `robots.txt`. Sites that block automated access (HTTP 403, 429, bot challenges) are reported as blocked, not worked around. It does not log in, and does not get past paywalls or CAPTCHAs.
- Pages are checked one after another; expect roughly 5-20 seconds per page.
- Screenshot and diff links point to this run's key-value store and expire with your run data retention.

# Actor input Schema

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

Pages to watch. Each page is compared with its own previous snapshot.

## `stateKey` (type: `string`):

Name of the key-value store in your account that keeps the last snapshot of each URL. Use different names for separate watch lists. Lowercase letters, digits and hyphens.

## `alwaysReturn` (type: `boolean`):

Return an item for every URL, also when nothing changed. Off: only changed URLs (and first-run baselines) are returned.

## `textOnly` (type: `boolean`):

Compare only the visible text, no screenshot. Cheaper: only the per-URL check is charged.

## `viewport` (type: `string`):

Desktop 1440x900, tablet 820x1180 or mobile 390x844 (mobile/tablet emulate a touch device).

## `viewportWidth` (type: `integer`):

Optional. Overrides the preset's width.

## `fullPage` (type: `boolean`):

Capture the whole scrollable page. Off: only the first screen (above the fold).

## `maxPageHeight` (type: `integer`):

Full-page captures are cut at this height. Longer pages are flagged with heightTruncated.

## `waitFor` (type: `string`):

When to take the snapshot after the page loads: when the network is idle (at most 20 s), when a CSS selector appears, or after a fixed delay.

## `waitSelector` (type: `string`):

Used when the wait strategy is 'CSS selector appears', e.g. #main-content.

## `waitMs` (type: `integer`):

Used when the wait strategy is 'Fixed delay'.

## `ignoreSelectors` (type: `array`):

Ads, timestamps, carousels, cookie banners: these are painted over in the screenshot and removed from the text before comparing.

## `pixelThreshold` (type: `number`):

How different a pixel's colour must be (0-100 % of the full range) to count as changed. Raise it to ignore anti-aliasing and compression noise.

## `minChangedPercent` (type: `number`):

A visual change is reported only when at least this share of the page changed. Text changes are always reported.

## `mergeDistance` (type: `integer`):

Changed areas closer than this are reported as one region.

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

Caps the added/removed line lists and the unified diff.

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

Maximum time to load one page.

## Actor input object example

```json
{
  "urls": [
    "https://example.com",
    "https://news.ycombinator.com"
  ],
  "stateKey": "visual-change-monitor-state",
  "alwaysReturn": false,
  "textOnly": false,
  "viewport": "desktop",
  "fullPage": true,
  "maxPageHeight": 15000,
  "waitFor": "networkidle",
  "waitMs": 2000,
  "ignoreSelectors": [
    ".ad",
    "time",
    "[class*=carousel]"
  ],
  "pixelThreshold": 10,
  "minChangedPercent": 0.1,
  "mergeDistance": 24,
  "maxDiffLines": 200,
  "timeoutSecs": 45
}
```

# Actor output Schema

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

No description

## `files` (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://example.com",
        "https://news.ycombinator.com"
    ],
    "stateKey": "visual-change-monitor-state",
    "ignoreSelectors": [
        ".ad",
        "time",
        "[class*=carousel]"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("saksham1341/visual-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://example.com",
        "https://news.ycombinator.com",
    ],
    "stateKey": "visual-change-monitor-state",
    "ignoreSelectors": [
        ".ad",
        "time",
        "[class*=carousel]",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("saksham1341/visual-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://example.com",
    "https://news.ycombinator.com"
  ],
  "stateKey": "visual-change-monitor-state",
  "ignoreSelectors": [
    ".ad",
    "time",
    "[class*=carousel]"
  ]
}' |
apify call saksham1341/visual-change-monitor --silent --output-dataset

```

## MCP server setup

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