# Website Screenshot API: Full Page Screenshot & URL to PDF (`polderbyte/website-screenshot-pdf`) Actor

Website screenshot API: full page screenshot with lazy-loaded content, cookie banner removal (EU consent popups), iPhone/Pixel/iPad presets, element crop, dark mode, PNG/JPEG/WebP and URL to PDF / HTML to PDF. Batch URLs, direct file links, pay only for successful captures.

- **URL**: https://apify.com/polderbyte/website-screenshot-pdf.md
- **Developed by:** [Polderbyte](https://apify.com/polderbyte) (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

Pay per event

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 API: Full Page Screenshot & URL to PDF

Turn any list of URLs into **clean screenshots and PDFs**. One run takes one URL or thousands. Every capture is
saved as a file with a **direct download link**, and you get **one result row per URL**, so the output plugs straight
into an API call, a webhook, Make, Zapier, n8n or a spreadsheet.

Built for the pages that break other screenshot tools:

- **EU cookie banners are removed.** The Actor clicks "Accept all" on the common consent platforms (and on
  "Alles accepteren", "Akkoord", "Tout accepter", "Alle akzeptieren" …), follows consent walls back to the page, and
  hides whatever banner is left.
- **Full-page captures are complete.** The page is scrolled first, so lazy-loaded images, "load more on scroll"
  sections and scroll animations appear, then captured top to bottom. App-style pages that scroll inside a box
  are expanded to their full length.
- **Failed URLs are free.** You pay only for captures that worked.

### Features

| | This Actor | Typical screenshot tools |
| --- | --- | --- |
| Cookie banners (OneTrust, Cookiebot, Didomi, Usercentrics, Quantcast, Sourcepoint, CookieYes, Complianz and ~20 more) | Accepted or hidden automatically, also inside iframes and shadow DOM | Banner covers the page, or you write custom CSS per site |
| Consent walls (privacy page before the site) | Accepted, then the real page is captured | Screenshot of the consent page |
| Full page with lazy-loaded images | Scrolls first, waits for images and fonts | Grey placeholders below the fold |
| Pages that scroll inside a container | Expanded to full length | Only the first screen |
| Endless (infinite-scroll) pages | Cut cleanly at a max height you choose, flagged in the output | Time out or huge files |
| Device presets | Desktop, Full HD, laptop, iPhone 15, Pixel 8, iPad Pro, or custom viewport + retina | Width and height only |
| Element crop | Any CSS selector, e.g. `#pricing` | Rare |
| Dark mode | The site's own dark theme, or forced dark on any site | Rare |
| Formats | PNG, JPEG, WebP, PDF (A4/Letter/…, margins, landscape, backgrounds, scale) | Often PNG only, PDF separate |
| Ads and trackers | Optional blocking of 100+ ad/analytics hosts | Not available |
| Custom CSS | Inject your own CSS, e.g. hide a chat widget | Sometimes |
| Sites with bot management | Retried automatically in a full desktop-grade browser | Fails |
| Output | One row per URL with a direct file link, size, title, HTTP status, final URL, SHA-256, error | A list of files |
| Pricing | Per successful capture; errors, HTTP 4xx/5xx and blocked pages are free | Per run or per attempt |

### How it works

For each URL: open the page in a fresh browser context (no cookies shared between URLs), wait until it has loaded,
handle the cookie banner, wait the optional delay, inject your CSS, scroll through the page for lazy content
(full page, element and PDF captures), wait for web fonts and images, then capture. Files go to the run's
key-value store; one row per URL goes to the dataset.

### Input example

```json
{
  "urls": ["https://www.example.com", "https://www.example.com/pricing", "example.org"],
  "format": "png",
  "device": "desktop",
  "fullPage": true,
  "hideCookieBanners": true,
  "darkMode": "off",
  "blockAds": false,
  "maxConcurrency": 4
}
```

More examples:

- **Mobile screenshot in dark mode:** `{"urls": ["https://github.com"], "device": "iphone-15", "darkMode": "site"}`
- **Crop to one element:** `{"urls": ["https://www.example.com"], "selector": "#pricing"}`
- **URL to PDF (HTML to PDF):** `{"urls": ["https://en.wikipedia.org/wiki/Belgium"], "format": "pdf", "pdfFormat": "A4", "pdfMargin": "10mm"}`
- **Social preview image (1200 x 630):** `{"urls": ["https://www.example.com"], "device": "custom", "viewportWidth": 1200, "viewportHeight": 630, "format": "jpeg"}`
- **Retina screenshot:** `{"urls": ["https://www.example.com"], "deviceScaleFactor": 2}`

### Output example

One row per URL (dataset), with the file in the key-value store:

```json
{
  "url": "https://www.standaard.be/",
  "index": 0,
  "status": "ok",
  "error": null,
  "finalUrl": "https://www.standaard.be/",
  "httpStatus": 200,
  "title": "De Standaard",
  "format": "png",
  "device": "desktop",
  "fullPage": true,
  "selector": null,
  "width": 1440,
  "height": 16334,
  "pages": null,
  "bytes": 14706823,
  "truncated": false,
  "cookieBanner": "Didomi: accepted ('akkoord')",
  "key": "standaard-be-d36e879d.png",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/standaard-be-d36e879d.png",
  "contentType": "image/png",
  "sha256": "4f1c…",
  "takenAt": "2026-11-22T18:02:55+00:00",
  "durationMs": 10217
}
```

A URL that failed has `status: "error"` and the reason in `error`, e.g. `DNS lookup failed: host not found`,
`HTTP 404`, `selector '#pricing' was not found on the page` or `blocked by bot protection or a CAPTCHA page`. For
HTTP errors and blocked pages the screenshot of what the browser saw is still stored, so you can check it.
Every row has the same fields, so exports to CSV or Excel stay tidy. `index` is the URL's position in your input.

The dataset has two views: **Screenshots** (with thumbnails) and **All details**.

### Use it from your code or a webhook

Run synchronously and get the rows back in one HTTP call:

```bash
curl -X POST "https://api.apify.com/v2/acts/polderbyte~website-screenshot-pdf/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://www.example.com"], "fullPage": true}'
```

Each row's `fileUrl` downloads the image or PDF. For big batches, start the run asynchronously and add a webhook on
*Run succeeded*: the webhook payload contains the dataset ID, and the dataset holds one row per URL with its file
link. Use `sha256` to detect visual changes between runs without downloading the files.

### Use cases

- **Website monitoring:** capture your own and your competitors' pages every day (Apify Schedules) and compare.
  Save to a named key-value store to keep a history.
- **Archiving and compliance:** full-page PNG or PDF copies of web pages, terms and conditions, prices or ads at a
  point in time, with a timestamp and a SHA-256 hash.
- **Social previews and thumbnails:** 1200 x 630 JPEG/WebP images of any URL for link previews, directories and
  portfolios.
- **QA and visual testing:** desktop, laptop, tablet and phone screenshots of every page of a release, light and
  dark, without cookie banners in the way.
- **Reports:** PDFs of dashboards, articles or landing pages for clients; element crops of a chart or a pricing
  table for slides.
- **AI agents and LLM pipelines:** give a vision model a clean, banner-free screenshot of a page.

### Pricing

Pay per successful capture, no subscription:

| Event | When it's charged |
| --- | --- |
| Screenshot | one viewport screenshot or element crop, any device and format |
| Full-page screenshot | one full-page screenshot, including the lazy-loading scroll pass |
| PDF | one PDF of a page, any number of pages |

Not charged:

- invalid URLs;
- pages that do not load (DNS errors, timeouts, connection errors, downloads);
- pages that answer with HTTP 4xx or 5xx;
- pages blocked by bot protection or a CAPTCHA;
- a missing or hidden element when you capture a selector.

See the **Pricing** tab for current prices. Use **Max URLs** and the run's spending limit to cap what a run can
cost. When the limit is reached the run stops cleanly, and captures that could not be charged are not delivered.

### Speed and memory

The default 2 GB of memory captures 2 pages at a time (1 at a time for PDFs). Give the run more memory to capture
more pages in parallel: Apify assigns 1 CPU core per 4 GB, and screenshots are CPU-bound, so 4 GB is about twice as
fast as 2 GB. *Pages in parallel* is lowered automatically when the memory is too small for it. Heavy pages (news sites,
big shops) take longer than simple ones; full-page captures and PDFs take longer than viewport screenshots.

### FAQ

**How are cookie banners handled?** First the Actor looks for the accept button of the consent platform the site
uses. If it does not know the platform, it looks for a short button such as "Accept all", "Alles accepteren",
"Akkoord", "Tout accepter" or "Alle akzeptieren" inside an element that is about cookies or consent, never a random
"OK" button elsewhere on the page. After that it hides any banner that is left and unlocks the page scroll. The
`cookieBanner` field tells you what happened, e.g. `OneTrust: accepted ('accept all')`. Turn it off with
*Remove cookie banners*.

**Does it solve CAPTCHAs or log in?** No. Pages behind a login or a CAPTCHA are reported as failed and not charged.
Use it for public pages.

**Why is there white space where an ad should be?** Ads load late or not at all for automated browsers, so their
slots can stay empty. Turn on *Block ads and trackers* for a faster capture; the slots usually stay empty either
way.

**The page is cut off at 20,000 pixels.** That is the *Max page height* safety limit for endless pages; the row has
`truncated: true`. Raise it up to 50,000 if you need more. WebP images can be at most 16,383 pixels high.

**Can I get the mobile version of a site?** Yes. Choose iPhone 15, Pixel 8 or iPad: the browser then reports a
mobile user agent, touch support and the phone's screen size and pixel density, so the site serves its mobile
layout.

**Which language does the site show?** Set *Browser language* (e.g. `nl-BE`, `fr-FR`). Many multilingual sites
pick their language from it.

**How long are the files kept?** Files in the run's own storage follow your Apify plan's data retention. To keep
them, set *Save files to a named key-value store*: named stores are kept until you delete them, and the keys get a
date-time prefix so repeated runs build a history.

**Are the file links public?** The `fileUrl` points to the run's key-value store. Whether it opens without your API
token depends on your Apify account's storage access setting; links for restricted stores are signed
automatically.

**A site shows "Access denied".** Some sites block all automated browsers. The Actor retries such pages once in a
full desktop-grade browser. If that is blocked too, the row has the error and you are not charged.

**Found a problem or need a feature?** Open an issue on the Issues tab. We usually answer within a day.

# Actor input Schema

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

One URL per line, e.g. https://www.example.com/pricing. A bare domain (example.com) gets https://. Each URL gives one image or PDF and one dataset row. Duplicates are removed; local and private addresses are not allowed.

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

PNG (lossless), JPEG or WebP (smaller files, see Quality), or PDF (the whole page as a printable document, see the PDF options).

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

Screen size, pixel density and user agent to emulate. Phones and tablets get the mobile layout at their real pixel density (an iPhone 15 screenshot is 1179 px wide). Choose Custom to set your own viewport below.

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

Capture the whole scrollable page instead of only the first screen. Lazy-loaded images and sections are loaded first (see 'Scroll to load lazy content'). Charged as a full-page screenshot.

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

Optional. Crop the screenshot to the first element matching this CSS selector, e.g. #pricing, .hero or article. If the element is missing or hidden, the URL fails and is not charged.

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

Accepts the cookie banner (OneTrust, Cookiebot, Didomi, Usercentrics, Quantcast, CookieYes, Complianz, Sourcepoint and about 20 more, plus 'Accept all / Alles accepteren / Akkoord / Tout accepter / Alle akzeptieren' buttons in 10+ languages), follows consent walls back to the page, and hides whatever banner is left.

## `darkMode` (type: `string`):

Site dark theme = the browser asks for dark mode (prefers-color-scheme: dark), so sites with a dark theme show it. Force dark = additionally darkens sites that have no dark theme (Chromium's automatic dark mode).

## `blockAds` (type: `boolean`):

Blocks requests to more than 100 common ad, analytics and tracking hosts (Google Ads, Meta pixel, Criteo, Taboola, Hotjar, ...). Pages load faster and lighter; ad slots stay empty.

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

Width in CSS pixels, used only when Device is Custom.

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

Height in CSS pixels, used only when Device is Custom. For a full-page capture this is the first screen; the image grows with the page.

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

Optional. 2 gives a sharp 'retina' image twice as wide and high. Leave empty for the device's own density (1 for desktop and laptop).

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

When the page counts as loaded. Load (default) suits most sites. Network idle also waits until no requests are running for 0.5 s (max 15 s), handy for dashboards and single-page apps. If a page never finishes loading, it is captured anyway when the timeout gets close.

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

Wait this many extra seconds before capturing, e.g. for animations, charts or a slow widget.

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

Before a full-page, element or PDF capture, scroll through the whole page (or its main scroll area) so lazy-loaded images, infinite-scroll sections and scroll animations appear. Then scroll back to the top.

## `maxHeight` (type: `integer`):

Full-page captures are cut off at this height in CSS pixels (the row then has truncated = true). Stops endless infinite-scroll pages. WebP files are limited to 16,383 image pixels per side.

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

Optional CSS injected before the capture, e.g. to hide a chat widget: #intercom-container { display: none !important; }

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

Language and region the browser reports (Accept-Language and navigator.language), e.g. en-US, nl-BE, fr-FR or de-DE. Multilingual sites pick their language from this.

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

1-100. Lower = smaller files. Ignored for PNG and PDF.

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

Paper size of the PDF.

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

Print in landscape orientation.

## `pdfMargin` (type: `string`):

Margin on all four sides, with a unit: mm, cm, in or px, e.g. 10mm, 1cm, 0.5in or 0 for none.

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

Include background colours and images, so the PDF looks like the website.

## `pdfMedia` (type: `string`):

Screen = the PDF looks like the website. Print = use the site's print stylesheet, if it has one (often without menus and ads).

## `pdfScalePercent` (type: `integer`):

Zoom of the page on paper. 100 lays the page out at paper width; lower values (e.g. 60) fit a wider, desktop-like layout on the page.

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

How many URLs are captured at the same time in the shared browser. Lowered automatically to about one page per GB of run memory (Apify gives 1 CPU core per 4 GB, and capturing is CPU-bound); PDFs need about 1 GB each.

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

A URL that takes longer fails with status 'error' and is not charged. Heavy full pages on small memory (2 GB = half a CPU core) can need 60 s or more.

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

Retries for a page that fails to load (timeouts, connection errors). DNS errors, downloads and HTTP errors are not retried.

## `maxItems` (type: `integer`):

Capture at most this many URLs per run. Keeps the cost of a run predictable.

## `keyValueStoreName` (type: `string`):

Optional. Files then go to this named store (kept until you delete it) instead of the run's own store (deleted after your plan's data retention). Keys get a date-time prefix, so repeated runs build a history, which is useful for monitoring and archiving. Letters, digits and '-' only.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://www.wikipedia.org"
  ],
  "format": "png",
  "device": "desktop",
  "fullPage": false,
  "hideCookieBanners": true,
  "darkMode": "off",
  "blockAds": false,
  "viewportWidth": 1440,
  "viewportHeight": 900,
  "waitUntil": "load",
  "delaySecs": 0,
  "scrollToBottom": true,
  "maxHeight": 20000,
  "locale": "en-US",
  "quality": 80,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfMargin": "10mm",
  "pdfPrintBackground": true,
  "pdfMedia": "screen",
  "pdfScalePercent": 100,
  "maxConcurrency": 4,
  "timeoutSecs": 90,
  "maxRetries": 1,
  "maxItems": 1000
}
```

# Actor output Schema

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

// Run the Actor and wait for it to finish
const run = await client.actor("polderbyte/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("polderbyte/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 polderbyte/website-screenshot-pdf --silent --output-dataset

```

## MCP server setup

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