# Website Screenshot & PDF Generator (`apisamurai/website-screenshot-pdf`) Actor

Capture full-page website screenshots (PNG/JPEG) or PDFs in bulk with real Chrome. Desktop, tablet or mobile, dark mode, element capture, lazy-load scrolling and automatic cookie-banner hiding. Pay per capture, failed URLs are free.

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

## Pricing

from $6.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Generator

Capture **full-page screenshots (PNG/JPEG) or PDFs** of any list of websites with real Chrome. Desktop, tablet or mobile view, dark mode, single-element capture, lazy-image loading and **automatic cookie-banner hiding** for clean results. Bulk URLs, fast, and failed URLs are never charged.

### What you can use it for

- **Website monitoring and archiving:** daily snapshots of competitor pages, pricing pages and landing pages.
- **Agencies and SEO:** visual reports for clients, before/after redesign proof, mobile vs desktop checks.
- **Compliance and evidence:** time-stamped PDF copies of terms, ads or listings.
- **Thumbnails and previews:** website previews for directories, link pages and newsletters.
- **AI and automation:** feed page images to vision models from Make, n8n, Zapier or the API.

### Input

| Field | What it does |
|---|---|
| URLs | Pages to capture, one per line. |
| Output | PNG, JPEG or PDF. |
| Full page | Whole scrollable page (up to the max page height) or just the visible screen. |
| Max page height | Full-page captures are cut at this height. Default 12,000 px, from 1,000 to 30,000. |
| Device | Desktop (custom width/height), tablet (iPad) or mobile (iPhone 13). |
| Hide cookie banners | Hides consent pop-ups from common providers (OneTrust, Cookiebot, Sourcepoint, Didomi, Quantcast and more) without clicking anything. |
| Dark mode | Requests the site's dark theme. |
| Capture only this element | CSS selector such as `#pricing`. |
| Scroll to load lazy images | Makes lazy-loaded images appear in full-page captures. |
| Block ads and trackers | `blockAds`, on by default. Skips third-party ads, analytics and tracking scripts; the site's own content is never blocked. |
| PDF paper size | A4, Letter, Legal or A3. |
| Proxy | Optional, for sites that block data centers or show country-specific content. |

```json
{
  "urls": ["https://stripe.com/pricing", "https://www.bbc.com/news"],
  "output": "png",
  "fullPage": true,
  "device": "desktop",
  "hideCookieBanners": true
}
```

### Output

One row per page, with a permanent link to the file stored in your run (real output, October 2026):

```json
{
  "url": "https://www.bbc.com/news",
  "finalUrl": "https://www.bbc.com/news",
  "httpStatus": 200,
  "title": "BBC News - Breaking news, video and the latest top stories from the U.S. and around the world",
  "output": "png",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/yN3lllWhkqM6eVeXK/records/0003-www-bbc-com-news.png",
  "fileBytes": 2969470,
  "device": "desktop",
  "fullPage": true,
  "capture": "full-page",
  "clipped": false,
  "seconds": 5.2,
  "capturedAt": "2026-10-17T18:18:00.473Z"
}
```

### Pricing

Pay per capture: **$6 per 1,000 screenshots or PDFs** on paid Apify plans. URLs that fail to load are not charged. Set a spending limit per run and the Actor stops cleanly when it is reached.

### Tips

- Use **JPEG** for small files and **PNG** for crisp text.
- Very long pages are cut at the max page height (12,000 px by default) so files stay usable.
- If a site shows a "verify you are human" page, turn on the residential proxy.

### FAQ

**Are ads and trackers blocked?**
Yes, by default ads and trackers are blocked for faster, cleaner captures; set `blockAds` to `false` to capture pages with them.

**What happens with very long pages?**
Full-page captures taller than **Max page height** (`maxHeight`, default 12,000 px) are cut at that height, and the row shows `"clipped": true`. Raise it up to 30,000 px if you need more, or lower it for heavy sites.

**What is a viewport fallback?**
Some heavy sites crash the browser or never stop animating. The Actor then retries once in a fresh browser without scrolling and with the height capped at 8,000 px. If that also fails for a full-page PNG or JPEG, it captures just the visible screen instead. That row has `"capture": "viewport-fallback"` and a `note` with the reason. It is charged like any capture because you get a real image. PDFs have no fallback.

**Where do I find the URLs that failed?**
Failed URLs are not in the dataset and are not charged. The run's status message lists them, and the `SUMMARY` record in the run's key-value store has every input URL with its result (`captured`, `fallback` or `failed`), the number of attempts and the reason in plain words, such as "page crashed twice" or "screenshot timed out".

**Which input formats work?**
URLs work as pasted from a chat or doc, even wrapped in backticks, quotes or markdown, as bullets, or several to a line, and each is captured with its full path and query. Field names from other screenshot tools also work: `url`, `startUrls` (plain links or `{ "url": ... }` objects), `format`, `delayMs`, `colorScheme` and `blockCookieBanners`. Entries that are not web addresses are skipped with a warning, and the run stops only when none can be read.

**Am I charged when a site blocks the Actor?**
No. Pages that the site blocks or answers with an error (for example HTTP 403 or a "you've been blocked" page) are not charged and not saved. They are listed as failed with `"blocked": true` in `SUMMARY`. For sites that block data centers, use the Proxy input with residential proxies.

# Actor input Schema

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

Pages to capture, one per line.

## `output` (type: `string`):

PNG for best quality, JPEG for small files, PDF for printable documents.

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

Capture the whole scrollable page (up to the max page height below). Off captures only the visible screen.

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

Full-page captures taller than this are cut at this height and the row shows clipped: true. Lower values are faster and more reliable on heavy sites.

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

Desktop uses the width and height below. Mobile and tablet emulate an iPhone 13 and an iPad.

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

Browser window width for desktop captures.

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

Browser window height for desktop captures (the visible area).

## `waitSeconds` (type: `integer`):

Wait after the page loads, for animations or slow widgets.

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

Hides common cookie and consent pop-ups for clean captures.

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

Asks the site for its dark theme, if it has one.

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

CSS selector, e.g. #pricing or .hero. Leave empty for the whole page.

## `scrollToLoad` (type: `boolean`):

Scrolls through the page first so lazy-loaded images appear in full-page captures.

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

Skips third-party ads, analytics and tracking scripts for faster, cleaner captures. The site's own content is never blocked.

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

Only for PDF output.

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

Optional. Use a proxy for sites that block data centers or show country-specific content.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://www.wikipedia.org"
  ],
  "output": "png",
  "fullPage": true,
  "maxHeight": 12000,
  "device": "desktop",
  "width": 1366,
  "height": 768,
  "waitSeconds": 1,
  "hideCookieBanners": true,
  "darkMode": false,
  "scrollToLoad": true,
  "blockAds": true,
  "pdfFormat": "A4",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (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("apisamurai/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("apisamurai/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 apisamurai/website-screenshot-pdf --silent --output-dataset

```

## MCP server setup

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