# Website Screenshot API — PDF & Visual Diff (`zenomastro/website-screenshot-pro`) Actor

Website screenshot API for URLs or raw HTML. Capture PNG, JPEG, WebP or PDF with full-page, element or region modes, device presets, retina, dark mode, lazy-load scrolling, cleanup, auth, locale, timezone, geo and proxy controls. Monitor hashes and pixel-change visual diffs with SSRF protection.

- **URL**: https://apify.com/zenomastro/website-screenshot-pro.md
- **Developed by:** [Rosario Vitale](https://apify.com/zenomastro) (community)
- **Categories:** Developer tools, Automation, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 website screenshots

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

## Website Screenshot API & PDF Converter — Visual Diff

### Why use this Actor?

Website screenshot API for URLs or raw HTML. Capture PNG, JPEG, WebP or PDF with full-page, element or region modes, device presets, retina, dark mode, lazy-load scrolling, cleanup, auth, locale, timezone, geo and proxy controls. Monitor hashes and pixel-change visual diffs with SSRF protection.

### Features

- **Page URLs** — Public HTTP/HTTPS pages to capture. Can be combined with raw htmlDocuments.
- **Full page** — Capture the entire scrollable page when no element selector is set.
- **CSS element selector** — Optional CSS selector to capture one visible element instead of the full page.
- **Viewport width** — Browser viewport width in pixels.
- **Viewport height** — Browser viewport height in pixels.
- **Image format** — Screenshot output format.
- **JPEG quality** — JPEG quality from 20 to 100; ignored for PNG.
- **Delay after page load** — Extra milliseconds to wait after DOMContentLoaded before capture.
- **Navigation timeout** — Maximum seconds to wait for page navigation.
- **Hide common cookie banners** — Apply a conservative CSS rule that hides elements whose id/class contains cookie or consent.
- **Proxy configuration** — Optional Apify or custom proxy configuration for pages that block direct cloud access.
- **User agent** — Browser User-Agent string.

### Use cases

- Visual qa.
- Website monitoring.
- Mobile/desktop evidence capture.
- Pdf and screenshot automation.

### Example input

```json
{
  "urls": [
    "https://example.com"
  ],
  "fullPage": true,
  "viewportWidth": 1440,
  "viewportHeight": 900,
  "format": "png",
  "jpegQuality": 85
}
```

### Pricing & cost control

Use the bounded input limits and filters to keep runs predictable. Pay-per-result Actors only charge primary result rows; summary, status and monitoring metadata are designed to add context without inflating result volume.

### FAQ

**What is this Actor for?**\
It is designed for visual QA, website monitoring, mobile/desktop evidence capture.

**Can I run it on a schedule?**\
Yes. You can schedule Actor runs on Apify and send the resulting dataset into automations, webhooks, storage, or downstream APIs.

**How do I control cost and run size?**\
Use the input limits and filters shown in the Actor input form. The Actor applies bounded defaults and hard caps so large jobs remain predictable.

### Search keywords

website screenshot api, website screenshot api free, page screenshot api, website thumbnail api, verypdf website screenshot api, apify website screenshot, apify website screenshot generator, apify website screenshot crawler, website screenshot history, can a website detect screenshots, webpage screenshot, webpage screenshot extension, webpage screenshot extension chrome, webpage screenshot chrome

Capture public web pages as PNG or JPEG images for monitoring, visual QA, archives, previews, reporting, competitive research and automation workflows.

### Features

- full-page screenshots
- viewport-only or CSS element capture
- configurable viewport size
- PNG and JPEG output with JPEG quality control
- optional post-load delay for dynamic pages
- optional proxy configuration
- conservative cookie/consent banner hiding
- screenshot binary stored in the default key-value store
- dataset rows containing direct record URLs and capture metadata
- duplicate URL suppression and per-page diagnostics

### Input example

```json
{"urls":["https://example.com"],"fullPage":true,"viewportWidth":1440,"viewportHeight":900,"format":"png","delayMs":500,"proxyConfiguration":{"useApifyProxy":false}}
```

Set `elementSelector` to capture a specific visible component rather than the whole page.

### Output

Each successful `screenshot` row includes final URL, HTTP status when available, title, viewport, format, byte size, key-value-store record key and screenshot URL. Failures are returned as free diagnostic `error` rows.

### Pricing

Target launch price: **$0.0025 per successful screenshot**, positioned below several specialized screenshot Actors while allowing reliable Chromium operation. Failed captures are not billed as successful screenshots.

### Reliability and cost controls

The Actor validates and deduplicates URLs, has bounded navigation timeouts and per-page isolation, supports direct mode by default, and allows Apify/custom proxies only when needed.

### Responsible use

Capture public pages in accordance with applicable website terms, copyright, privacy, robots policies and rate limits.

### Support

For reproducible issues provide the public URL, capture settings and Apify run ID. Never include private credentials.

### Extended capabilities

- Capture PNG, JPEG, WebP, or PDF with desktop/mobile/tablet presets, custom viewport/DPR, locale, timezone, and optional geolocation.
- Capture full pages, a CSS element, or an exact clip region; render raw HTML without hosting it.
- Support authorized Basic auth, cookies, headers, console/page-error capture, and persistent visual-change comparison.

# Actor input Schema

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

Public HTTP/HTTPS pages to capture. Can be combined with raw htmlDocuments.

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

Capture the entire scrollable page when no element selector is set.

## `elementSelector` (type: `string`):

Optional CSS selector to capture one visible element instead of the full page.

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

Browser viewport width in pixels.

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

Browser viewport height in pixels.

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

Screenshot output format.

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

JPEG quality from 20 to 100; ignored for PNG.

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

Extra milliseconds to wait after DOMContentLoaded before capture.

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

Maximum seconds to wait for page navigation.

## `hideCookieBanners` (type: `boolean`):

Apply a conservative CSS rule that hides elements whose id/class contains cookie or consent.

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

Optional Apify or custom proxy configuration for pages that block direct cloud access.

## `userAgent` (type: `string`):

Browser User-Agent string.

## `devicePreset` (type: `string`):

Built-in viewport, DPR and mobile/touch behavior. Explicit width/height can override dimensions.

## `deviceScaleFactor` (type: `number`):

Override preset deviceScaleFactor for retina/high-DPI captures.

## `colorScheme` (type: `string`):

Emulate prefers-color-scheme.

## `waitUntil` (type: `string`):

Navigation readiness strategy before optional delay.

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

Optional selector that must become visible before capture.

## `hideAdsAndTrackers` (type: `boolean`):

Abort requests to a conservative list of common analytics/ad hosts.

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

Custom CSS selectors hidden before capture.

## `blockResourceTypes` (type: `array`):

Optional Playwright resource types to block, e.g. font, media.

## `extraHTTPHeaders` (type: `object`):

Optional request headers such as Accept-Language. Do not put secrets in public run inputs.

## `cookies` (type: `array`):

Optional Playwright cookie objects for pages you are authorized to access.

## `captureConsole` (type: `boolean`):

Include bounded browser console messages and page JavaScript errors.

## `monitorKey` (type: `string`):

Stable key used to compare captures across scheduled runs.

## `comparePrevious` (type: `boolean`):

When monitorKey is set, report exact hash change and PNG pixel-change percentage against the prior capture.

## `pdfPageSize` (type: `string`):

Used only for PDF output.

## `pdfPrintBackground` (type: `boolean`):

Include CSS backgrounds in PDF.

## `pdfLandscape` (type: `boolean`):

Landscape PDF orientation.

## `webpQuality` (type: `integer`):

WebP output quality from 20 to 100.

## `clip` (type: `object`):

Optional region capture object with numeric x, y, width and height. Mutually exclusive with elementSelector and PDF.

## `geolocation` (type: `object`):

Optional browser geolocation object: latitude, longitude and optional accuracy.

## `httpCredentials` (type: `object`):

Optional username/password for HTTP Basic authentication on pages you are authorized to access.

## `locale` (type: `string`):

Browser locale such as en-US, it-IT or de-DE.

## `timezoneId` (type: `string`):

Optional IANA timezone such as Europe/Rome or America/New\_York.

## `htmlDocuments` (type: `array`):

Optional raw HTML objects with html, optional baseUrl and id. Useful for rendering generated HTML without hosting it.

## `waitForFonts` (type: `boolean`):

Wait for document.fonts.ready before capture so text layout is more stable.

## `autoScroll` (type: `boolean`):

Scroll through the page before capture to trigger lazy-loaded images and sections, then return to the top.

## `scrollStepPx` (type: `integer`):

Vertical distance per lazy-load scroll step.

## `scrollDelayMs` (type: `integer`):

Delay between lazy-load scroll steps.

## `maxScrollSteps` (type: `integer`):

Hard cap on lazy-load scrolling for very long pages.

## `hideStickyElements` (type: `boolean`):

Optionally hide wide fixed/sticky headers and footers before capture. Disabled by default to avoid changing intentional page content.

## Actor input object example

```json
{
  "urls": [
    "https://example.com"
  ],
  "fullPage": true,
  "elementSelector": "",
  "viewportWidth": 1440,
  "viewportHeight": 900,
  "format": "png",
  "jpegQuality": 85,
  "delayMs": 500,
  "navigationTimeoutSecs": 45,
  "hideCookieBanners": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/143.0.0.0 Safari/537.36",
  "devicePreset": "desktop",
  "colorScheme": "no-preference",
  "waitUntil": "domcontentloaded",
  "waitForSelector": "",
  "hideAdsAndTrackers": false,
  "hideSelectors": [],
  "blockResourceTypes": [],
  "extraHTTPHeaders": {},
  "cookies": [],
  "captureConsole": false,
  "monitorKey": "",
  "comparePrevious": false,
  "pdfPageSize": "A4",
  "pdfPrintBackground": true,
  "pdfLandscape": false,
  "webpQuality": 82,
  "clip": {},
  "geolocation": {},
  "httpCredentials": {},
  "locale": "en-US",
  "timezoneId": "",
  "htmlDocuments": [],
  "waitForFonts": true,
  "autoScroll": true,
  "scrollStepPx": 700,
  "scrollDelayMs": 80,
  "maxScrollSteps": 40,
  "hideStickyElements": false
}
```

# Actor output Schema

## `results` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("zenomastro/website-screenshot-pro").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("zenomastro/website-screenshot-pro").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 '{}' |
apify call zenomastro/website-screenshot-pro --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zenomastro/website-screenshot-pro"
        }
    }
}
```

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/JiddO5LG3nsHRn3IH/builds/9bF4nmf71rxN9mH7d/openapi.json
