# Website Screenshot and PDF (`parkville/website-screenshot-pdf`) Actor

Capture full-page or viewport screenshots (PNG, JPEG) or PDFs of any list of URLs, with device presets, dark mode and cookie banner hiding.

- **URL**: https://apify.com/parkville/website-screenshot-pdf.md
- **Developed by:** [ParkVille LLC](https://apify.com/parkville) (community)
- **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 captures

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 and PDF

Capture screenshots (PNG or JPEG) or PDFs of any list of web pages. Give it URLs, get back one image or PDF per URL plus a dataset row with the file link, HTTP status, page title, size and timing.

It runs a real Chromium browser, waits for the page to load, scrolls through it so lazy images appear, hides cookie consent banners and then captures. Each wait has a time limit, so a page that never stops loading is still captured instead of stalling the run.

### What you can do with it

- Archive how pages looked on a given day (compliance, legal records, change tracking).
- Make thumbnails and previews for link directories, CMS entries or reports.
- Check how a site renders on phones and tablets.
- Turn articles, invoices or documentation pages into PDF files.
- Feed page images to visual testing or AI tools.

### Features

- **PNG, JPEG or PDF** output. JPEG quality, PDF paper size (A4, Letter, Legal, A3), orientation, margins and background graphics are configurable.
- **Full page or viewport.** Full-page images are cut at 16384 pixels tall; the result says so when this happens.
- **Single element capture** with a CSS selector (PNG and JPEG).
- **Device presets:** iPhone 15, iPhone 15 Pro Max, iPhone SE, Pixel 7, Galaxy S24, iPad Pro 11 (portrait and landscape), or a custom desktop viewport with a scale factor up to 3.
- **Cookie banner hiding** with CSS for OneTrust, Cookiebot, Didomi, Quantcast, Usercentrics, TrustArc, Osano, CookieYes, Complianz, iubenda, Sourcepoint and other common platforms. Nothing is clicked, so no consent is given on your behalf.
- **Lazy-load scrolling** before full-page captures, limited to 8 seconds.
- **Dark mode** (prefers-color-scheme: dark) for sites that support it.
- **Hide elements** with CSS selectors, or inject your own CSS.
- **Wait options:** load event, DOM ready or network idle, an extra delay, and an optional selector to wait for.
- **Error pages are captured too.** A 404 or 500 page is saved with its status code. URLs that cannot be loaded at all get a row with the error message, and one bad URL never stops the run.
- **Every input entry is captured in order**, duplicates included, so row N always matches line N of your list.
- **Proxy support** through Apify Proxy or your own proxies.

### Input example

Only `urls` is required.

```json
{
    "urls": ["https://apify.com", "wikipedia.org", "https://news.ycombinator.com"],
    "format": "png",
    "fullPage": true,
    "device": "Desktop",
    "viewportWidth": 1280,
    "viewportHeight": 800,
    "waitUntil": "load",
    "delaySecs": 1,
    "hideCookieBanners": true,
    "hideSelectors": ["#chat-widget"],
    "darkMode": false
}
```

A PDF of an article in Letter size:

```json
{
    "urls": ["https://en.wikipedia.org/wiki/Web_page"],
    "format": "pdf",
    "pdfFormat": "Letter",
    "pdfMarginMm": 15
}
```

All options with their defaults are listed on the Input tab.

### Output

Each file is stored in the run's default key-value store under a key such as `capture-00001-apify-com.png`, where the number is the position of the URL in your list. The dataset gets one row per input URL:

```json
{
    "index": 1,
    "url": "https://apify.com/",
    "loadedUrl": "https://apify.com/",
    "httpStatus": 200,
    "title": "Apify: Full-stack web scraping and data extraction platform",
    "format": "png",
    "key": "capture-00001-apify-com.png",
    "fileUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/capture-00001-apify-com.png",
    "bytes": 812345,
    "width": 1280,
    "height": 6230,
    "capturedAt": "2026-11-09T12:00:00.000Z",
    "durationMs": 3420,
    "warnings": [],
    "error": null
}
```

- `width` and `height` are the image size in pixels (they include the scale factor) and are `null` for PDF.
- `warnings` lists things that did not stop the capture, for example a page cut at 16384 pixels or a wait that hit its time limit.
- When a URL fails after all retries, `error` holds the reason and `fileUrl` is `null`.
- `durationMs` covers the whole capture of that URL, retries included.

A `SUMMARY` record in the key-value store counts captured, failed and skipped URLs.

### Use it over the API

Replace `<YOUR_API_TOKEN>` with your Apify API token and `<ACTOR_ID>` with this Actor's ID (shown in the API tab, in the form `username~actor-name`).

#### Run and get the results in one call (curl)

The synchronous endpoint starts a run, waits for it to finish and returns the dataset rows. It suits small batches that finish within the endpoint's time limit (5 minutes); use an asynchronous run for larger lists.

```bash
curl -X POST "https://api.apify.com/v2/acts/<ACTOR_ID>/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://apify.com", "https://example.com"], "format": "png", "fullPage": false}'
```

Each returned row has a `fileUrl` you can download directly.

#### Node.js (apify-client)

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });

const run = await client.actor('<ACTOR_ID>').call({
    urls: ['https://apify.com', 'https://example.com'],
    format: 'jpeg',
    device: 'iPhone 15',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const item of items) {
    console.log(item.url, item.error ?? item.fileUrl);
}
```

#### Python (apify-client)

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")

run = client.actor("<ACTOR_ID>").call(run_input={
    "urls": ["https://apify.com", "https://example.com"],
    "format": "pdf",
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["url"], item["error"] or item["fileUrl"])
```

### Pricing

The Actor is currently free to use: you only pay for the Apify platform usage of your runs (compute and storage), which is typically a fraction of a cent per capture.

If pay-per-capture pricing is introduced later, only successful captures will be charged, and the maximum cost per run setting will be respected.

### Limits

- Full-page images are cut at 16384 pixels tall (divided by the scale factor for retina and phone presets, so a 3x iPhone capture covers about 5460 CSS pixels of page). PDFs are not cut.
- Waits are capped: up to 30 s for the load event, 15 s more for network idle, 30 s for `waitForSelector`, 15 s for the element in `selector`, 8 s of lazy-load scrolling. The navigation itself (DOM ready) uses `navigationTimeoutSecs`.
- Pages behind a login, CAPTCHA or strong bot protection may be captured as the login or challenge page. A proxy can help with region blocks; logins are not supported.
- Cookie banners from platforms not on the built-in list may still appear. Use `hideSelectors` for those.
- Content inside cross-origin iframes is captured as rendered, but CSS options do not reach into it.
- Video and canvas animations are captured at a single frame.
- The language and regional version of a site can depend on where the request comes from. Use a proxy in the country you need.

### FAQ

**Why is my screenshot cut off at the bottom?**
The page is taller than 16384 pixels. The row's `warnings` field says how tall the page was. Use PDF for very long pages, or capture an element with `selector`.

**Some images on the page are blank.**
Keep `scrollToBottom` on and raise `delaySecs` to 3 to 5 seconds. For sites that keep loading content, try `waitUntil: networkidle`.

**A cookie banner is still visible.**
Find its container in your browser's developer tools and add its selector to `hideSelectors`.

**Does it accept or reject cookies for me?**
No. Banners are hidden with CSS only. Nothing on the page is clicked.

**Can I get a 404 page captured?**
Yes. Error pages are captured like any other page and the status code is in `httpStatus`.

**Are duplicate URLs removed?**
No. Every entry is captured, in order, so the output lines up with your input list.

**How do I download all files at once?**
Open the run's key-value store in Apify Console, or read each `fileUrl` from the dataset with the API.

**Can it capture pages that need a login?**
No. It opens each URL in a fresh browser context without cookies.

# Actor input Schema

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

Pages to capture, one per line. Bare domains such as example.com get https:// added. Every entry is captured in order, duplicates included.

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

PNG is lossless, JPEG is smaller, PDF prints the page as a document.

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

Capture the whole scrollable page instead of only the visible viewport. Images are cut at 16384 pixels tall. Ignored for PDF, which always contains the whole page.

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

Emulate a phone or tablet. A preset replaces the viewport size, scale factor and user agent below. Desktop uses the viewport settings below.

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

Browser window width in CSS pixels (Desktop only).

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

Browser window height in CSS pixels (Desktop only). This is the image height when Full page is off.

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

Pixel density (Desktop only), from 1 to 3. 2 gives a retina image twice as wide and tall. Larger values use more memory and produce bigger files.

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

Page state to wait for before capturing. Each wait is capped (30 s for load, 15 s more for network idle), so pages that never go quiet are still captured.

## `delaySecs` (type: `integer`):

Seconds to wait after the page has loaded and been scrolled, before capturing. Useful for animations and late content.

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

Optional CSS selector to wait for (up to 30 s) before capturing. If it never appears the page is captured anyway and a warning is added to the result.

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

Scroll through the page before a full-page capture so lazy-loaded images appear, then scroll back to the top. Capped at 8 seconds and 16384 pixels.

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

Optional CSS selector. The first visible matching element is captured instead of the page. PNG and JPEG only; ignored for PDF.

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

Hide consent banners of common platforms (OneTrust, Cookiebot, Didomi, Quantcast, Usercentrics, TrustArc, Osano, CookieYes, Complianz, iubenda, Sourcepoint and others) with CSS and remove their scroll locks. Nothing is clicked or accepted.

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

CSS selectors of elements to hide before capture, for example chat widgets or sticky headers.

## `customCss` (type: `string`):

Optional CSS injected into every page before capture.

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

Emulate prefers-color-scheme: dark. Only affects sites that support a dark theme.

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

Quality from 1 to 100 when the format is JPEG.

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

Paper size when the format is PDF.

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

Print the PDF in landscape orientation.

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

Include background colours and images in the PDF.

## `pdfMarginMm` (type: `integer`):

Margin on all four sides of each PDF page.

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

Optional proxy. Leave it off for most sites; use Apify Proxy for sites that block data centre traffic or show region-specific content.

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

Maximum number of pages captured at the same time. The Actor also scales down automatically when memory runs low.

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

How long to wait for the page to start rendering (DOM ready) before the attempt fails.

## `maxRetries` (type: `integer`):

How many times a failed URL is retried. Errors that cannot be fixed by retrying, such as an unknown domain, are not retried.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://www.wikipedia.org"
  ],
  "format": "png",
  "fullPage": true,
  "device": "Desktop",
  "viewportWidth": 1280,
  "viewportHeight": 800,
  "deviceScaleFactor": 1,
  "waitUntil": "load",
  "delaySecs": 1,
  "scrollToBottom": true,
  "hideCookieBanners": true,
  "hideSelectors": [],
  "darkMode": false,
  "jpegQuality": 80,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfPrintBackground": true,
  "pdfMarginMm": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "maxConcurrency": 5,
  "navigationTimeoutSecs": 60,
  "maxRetries": 2
}
```

# Actor output Schema

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

One item per input URL with status, size and the public link to the captured file.

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

Keys of the PNG, JPEG or PDF files saved by the run.

# 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.wikipedia.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("parkville/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://www.wikipedia.org",
    ] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parkville/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/0ZOHNC4X3WgqSrLvz/builds/7XZ0z2HjkFwkLsBeE/openapi.json
