# Website Screenshot API with Change Detection (`chun_yung_lo/website-screenshot-change-detector`) Actor

Capture a PNG or JPEG screenshot of any public web page URL (or raw HTML) and get an image hash to detect visual changes between scheduled runs.

- **URL**: https://apify.com/chun_yung_lo/website-screenshot-change-detector.md
- **Developed by:** [Chun-Yung Yong Lo](https://apify.com/chun_yung_lo) (community)
- **Categories:** Developer tools, SEO 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 $6.00 / 1,000 screenshots captured

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/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 Screenshot API with Change Detection

Capture a screenshot of any public web page (or of raw HTML) as PNG or JPEG. Every run returns the image (base64), its size and a SHA-256 hash. Pass the hash from a previous run as `previousHash` and the result tells you whether the page changed visually - ideal for scheduled monitoring, compliance archiving and visual QA.

### What it does

- Renders the page in headless Chromium (Playwright) at the viewport size you choose.
- Viewport-only or full-page capture (full page capped at 10,000 px height).
- PNG or JPEG output, optional extra wait for late-rendering pages.
- Change detection: compares the new image hash with `previousHash`.
- Blocks localhost and private network addresses.

### Input example

```json
{
  "url": "https://example.com",
  "width": 1280,
  "height": 720,
  "fullPage": true,
  "format": "png",
  "previousHash": ""
}
```

Provide exactly one of `url` (http/https) or `html`.

### Output example

```json
{
  "status": "ok",
  "source": "url",
  "url": "https://example.com",
  "finalUrl": "https://example.com/",
  "httpStatus": 200,
  "title": "Example Domain",
  "format": "png",
  "width": 1280,
  "height": 720,
  "imageBytes": 18432,
  "imageSha256": "<64 hex chars>",
  "changed": null,
  "imageBase64": "iVBORw0KGgo...",
  "capturedAt": "2025-01-01T00:00:00+00:00",
  "message": ""
}
```

`status` is one of `ok`, `http_error` (server answered 4xx/5xx, screenshot still included), `timeout`, `fetch_failed`, `browser_unavailable`. Invalid input fails the run with a clear error message.

### Pricing

US$0.006 per screenshot captured.

### Limits

- Public pages only; no login, no bypassing of bot protection or blocks.
- Viewport 200-3840 x 200-2160 px; full-page height capped at 10,000 px.
- Images larger than about 6 MB are not embedded (hash and size are still returned).
- Ads, animations, clocks and cookie banners can change the hash on every run; the hash detects any difference in the encoded image, not only meaningful changes.
- One URL per call.

### For AI agents (MCP)

Call this Actor through Apify's MCP server with one copy-paste input:

```json
{"url": "https://example.com", "fullPage": false, "includeImage": true}
```

One call captures one page and costs US$0.006. Check `status` first: `ok` means the image is valid; `changed` is `true`/`false` only when `previousHash` was supplied, otherwise `null`. Store `imageSha256` and pass it as `previousHash` next time to detect changes.

### Credits

Built on [Playwright for Python](https://github.com/microsoft/playwright-python) by Microsoft, licensed under Apache-2.0.

# Actor input Schema

## `url` (type: `string`):

Public http:// or https:// URL to capture. Localhost and private network addresses are rejected. Provide either url or html, not both.

## `html` (type: `string`):

Alternative to url - HTML markup to render and capture (max 1,000,000 characters). Provide either url or html, not both.

## `width` (type: `integer`):

Browser viewport width in pixels, 200 to 3840.

## `height` (type: `integer`):

Browser viewport height in pixels, 200 to 2160.

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

Capture the whole scrollable page instead of only the viewport. Height is capped at 10000 px.

## `format` (type: `string`):

Output image format: png or jpeg.

## `jpegQuality` (type: `integer`):

JPEG quality 1 to 100. Ignored for png.

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

Extra time to wait after the page load event before capturing, 0 to 30000 ms. Useful for late-rendering pages.

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

Maximum seconds to wait for the page to load, 5 to 120.

## `previousHash` (type: `string`):

Optional 64-character lowercase hex SHA-256 from an earlier run (field imageSha256). If given, the output field changed tells whether the capture differs.

## `includeImage` (type: `boolean`):

Return the image as base64 in field imageBase64. Images over about 6 MB are omitted (hash and size are still returned).

## Actor input object example

```json
{
  "url": "https://example.com",
  "width": 1280,
  "height": 720,
  "fullPage": false,
  "format": "png",
  "jpegQuality": 80,
  "waitMs": 0,
  "timeoutSecs": 30,
  "includeImage": true
}
```

# Actor output Schema

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

One row per processed input

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

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,chun_yung_lo/website-screenshot-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/qKkVStGhb2ufe0S0E/builds/2gNEuMFD5YuUaSZvo/openapi.json
