# Visual Change Detector - Website Screenshot Diff Monitor (`freecamp008/visual-change-detector`) Actor

Monitor websites for visual changes. Takes Playwright screenshots, compares them with the previous run (or staging vs production) pixel by pixel, stores a highlighted diff image and reports % changed plus a visible-text diff.

- **URL**: https://apify.com/freecamp008/visual-change-detector.md
- **Developed by:** [Camp8 fr0](https://apify.com/freecamp008) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 page checkeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Change Detector - Website Screenshot Diff & Visual Regression Monitor

**Visual Change Detector** monitors websites for visual changes. It takes a full-page screenshot of every URL with a real Chromium browser (Playwright), compares it pixel by pixel with the screenshot from the previous run, and gives you the **percentage of the page that changed**, a **highlighted diff image**, and a **summary of the visible text that was added or removed**. It can also compare two different URLs, such as **staging vs production**, for quick visual regression testing.

Schedule it on Apify and connect a webhook, Slack, email or Zapier/Make integration, and you have a complete **website change detection and alerting** tool with no servers and no code.

### What does Visual Change Detector do?

- Opens each page in headless Chromium with a fixed viewport (default 1366 x 768) and takes a **full-page or element screenshot**.
- **Monitor mode:** compares the screenshot with the **baseline** saved by the previous run for the same URL, viewport and selector. The first run creates the baseline (`status: "baseline-created"`), and later runs report `unchanged` or `changed`.
- **Compare mode:** compares **URL A vs URL B** pairs, for example a staging deploy against production, or two language versions.
- Uses [pixelmatch](https://github.com/mapbox/pixelmatch) for perceptual pixel diffing and ignores anti-aliasing noise.
- Saves the **current screenshot, the previous baseline and the diff image** as PNG files with public URLs.
- Adds a **text diff** of the page's visible text (lines added and removed), so you can see *what* changed and not only *where*.
- Hides cookie banners, ads, chat widgets and other dynamic elements that would trigger false alarms.

### Key features

- 📸 **Full-page, viewport or single-element screenshots** (`selector`, e.g. `#pricing`)
- 🔍 **Pixel diff with % changed**, changed pixel count, and a red-highlighted diff image
- 📝 **Visible text diff**: added and removed lines of text
- 🧭 **Two modes**: monitor against the previous run, or compare two URLs (staging vs production)
- 🍪 **Cookie banner hiding** for OneTrust, Cookiebot, Didomi, Usercentrics, Quantcast, TrustArc, Osano, CookieYes, Complianz, Borlabs, iubenda and more
- 🙈 **Hide dynamic elements** with CSS selectors (ads, carousels, clocks, live counters)
- 📐 **Handles different page heights**: both images are padded to the same size, and the extra area counts as changed (painted orange in the diff)
- 🎚️ **Tunable sensitivity**: `threshold` sets the per-pixel color sensitivity and `changeThresholdPercent` sets the alert threshold
- 🗄️ **Baselines that persist between runs** in a named key-value store, with one baseline set per `baselineStoreName`
- 🌍 Optional **Apify Proxy** support for geo-specific or protected pages
- ⚡ **Standby HTTP API** for instant checks from your own code or from AI agents

### Use cases

- **Website change monitoring**: get alerted when a competitor changes its pricing page, homepage, or terms.
- **Visual regression testing**: compare staging vs production after every deploy, or detect broken layouts and missing images.
- **Defacement and uptime-of-content monitoring**: notice when a page suddenly looks different or loses its content.
- **Compliance and brand monitoring**: track legal pages, affiliate or partner landing pages, and ad placements.
- **SEO monitoring**: catch unintended template changes, removed text, or changed headings.
- **E-commerce**: watch product pages for price, stock or layout changes.

### How to use Visual Change Detector

#### In Apify Console

1. Enter the **URLs to monitor** and click **Start**. The first run creates baselines.
2. Open **Schedules** and run the Actor hourly or daily with the same input. Each run compares with the previous one.
3. Add an **integration or webhook** (Actor > Integrations): Slack, email, Google Sheets, Zapier, Make, or your own webhook URL. Filter on `changed: true` in your automation to get alerts only for real changes.
4. Open the **Output** tab to see the screenshot, baseline and diff images side by side.

To compare staging vs production, set **Mode** to `compare` and fill in **Compare pairs**.

#### Via API

```bash
curl -X POST "https://api.apify.com/v2/acts/<USERNAME>~visual-change-detector/run-sync-get-dataset-items?token=<APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"mode": "monitor", "urls": ["https://example.com/pricing"]}'
```

#### Standby HTTP API (instant, no run start-up)

The Actor also runs in **Standby mode** as an HTTP endpoint that keeps a browser warm. Send the same fields as the input as GET query parameters or as a POST JSON body:

```bash
## Monitor (arrays are comma-separated in GET)
curl "https://<USERNAME>--visual-change-detector.apify.actor/?urls=https://example.com,https://example.org&fullPage=false" \
  -H "Authorization: Bearer <APIFY_TOKEN>"

## Compare staging vs production
curl -X POST "https://<USERNAME>--visual-change-detector.apify.actor/" \
  -H "Authorization: Bearer <APIFY_TOKEN>" -H "Content-Type: application/json" \
  -d '{"mode": "compare", "comparePairs": [{"urlA": "https://staging.example.com", "urlB": "https://example.com"}]}'
```

The response is `{ "count": 1, "items": [ ... ] }`. In a GET request, a pair can also be written as `comparePairs=https://a.com|https://b.com`.

🤖 **AI agents** can call this Actor and pay per call through **x402** via Apify, with no account setup. Each checked page is billed as one event.

### Input example

```json
{
  "mode": "monitor",
  "urls": ["https://example.com", "https://www.iana.org/help/example-domains"],
  "baselineStoreName": "visual-change-baselines",
  "updateBaseline": true,
  "viewportWidth": 1366,
  "viewportHeight": 768,
  "fullPage": true,
  "hideSelectors": [".ad-slot", "#chat-widget"],
  "blockCookieBanners": true,
  "delayMs": 500,
  "threshold": 0.1,
  "changeThresholdPercent": 0.5
}
```

Compare mode:

```json
{
  "mode": "compare",
  "comparePairs": [
    { "urlA": "https://staging.example.com/pricing", "urlB": "https://example.com/pricing" }
  ],
  "fullPage": true
}
```

| Field | Description |
|---|---|
| `mode` | `monitor` (vs previous run) or `compare` (URL A vs URL B) |
| `urls` | Pages to monitor (monitor mode) |
| `comparePairs` | `[{ "urlA", "urlB" }]` (compare mode); A is the reference, B the current page |
| `baselineStoreName` | Named key-value store holding baselines (default `visual-change-baselines`) |
| `updateBaseline` | Replace the baseline with the new screenshot after each check (default `true`). Turn it off to always compare with a fixed, approved baseline |
| `viewportWidth` / `viewportHeight` | Browser viewport (default 1366 x 768) |
| `fullPage` | Whole scrollable page (default `true`) |
| `selector` | Screenshot (and text-diff) only this element |
| `hideSelectors` | Elements to hide (`visibility: hidden`) before the screenshot |
| `blockCookieBanners` | Hide common cookie consent banners (default `true`) |
| `waitForSelector` | Wait for an element before the screenshot |
| `delayMs` | Extra wait before the screenshot (default 500 ms) |
| `navigationTimeoutSecs` | Page load timeout (default 45 s) |
| `threshold` | Pixelmatch color threshold, 0-1 (default 0.1; lower is more sensitive) |
| `changeThresholdPercent` | `changed` is `true` when more than this % of pixels differ (default 0.5) |
| `proxyConfiguration` | Optional Apify Proxy or custom proxies |

### Output example

One dataset item per URL (or per pair):

```json
{
  "url": "https://example.com/pricing",
  "mode": "monitor",
  "status": "changed",
  "changed": true,
  "changePercent": 3.214,
  "changedPixels": 41520,
  "totalPixels": 1291870,
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/example-com-pricing-1a2b3c-mwmd1x2y-screenshot.png",
  "baselineUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/example-com-pricing-1a2b3c-mwmd1x2y-baseline.png",
  "diffUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/example-com-pricing-1a2b3c-mwmd1x2y-diff.png",
  "baselineTakenAt": "2026-11-17T08:00:04.512Z",
  "checkedAt": "2026-11-18T08:00:03.981Z",
  "textDiff": {
    "added": ["Pro plan $29 / month"],
    "removed": ["Pro plan $25 / month"],
    "addedCount": 1,
    "removedCount": 1
  },
  "textChanged": true,
  "title": "Pricing - Example",
  "httpStatus": 200,
  "finalUrl": "https://example.com/pricing",
  "viewport": { "width": 1366, "height": 768 },
  "selector": null,
  "screenshotSize": { "width": 1366, "height": 2410 },
  "baselineSize": { "width": 1366, "height": 2410 },
  "baselineUpdated": true
}
```

- `status` is one of `baseline-created`, `unchanged`, `changed` or `error`.
- In the **diff image**, changed pixels are red, anti-aliasing differences are yellow, and area that exists in only one of the screenshots (a different page height or width) is orange.
- In compare mode, `baselineUrl` is the screenshot of URL A and `screenshotUrl` is the screenshot of URL B. The item also includes `urlA`, `urlB`, `titleA` and `httpStatusA`.
- Pages that fail to load (DNS error, timeout, missing `waitForSelector`) produce an item with `status: "error"` and an `error` message. **Error items are not charged.**

### Pricing

This Actor uses **pay-per-event** pricing:

| Event | Price | Per 1,000 |
|---|---|---|
| `page-checked` (one URL in monitor mode, or one pair in compare mode) | $0.004 | **$4.00** |

Failed pages are free. Apify platform usage (compute units, storage, and proxy if enabled) is billed separately according to your Apify plan. A typical page check takes 1-10 seconds of browser time.

Tip: set **Maximum cost per run** on the run, and the Actor stops cleanly when the budget is reached.

### FAQ

**How do I get alerts when a page changes?**
Create a **Schedule** (for example every hour) with your input, then add an **integration**: Slack, email, Google Sheets, Zapier, Make, or a **webhook** on the "Run succeeded" event. In your automation, read the dataset and act on items where `changed` is `true`. The diff image URL can go straight into the alert message.

**Why does a page show small changes on every run?**
Many sites contain rotating banners, animations, ads, timestamps or personalised content. Hide those elements with `hideSelectors`, screenshot only the part you care about with `selector`, or raise `changeThresholdPercent` (e.g. to 1-2%). Animations are disabled and the timezone and locale are fixed to reduce noise.

**Where are baselines stored and how do I reset them?**
In the named key-value store `baselineStoreName` (default `visual-change-baselines`) in your Apify account. A baseline is kept per URL + viewport + selector + full-page setting. To reset, delete the store or use a new `baselineStoreName`. Use different store names to keep separate baseline sets (e.g. per client).

**Can I compare against an approved baseline instead of the last run?**
Yes. Set `updateBaseline` to `false`. The first run creates the baseline, and every later run compares with that same image until you reset it.

**What about pages of different heights?**
Both screenshots are padded to the larger width and height. The padded area counts as changed and is shown in orange, so a page that grew or shrank is always flagged.

**Are there limits?**
Each URL is loaded in a fresh browser context (no cookies carried over). Very long pages make large screenshots, so for infinite-scroll pages use `fullPage: false` or a `selector`. Pages behind a login are not supported. Content from all languages is compared, because the diff works on pixels and on visible text.

**Is my data private?**
Screenshots and diffs are stored only in your own Apify storages. The Actor uses no third-party APIs.

**Is it legal to monitor websites?**
Taking screenshots of publicly accessible pages is generally legal, but you are responsible for complying with each website's terms of service and with applicable laws (copyright, privacy/GDPR). Don't use the Actor to collect personal data without a legal basis.

# Actor input Schema

## `mode` (type: `string`):

<b>monitor</b>: compare each URL with the baseline screenshot saved by the previous run (first run creates the baseline). <b>compare</b>: compare two URLs with each other (e.g. staging vs production) using <code>comparePairs</code>.

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

Pages to screenshot and compare with their previous baseline (monitor mode). One result per URL.

## `comparePairs` (type: `array`):

Pairs of pages to compare with each other, e.g. <code>\[{"urlA": "https://staging.example.com", "urlB": "https://example.com"}]</code>. URL A is treated as the reference ("baseline"), URL B as the current screenshot. One result per pair.

## `baselineStoreName` (type: `string`):

Name of the key-value store where baselines are kept between runs (monitor mode). Use different names to keep separate baseline sets, e.g. per project or environment.

## `updateBaseline` (type: `boolean`):

If enabled, the new screenshot replaces the baseline after comparing, so the next run compares with this run. Disable to always compare with a fixed (approved) baseline. A missing baseline is always created.

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

Browser viewport width in CSS pixels.

## `viewportHeight` (type: `integer`):

Browser viewport height in CSS pixels (also the screenshot height when full page is off).

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

Capture the whole scrollable page instead of only the visible viewport. Ignored when a selector is set.

## `selector` (type: `string`):

Optional CSS selector - screenshot (and text-diff) only this element, e.g. <code>#pricing</code> or <code>main</code>.

## `hideSelectors` (type: `array`):

CSS selectors of elements to hide before the screenshot (<code>visibility: hidden</code>), e.g. ads, chat widgets, clocks, rotating banners or other dynamic content that would cause false alarms.

## `blockCookieBanners` (type: `boolean`):

Inject CSS that hides common cookie consent banners (OneTrust, Cookiebot, Didomi, Usercentrics, Quantcast, TrustArc, Osano, CookieYes, Complianz and more).

## `waitForSelector` (type: `string`):

Optional CSS selector to wait for before taking the screenshot (useful for single-page apps).

## `delayMs` (type: `integer`):

Extra wait after the page has loaded, before the screenshot (lets animations, fonts and lazy content settle).

## `navigationTimeoutSecs` (type: `integer`):

Maximum time to wait for the page to load.

## `threshold` (type: `number`):

Pixelmatch color sensitivity from 0 to 1: how different two pixel colors must be to count as changed. Lower = more sensitive. 0.1 is a good default.

## `changeThresholdPercent` (type: `number`):

A page is reported as <code>changed</code> when more than this percentage of pixels differ. Raise it to ignore tiny rendering noise.

## `proxyConfiguration` (type: `object`):

Optional proxy for loading the pages (e.g. Apify Proxy for geo-specific or protected sites).

## Actor input object example

```json
{
  "mode": "monitor",
  "urls": [
    "https://example.com",
    "https://www.iana.org/help/example-domains"
  ],
  "comparePairs": [
    {
      "urlA": "https://example.com",
      "urlB": "https://example.org"
    }
  ],
  "baselineStoreName": "visual-change-baselines",
  "updateBaseline": true,
  "viewportWidth": 1366,
  "viewportHeight": 768,
  "fullPage": true,
  "hideSelectors": [
    ".ad-slot",
    "#chat-widget",
    ".live-counter"
  ],
  "blockCookieBanners": true,
  "delayMs": 500,
  "navigationTimeoutSecs": 45,
  "threshold": 0.1,
  "changeThresholdPercent": 0.5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

## `images` (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 = {
    "mode": "monitor",
    "urls": [
        "https://example.com",
        "https://www.iana.org/help/example-domains"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("freecamp008/visual-change-detector").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 = {
    "mode": "monitor",
    "urls": [
        "https://example.com",
        "https://www.iana.org/help/example-domains",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("freecamp008/visual-change-detector").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 '{
  "mode": "monitor",
  "urls": [
    "https://example.com",
    "https://www.iana.org/help/example-domains"
  ]
}' |
apify call freecamp008/visual-change-detector --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,freecamp008/visual-change-detector"
        }
    }
}
```

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/G0mzSd6HNt0dQFktt/builds/adJT5D4nbhMiisaZg/openapi.json
