# Website Screenshot & URL to PDF Generator (`chesapeake/website-screenshot-pdf`) Actor

Capture full-page or viewport screenshots (PNG/JPEG) and render any URL to PDF in bulk. Desktop, laptop, tablet & mobile presets, element screenshots, dark mode, cookie-banner hiding, lazy-load scrolling. Pay only per file captured.

- **URL**: https://apify.com/chesapeake/website-screenshot-pdf.md
- **Developed by:** [Chesapeake Commerce](https://apify.com/chesapeake) (community)
- **Categories:** Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$7.00 / 1,000 file 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 & URL to PDF Generator (Full Page, Mobile, Bulk)

Turn any list of URLs into **pixel-perfect screenshots (PNG or JPEG) and print-ready PDFs**. Capture the full page or just the first screen, on desktop, laptop, tablet and mobile at once. You can also screenshot a single element, hide cookie banners and chat widgets, switch to dark mode, and scroll so lazy-loaded images appear. Every file gets a direct download link and a preview in the Output tab.

**You pay only for files that are actually captured.** Errors, 404s and blocked pages are free.

### Features

- **Bulk.** Up to 2,000 URLs per run, rendered in parallel in headless Chromium.
- **Full-page or viewport** screenshots, with a height cap for endless pages (flagged as `truncated`).
- **Device presets.** Desktop 1920×1080, Laptop 1366×768, Tablet (iPad Mini), Mobile (iPhone 13, retina) or any custom size.
- **URL to PDF.** A4, Letter, Legal, A3 or Tabloid, portrait or landscape, with or without backgrounds.
- **Element screenshots.** Capture only `#pricing`, a chart, a tweet embed or a product card using a CSS selector.
- **Clean captures.** Hides common cookie and consent pop-ups (OneTrust, Cookiebot, Didomi, Usercentrics, Quantcast…) plus any selectors you add.
- **Lazy-load aware.** Scrolls the page first so images below the fold actually render.
- **Dark mode** emulation.
- **API, integrations and MCP ready.** Call it from Make, Zapier, n8n, Python, JavaScript or an AI agent.

### Use cases

- Visual **website monitoring** and archiving (schedule daily captures and compare)
- **Proof of publication** for ads, press mentions and compliance records
- **SEO and agency reports** with desktop and mobile previews
- **Thumbnails and link previews** for directories and newsletters
- **Save web pages as PDF** for research, legal, invoices and documentation
- Feed page images to **vision-language AI models**

### How to use it

1. Paste URLs into **URLs**.
2. Choose **Output format** (PNG, JPEG, PDF, or PNG + PDF) and one or more **Devices**.
3. Click **Start**. Previews appear in the Output tab; click **fileUrl** to download.

#### Input example

```json
{
  "urls": ["https://apify.com", "https://en.wikipedia.org/wiki/Chesapeake_Bay"],
  "format": "png+pdf",
  "devices": ["desktop", "mobile"],
  "fullPage": true,
  "hideCookieBanners": true
}
```

#### Output example (one item)

```json
{
  "url": "https://apify.com/",
  "finalUrl": "https://apify.com/",
  "device": "desktop",
  "format": "png",
  "status": "OK",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/apify-com-desktop-mvmpaxsj.png",
  "fileKey": "apify-com-desktop-mvmpaxsj.png",
  "contentType": "image/png",
  "bytes": 1023154,
  "width": 1920,
  "height": 10052,
  "title": "Apify: Marketplace of ready-to-run tools for AI",
  "httpStatus": 200,
  "truncated": false,
  "durationMs": 3861,
  "capturedAt": "2026-10-24T17:56:59.161Z"
}
```

The image or PDF itself is stored in the run's key-value store. `fileUrl` is a direct link you can download or embed.

#### API example (Node.js)

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('chesapeake/website-screenshot-pdf').call({
  urls: ['https://example.com'], format: 'pdf', pdfFormat: 'Letter',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].fileUrl);
```

### Pricing (pay per event)

| Event | Price |
|---|---|
| Page captured (one PNG, JPEG or PDF file) | **$0.007** ($7 per 1,000 files) |
| Actor start | $0.00005 (Apify default) |

Example: 500 URLs × desktop + mobile PNG = 1,000 files = **$7.00**. **No charge** for failed loads, HTTP 4xx/5xx pages or URLs disallowed by robots.txt. Compute is included. Set **Max cost per run** to cap spending.

### FAQ

**How long is a full-page screenshot?** Up to the full scroll height, capped by **Max full-page height** (default 16,000 px). Longer pages are cut and marked `truncated: true`.

**Can it capture pages behind a login?** No. It renders public pages only, with no cookies or credentials.

**Does it bypass bot protection or captchas?** No. If a site blocks automated browsers you get `HTTP_ERROR` and aren't charged. We also check robots.txt and skip pages that disallow automated access.

**Why does the mobile screenshot look large?** The mobile preset uses a retina pixel ratio (3×) like a real iPhone. Use the custom device for 1× images.

**Can I get JPEG instead of PNG to save space?** Yes. Choose JPEG and set **JPEG quality** (default 80).

**How long are files kept?** Files stay in the run's storage according to your Apify plan's data retention (usually 7+ days on paid plans). Download them or push them to S3, Google Drive or Dropbox with an integration if you need them longer.

**Issues or a feature request?** Use the Issues tab. We reply within 2 business days.

# Actor input Schema

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

Pages to capture (max 2,000 per run). Bare domains get https://.

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

File type to produce. Each file is one billable capture.

## `devices` (type: `array`):

One screenshot is produced per URL per device.

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

Capture the whole scrollable page instead of just the first screen.

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

Screenshot only this element, e.g. #pricing or main article. Leave empty for the page.

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

Hide common consent pop-ups (OneTrust, Cookiebot, Didomi, Usercentrics…) with CSS before capturing.

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

CSS selectors to hide (chat widgets, ads, sticky headers).

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

Emulate prefers-color-scheme: dark.

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

Used only with the custom device.

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

Used only with the custom device.

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

When the page counts as loaded.

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

Wait this long after load (for animations or late content).

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

Scroll through the page before a full-page capture so lazy-loaded images appear.

## `maxFullPageHeight` (type: `integer`):

Very long pages are cut at this height (flagged as truncated).

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

Only for JPEG output.

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

Only for PDF output.

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

Landscape orientation.

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

Include background colors and images.

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

Max time to load one page.

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

Pages rendered in parallel. Higher needs more memory.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://en.wikipedia.org/wiki/Chesapeake_Bay"
  ],
  "format": "png",
  "devices": [
    "desktop"
  ],
  "fullPage": true,
  "selector": "",
  "hideCookieBanners": true,
  "hideSelectors": [],
  "darkMode": false,
  "waitUntil": "load",
  "delayMs": 500,
  "scrollToBottom": true,
  "maxFullPageHeight": 16000,
  "jpegQuality": 80,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfPrintBackground": true,
  "timeoutSecs": 45,
  "maxConcurrency": 3
}
```

# Actor output Schema

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

One item per captured file (URL, device, format, size, fileUrl download link) in the default dataset.

## `files` (type: `string`):

PNG, JPEG and PDF files stored in the run's default key-value store (also contains the run INPUT record).

# 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://en.wikipedia.org/wiki/Chesapeake_Bay"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("chesapeake/website-screenshot-pdf").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://en.wikipedia.org/wiki/Chesapeake_Bay",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("chesapeake/website-screenshot-pdf").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://en.wikipedia.org/wiki/Chesapeake_Bay"
  ]
}' |
apify call chesapeake/website-screenshot-pdf --silent --output-dataset

```

## MCP server setup

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

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/ggEaEmZ0r6Pew2eY2/builds/MvMIStqmZpEcMKYWH/openapi.json
