# Website Screenshot & PDF: Full-Page, Mobile, No Cookie Banners (`datapipelabs/website-screenshot-pdf`) Actor

Capture full-page or viewport screenshots (PNG, JPEG, WebP) and PDFs of any list of URLs. Includes device presets (iPhone, Pixel, iPad, desktop), wait-for-selector, element capture, automatic cookie-banner hiding and ad blocking. Pay per screenshot; platform usage is included.

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

## Pricing

from $2.50 / 1,000 screenshot (viewport or element)s

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 API: full-page, mobile, no cookie banners

**Turn any list of URLs into clean full-page screenshots (PNG, JPEG, WebP) or PDFs, without cookie banners, newsletter pop-ups or ads covering the page.** Choose a device (desktop, MacBook Retina, iPad, iPhone, Pixel), wait for a selector, capture one element, and get a direct link to every file.

Use it for website monitoring and visual archives, SEO and competitor tracking, social and link previews, client reports, QA and visual regression, compliance evidence, and as a "see the page" tool for AI agents.

- ✅ **Full page or viewport**, lazy-loaded images scrolled into view
- ✅ **PNG, JPEG, WebP or PDF** (A4/Letter/Legal/A3, portrait or landscape)
- ✅ **8 device presets** + custom size and retina pixel ratio
- ✅ **Cookie banners hidden**: 30 consent tools (OneTrust, Cookiebot, Usercentrics, Didomi, Quantcast, Sourcepoint, ...) plus a keyword heuristic. It **never clicks "Accept"**, so no consent is given on your behalf
- ✅ **Pop-ups hidden**: newsletter and discount modals (Attentive, Klaviyo, Privy, OptinMonster ...) and scroll-locked pages unlocked
- ✅ **Ad and tracker blocking** for cleaner, faster captures
- ✅ **Wait for selector, extra delay, element-only capture, dark mode, hide your own selectors**
- ✅ **Batch**: hundreds of URLs per run, in parallel, with retries
- 💲 **$2.50 per 1,000 viewport shots, $4 per 1,000 full-page shots or PDFs**; failed pages are free. Platform usage (compute and storage) is included in the price

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `urls` | array | – | URLs to capture; `https://` is added if missing |
| `format` | string | `png` | `png`, `jpeg`, `webp` or `pdf` |
| `fullPage` | boolean | `true` | Whole scrollable page instead of the viewport |
| `device` | string | `desktop-1440` | `desktop-1920`, `desktop-1440`, `laptop-1366`, `macbook-retina`, `ipad-pro-11`, `iphone-15-pro`, `pixel-8`, `galaxy-s9`, `custom` |
| `width`, `height` | integer | – | Viewport for `custom` |
| `deviceScaleFactor` | integer | – | Pixel-ratio override (2 = retina) |
| `quality` | integer | `80` | JPEG/WebP quality |
| `hideCookieBanners` | boolean | `true` | Hide consent banners (never accepts) |
| `hidePopups` | boolean | `true` | Hide newsletter/promo modals, unlock scroll |
| `blockAds` | boolean | `true` | Block common ad and tracking networks |
| `blockVideo` | boolean | `true` | Skip video/audio downloads (posters still show) |
| `hideSelectors` | array | – | Extra CSS selectors to hide (chat widgets etc.) |
| `waitUntil` | string | `networkidle2` | `load`, `domcontentloaded`, `networkidle2`, `networkidle0` |
| `waitForSelector` | string | – | Wait until this element exists |
| `delayMs` | integer | `500` | Extra wait after load |
| `scrollToBottom` | boolean | `true` | Scroll to trigger lazy images |
| `selector` | string | – | Capture only this element |
| `darkMode` | boolean | `false` | Emulate `prefers-color-scheme: dark` |
| `maxHeight` | integer | `20000` | Cut very long pages at this height (px) |
| `pdfFormat`, `pdfLandscape`, `pdfPrintBackground` | – | `A4`, `false`, `true` | PDF options |
| `timeoutSecs` | integer | `60` | Navigation timeout per page |
| `retries` | integer | `1` | Retries per URL (never charged) |
| `failOnHttpError` | boolean | `false` | Treat 4xx/5xx pages as failures (not charged) instead of capturing them |
| `maxConcurrency` | integer | auto | Pages in parallel; default is 1 per GB of run memory (cheapest) |
| `proxyConfiguration` | object | none | Optional Apify Proxy for sites that block data-centre IPs |

#### Example input

```json
{
  "urls": ["https://www.bbc.com/news", "stripe.com", "https://www.lemonde.fr"],
  "format": "png",
  "fullPage": true,
  "device": "desktop-1440",
  "hideCookieBanners": true,
  "hidePopups": true,
  "hideSelectors": ["#intercom-container"]
}
```

Mobile, viewport-only JPEG:

```json
{ "urls": ["https://github.com"], "device": "iphone-15-pro", "fullPage": false, "format": "jpeg", "quality": 75 }
```

PDF:

```json
{ "urls": ["https://en.wikipedia.org/wiki/Web_scraping"], "format": "pdf", "pdfFormat": "A4" }
```

### Output

Files go to the run's key-value store (collection **Screenshots & PDFs**, keys start with `capture-`); the dataset has one record per URL with a direct `fileUrl`. The run's Output tab shows three outputs: Captures (dataset), Screenshot & PDF files, and Run summary.

```json
{
  "url": "https://www.lemonde.fr/",
  "finalUrl": "https://www.lemonde.fr/en/",
  "statusCode": 200,
  "title": "Le Monde in English – World news, culture and opinion",
  "format": "png",
  "device": "desktop-1440",
  "fullPage": true,
  "width": 1440,
  "height": 7344,
  "bytes": 2478507,
  "loadMs": 4959,
  "cookieElementsHidden": 1,
  "popupsHidden": 0,
  "key": "capture-0006-lemonde.fr-047b2d2d.png",
  "chargedEvent": "full-page-screenshot",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/capture-0006-lemonde.fr-047b2d2d.png",
  "attempts": 1,
  "capturedAt": "2026-11-22T11:52:18.126Z",
  "error": null
}
```

`chargedEvent` is `screenshot` or `full-page-screenshot` (null for failures). Extra flags appear when relevant: `truncated` (page cut at `maxHeight` or the format's size limit), `scrollUnlocked`, `navigationWarning` (network never went idle; captured after load). Failed URLs get a record with `error` and are **not charged**. A `SUMMARY` record in the key-value store lists all URLs with status and timing.

### Pricing

**Pay per result. Exactly one charge per successful capture:**

| What you capture | Event | Price | Per 1,000 |
|---|---|---|---|
| Viewport screenshot (`fullPage: false`) | `screenshot` | $0.0025 | $2.50 |
| Element screenshot (`selector` set, any height) | `screenshot` | $0.0025 | $2.50 |
| Full-page screenshot (`fullPage: true`, PNG/JPEG/WebP) | `full-page-screenshot` | $0.004 | $4.00 |
| PDF (any page length; a PDF always renders the whole document) | `full-page-screenshot` | $0.004 | $4.00 |

Full-page captures cost more because the browser has to load, scroll and render the whole page, often 10–20 screens tall. The listed price includes Apify platform usage (compute and storage); you are not billed for usage on top of these events. If a run is migrated mid-way, already-captured URLs are not charged again. Each dataset record shows its `chargedEvent`, and the `SUMMARY` record totals the events and dollars for the run.

- Failed pages, invalid URLs and (with `failOnHttpError`) error pages are free.
- Retries are free.
- Set a maximum charge per run in the run options. The Actor checks the price of the next capture's event against what is left and stops cleanly before going over.
- Runs default to 2 GB memory with 2 pages in parallel, the cheapest setting measured on the platform.

### How it compares

| | **This Actor** | Apify's own Screenshot URL | Budget screenshot Actors | Premium screenshot Actors |
|---|---|---|---|---|
| Price | **$2.50 / 1k viewport, $4 / 1k full page or PDF (usage included)** | Free + compute | ~$0.90 / 1k + compute | $7–10 / 1k |
| Full page + lazy images | ✅ | ✅ | Varies | ✅ |
| PDF output | ✅ | ❌ | ❌ | Some |
| Cookie banners hidden (without accepting) | ✅ 30 CMPs + heuristic | ❌ | ❌ | Some |
| Newsletter pop-ups / scroll-lock fix | ✅ | ❌ | ❌ | Rare |
| Device presets | 8 + custom | Width only | Few | Some |
| Element capture, dark mode | ✅ | ❌ | ❌ | Some |
| Failed pages free | ✅ | n/a | Varies | Varies |
| Maintenance | Active | Last update ~10 months ago, 12 open issues | Varies | Varies |

### Tested on

12 real sites in one batch run (Wikipedia, GitHub, BBC News, Apify, Le Monde, The Guardian, Der Spiegel, Stripe, Hacker News, Python.org, Allbirds, CNN): **12/12 captured**, ~29 s wall time with 4 pages in parallel (avg ~7.7 s per page). The Guardian's Black Friday modal, Allbirds' Attentive pop-up and scroll lock, and CNN's and Spiegel's viewport-locked layouts were all handled.

### FAQ

**Does it accept cookies for me?** No. Banners are hidden with CSS, so no consent is recorded. Some sites show less content without consent (e.g. no embedded videos).

**Why is my page cut off?** Pages longer than `maxHeight` (default 20,000 px) are cut, and WebP has an encoder limit of 16,383 px. Use PNG/JPEG or raise `maxHeight` (up to 40,000).

**A site blocks the screenshot / shows a captcha.** Enable `proxyConfiguration` with Apify Proxy (residential for the hardest sites). Sites with logins are not supported.

**Is it legal?** It captures what any visitor sees on a public page. Respect copyright and each site's terms when you reuse captures.

### Changelog

- 1.0: Full page/viewport, PNG/JPEG/WebP/PDF, device presets, cookie banner and pop-up hiding, ad blocking, element capture, pay-per-result.

# Actor input Schema

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

Pages to capture, one per line. A missing https:// is added automatically.

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

Image format or PDF. Files are saved to the run's key-value store.

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

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

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

Viewport, pixel ratio and user agent preset.

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

Used only when Device is 'Custom size'.

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

Used only when Device is 'Custom size'.

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

Optional. 2 gives retina-sharp images.

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

Compression quality for JPEG and WebP.

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

Hides 60+ common consent tools (OneTrust, Cookiebot, Usercentrics, Didomi, Quantcast, ...) and cookie overlays. It never clicks 'Accept'.

## `hidePopups` (type: `boolean`):

Hides modal overlays such as newsletter sign-ups, discount offers and app-download prompts, and unlocks pages that block scrolling.

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

Blocks common ad and tracking networks for cleaner, faster captures.

## `blockVideo` (type: `boolean`):

Video posters still show; skipping the media files makes captures faster and cheaper.

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

E.g. chat widgets: #intercom-container, .drift-frame-controller

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

When the page counts as loaded. networkidle2 suits most sites.

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

Optional CSS selector that must appear before capturing.

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

Wait after load, e.g. for animations.

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

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

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

Optional CSS selector, e.g. #pricing. Images only.

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

Emulates prefers-color-scheme: dark.

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

Very long pages are cut at this height.

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

PDF only.

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

PDF only.

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

PDF only.

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

Navigation timeout per page.

## `retries` (type: `integer`):

Failed captures are retried and never charged.

## `failOnHttpError` (type: `boolean`):

When on, pages that return an HTTP error (e.g. 404, 503) are reported as failed and not charged instead of being captured.

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

Pages captured in parallel. Leave empty for automatic: 1 page per GB of run memory (about 1/4 vCPU each), which is the cheapest setting.

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

Optional. Use Apify Proxy for sites that block data-centre IPs.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://en.wikipedia.org/wiki/Web_scraping"
  ],
  "format": "png",
  "fullPage": true,
  "device": "desktop-1440",
  "quality": 80,
  "hideCookieBanners": true,
  "hidePopups": true,
  "blockAds": true,
  "blockVideo": true,
  "waitUntil": "networkidle2",
  "delayMs": 500,
  "scrollToBottom": true,
  "darkMode": false,
  "maxHeight": 20000,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfPrintBackground": true,
  "timeoutSecs": 60,
  "retries": 1,
  "failOnHttpError": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One record per URL: status, page title, size, billing event, and fileUrl linking to the screenshot or PDF. Failures have an error message and are not charged.

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

List of the captured files in the default key-value store.

## `summary` (type: `string`):

JSON totals: captured, failed, billing events per type, estimated charge, per-URL status.

# 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/Web_scraping"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("datapipelabs/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/Web_scraping",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("datapipelabs/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/Web_scraping"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call datapipelabs/website-screenshot-pdf --silent --output-dataset

```

## MCP server setup

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