# Website Screenshot & PDF Capture (`cheremikin/screenshot-capture`) Actor

Capture full-page or viewport screenshots (PNG, JPEG, WebP) and PDFs of any URLs. Desktop, laptop, tablet and mobile device emulation, element capture, dark mode, cookie-banner hiding, lazy-load scrolling. Files + public links.

- **URL**: https://apify.com/cheremikin/screenshot-capture.md
- **Developed by:** [Alexandr Cheremikin](https://apify.com/cheremikin) (community)
- **Categories:** Developer 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 $3.00 / 1,000 screenshot captureds

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 Screenshot & PDF Capture

Turn a list of URLs into **screenshots (PNG, JPEG, WebP) or PDF files** in one run. Desktop, laptop, tablet and real mobile device emulation (iPhone, Android), full-page capture with lazy-load scrolling, single-element capture, dark mode, cookie-banner hiding and print-ready PDFs.

Every file is saved to the run's key-value store, and you get **one dataset row per URL** with a direct link to the file. A URL that fails doesn't stop the run: it gets its own error row and **you are not charged for it**.

### Features

| Feature | This actor | Basic screenshot actors |
|---|---|---|
| Batch of URLs in one run | ✅ | ✅ |
| Viewport screenshot | ✅ | ✅ |
| Full-page screenshot | ✅ | ✅ |
| Scrolls first so lazy-loaded images appear in full-page shots | ✅ | rarely |
| Device presets: desktop 1920×1080, laptop 1366×768 | ✅ | partial |
| Real device emulation: iPad, iPhone, Android (Pixel), with mobile user agent, touch and pixel ratio | ✅ | rarely |
| Custom width × height, retina (2×/3×) | ✅ | partial |
| Capture a single element by CSS selector | ✅ | rarely |
| PNG, JPEG, **WebP** (with quality setting) | ✅ | PNG/JPEG |
| **PDF** (A4, Letter, Legal, A3, Tabloid; backgrounds; landscape; screen or print CSS) | ✅ | ❌ |
| Wait strategies: load / DOM ready / network idle, extra delay, wait for an element | ✅ | partial |
| Hide elements by CSS (chat widgets, popups) | ✅ | rarely |
| Hide common cookie/consent banners (about 50 CMPs) with CSS. Nothing is clicked or accepted | ✅ | ❌ |
| Dark mode (`prefers-color-scheme: dark`) | ✅ | ❌ |
| Per-URL error rows (HTTP status, timeouts, blocked pages) | ✅ | partial |
| Failed URLs are free | ✅ | ❌ |
| Price | **$3 per 1,000 captures** | — |

### Output

One dataset row per URL (real example from a test run):

| Field | Example |
|---|---|
| `url` | `https://www.python.org` |
| `finalUrl` | `https://www.python.org/` (after redirects) |
| `status` | `200` (HTTP status of the page) |
| `title` | `Welcome to Python.org` |
| `format` | `png` / `jpeg` / `webp` / `pdf` |
| `width`, `height` | `1920`, `1080` (image size in pixels; for a PDF, the viewport it was rendered at) |
| `fileKey` | `0002-www-python-org.png` |
| `fileUrl` | `https://api.apify.com/v2/key-value-stores/…/records/0002-www-python-org.png?signature=…` (works in a browser, no token needed) |
| `bytes` | `151162` |
| `capturedAt` | `2026-11-17T09:35:12Z` |
| `error` | `null`, or e.g. `HTTP 404`, `Element "#pricing" not found or not visible within 30 s` |

The files themselves are in the run's **key-value store** (Storage → Key-value store), named `<index>-<host-path>.<ext>`.

### How to use

1. Paste your URLs, one per line.
2. Pick a **device** and a **format**.
3. Optional: turn on **Full page**, add an **element selector**, **hide selectors** or **dark mode**.
4. Run. Download the files from the key-value store, or use the `fileUrl` links from the dataset (CSV/JSON/Excel export, API, webhooks, Make/Zapier/n8n).

#### Example inputs

Full-page mobile screenshot on an iPhone, with cookie banners hidden:

```json
{
  "urls": ["https://www.python.org"],
  "device": "iphone",
  "fullPage": true,
  "hideCookieBanners": true,
  "format": "jpeg",
  "quality": 75
}
```

Capture a single element in dark mode as retina WebP:

```json
{
  "urls": ["https://www.wikipedia.org"],
  "selector": ".central-featured",
  "darkMode": true,
  "deviceScaleFactor": 2,
  "format": "webp"
}
```

Archive pages as Letter-size PDFs with backgrounds:

```json
{
  "urls": ["https://www.python.org/about/"],
  "format": "pdf",
  "pdfFormat": "Letter",
  "pdfPrintBackground": true
}
```

A JavaScript-heavy dashboard: wait for the network to go idle and for a chart, then hide the chat widget:

```json
{
  "urls": ["https://your-app.example/status"],
  "waitUntil": "networkidle",
  "waitForSelector": ".chart",
  "delayMs": 1500,
  "hideSelectors": ["#intercom-container"]
}
```

### Use cases

- **Visual monitoring.** Schedule daily captures of your landing pages, competitors' pricing pages or status pages and keep a visual history.
- **Archiving & compliance.** Save PDFs of terms, policies, ads or published pages with a timestamp.
- **SEO & social previews.** Generate thumbnails and preview images of pages, or check how a page looks on mobile.
- **QA & responsive testing.** Capture the same pages on desktop, tablet, iPhone and Android, in light and dark mode, after each deploy.
- **AI agents & LLM pipelines.** Hand page images to vision models, or let an agent call this actor (API / MCP) to "look at" a URL.
- **Reports & client work.** Batch-capture a list of client sites or portfolio pages for audits and proposals.

### Pricing

Pay per event: **$0.003 per successful capture** ($3 per 1,000) plus a tiny Apify actor-start fee. URLs that fail (HTTP errors, timeouts, missing elements, blocked pages) are **not charged**. You can cap the total cost with *Max charge per run*.

### Tips & limits

- **Memory:** 2 GB (default) is enough for 2 to 3 parallel pages. Very long full-page captures on mobile presets (3× pixel ratio) produce large images, so use JPEG/WebP for those.
- **Parallel pages:** 2 by default, up to 5. Keep it low to be polite to the sites you capture.
- **PDF** always prints the whole page. The element selector and full-page options apply to images only.
- **Network idle** is capped at 15 s, because some sites never stop polling. The page is captured anyway.

### Fair use

This is a tool for capturing pages **you are allowed to capture**. It uses a normal Chromium browser with its standard (or the emulated device's) user agent. It does **not** use stealth plugins, solve captchas, rotate proxies or log in. Pages that answer with a bot-protection challenge, 401/403/429 or another error are reported as error rows and skipped, not bypassed. Respect each site's terms and copyright when you use the captures.

***

Built and maintained by Alexandr Cheremikin (Koh Samui, Thailand) with an AI assistant. Issues and feature requests are welcome in the Issues tab.

# Actor input Schema

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

Web pages to capture, one per line. Only pages you are allowed to capture; login-walled pages and bot-protected pages are not bypassed.

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

Image format (png/jpeg/webp) or a PDF of the page.

## `device` (type: `string`):

Viewport preset. Tablet and mobile presets emulate the real device (viewport, pixel ratio, touch, mobile user agent).

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

Viewport width, used only when Device = Custom.

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

Viewport height, used only when Device = Custom.

## `deviceScaleFactor` (type: `integer`):

1 = normal, 2 = retina/HiDPI image (twice the pixels). Mobile and tablet presets use the device's own ratio.

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

Capture the whole scrollable page instead of just the visible viewport.

## `scrollToBottom` (type: `boolean`):

Before a full-page capture, scroll down step by step so lazy-loaded images and sections render.

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

Optional. Capture just the first element matching this CSS selector, e.g. "header", "#pricing", ".chart". Ignored for PDF.

## `quality` (type: `integer`):

Compression quality 1-100 for JPEG and WebP.

## `pdfFormat` (type: `string`):

Paper size for PDF output.

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

Include background colours and images in the PDF.

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

Landscape orientation for PDF output.

## `pdfMediaScreen` (type: `boolean`):

Render the PDF with screen CSS (looks like the website) instead of the site's print stylesheet.

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

When the page counts as loaded: load event, DOM ready (fastest) or network idle (best for heavy JS apps; capped at 15 s).

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

Additional wait before capturing, e.g. for animations or charts (max 60 000 ms).

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

Optional. Wait until this element is visible before capturing.

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

Optional. Elements to hide before capture, e.g. chat widgets, popups or ads: "#intercom-container", ".newsletter-popup".

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

Hide ~50 common cookie/consent banner containers (OneTrust, Cookiebot, Usercentrics, Didomi, Quantcast and more) with CSS. Nothing is clicked or accepted.

## `darkMode` (type: `boolean`):

Emulate prefers-color-scheme: dark, so sites that support dark mode render dark.

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

Navigation and wait timeout for each URL. Failed URLs are reported as error rows and not charged.

## `maxConcurrency` (type: `integer`):

How many pages to capture at once (1-5). Keep it low to be polite to the sites.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://www.python.org",
    "https://www.wikipedia.org"
  ],
  "format": "png",
  "device": "desktop",
  "width": 1280,
  "height": 800,
  "deviceScaleFactor": 1,
  "fullPage": false,
  "scrollToBottom": true,
  "quality": 80,
  "pdfFormat": "A4",
  "pdfPrintBackground": true,
  "pdfLandscape": false,
  "pdfMediaScreen": false,
  "waitUntil": "load",
  "delayMs": 0,
  "hideCookieBanners": false,
  "darkMode": false,
  "timeoutSecs": 30,
  "maxConcurrency": 2
}
```

# Actor output Schema

## `captures` (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://apify.com",
        "https://www.python.org",
        "https://www.wikipedia.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cheremikin/screenshot-capture").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://apify.com",
        "https://www.python.org",
        "https://www.wikipedia.org",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("cheremikin/screenshot-capture").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://apify.com",
    "https://www.python.org",
    "https://www.wikipedia.org"
  ]
}' |
apify call cheremikin/screenshot-capture --silent --output-dataset

```

## MCP server setup

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

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/Ili7lPg6Hee0H3lg4/builds/iDfAFKeDjxYtTDAnX/openapi.json
