# Website Screenshot & PDF: full page, mobile, dark mode (`opstoolkit/website-screenshot-pdf`) Actor

Give it web page URLs, get a PNG, JPEG or PDF of each: full page or one element, desktop, tablet or mobile size, light or dark mode, cookie banners hidden. Every file gets a public link. $1.20 per 1,000 screenshots, failed pages free.

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

## Pricing

from $1.20 / 1,000 screenshot 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 & PDF: full page, mobile, dark mode

Give it a list of public web pages and get a PNG, JPEG or PDF of each one, with a public link to every file. Choose full page or first screen, desktop, tablet or mobile size, light or dark mode, or capture a single element such as a pricing table.

Built for developers, designers, marketers and QA people who need page images in bulk: client reports, change logs, mockups, archives, link previews and visual checks.

**$1.20 per 1,000 screenshots.** Pages that fail to load, answer 404 or are blocked cost nothing. The platform usage is included in that price. Apify's free monthly credit covers a first test run at no cost.

### What you get

One row per URL, and the file itself in the run's key-value store.

| Column | Example | Notes |
|---|---|---|
| `screenshotUrl` | `https://api.apify.com/v2/key-value-stores/.../records/crawlee-dev-6f6901a1.png` | Link to the file |
| `url` / `finalUrl` | `https://crawlee.dev` / `https://crawlee.dev/` | After redirects |
| `status` | `ok` | `ok`, `failed`, `blocked_by_robots_txt` or `invalid_url`. Only `ok` is charged |
| `title` | `Welcome to Python.org` | The page title |
| `format` / `device` | `png` / `desktop` | |
| `width` / `height` | `1280` / `2874` | Pixels, for images |
| `fileSizeBytes` | `261336` | |
| `httpStatus` | `200` | |
| `loadTimeMs` | `4626` | |
| `error` | `The page answered HTTP 404` | A plain sentence when something failed |

Export the table as JSON, CSV, Excel or HTML. The image links work in a spreadsheet or a web page.

### How to use

1. **Paste web addresses**, one per line, for example `https://example.com/pricing`.
2. **Pick the file type and device.** Defaults are a full-page PNG at desktop size.
3. **Press Start.** Open the dataset for the table with links, or the Storage tab for the files.

### Use it from an AI agent

In Claude, ChatGPT or Cursor, add the Apify MCP server (https://mcp.apify.com) and let the agent call this Actor (`opstoolkit/website-screenshot-pdf`). It needs only `urls`. Every other field has a default, and the agent gets back one row per page with a link to the file.

Example prompt: "Take a full-page, dark-mode mobile screenshot of https://example.com/pricing and https://example.com/about, and give me the links to the images."

### Input example

```json
{
  "urls": ["https://crawlee.dev", "https://www.python.org"],
  "format": "png",
  "device": "mobile",
  "colorScheme": "dark",
  "fullPage": true,
  "hideCookieBanners": true,
  "waitMs": 700
}
```

Other things you can set:

- **Capture one element**: a CSS selector such as `main` or `#pricing`.
- **Wait for element**: the capture waits until the selector appears, for pages that draw charts or tables late.
- **Custom size**: choose Custom and set width and height from 200 to 4,000 pixels.
- **PDF**: paper size, landscape and background colors.
- **Capture error pages too**: off by default, so a 404 is a free failure and not a charged image.

### Real results

From real runs (the same page can look different on another day):

| Page | Settings | Result | Size | Time |
|---|---|---|---|---|
| example.com | PNG, desktop, full page | 1280 x 800 | 36 KB | 2.7 s |
| python.org | PNG, desktop, full page | 1280 x 2549 | 410 KB | 4.0 s |
| crawlee.dev | PNG, desktop, full page | 1280 x 2874 | 261 KB | 4.6 s |
| crawlee.dev | JPEG, mobile, dark mode, first screen | 1170 x 2532 | 155 KB | 2.4 s |
| example.com | PDF, A4 | 1 page | 55 KB | 2.0 s |
| example.com/nope | PNG | failed, HTTP 404, not charged | | 0.6 s |

Mobile uses a 3x pixel ratio, so a 390 pixel wide phone screen comes out 1,170 pixels wide.

One row:

```json
{
  "url": "https://crawlee.dev",
  "status": "ok",
  "finalUrl": "https://crawlee.dev/",
  "httpStatus": 200,
  "format": "png",
  "device": "desktop",
  "width": 1280,
  "height": 2874,
  "fileSizeBytes": 261336,
  "key": "crawlee-dev-6f6901a1.png",
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/.../records/crawlee-dev-6f6901a1.png",
  "loadTimeMs": 4626,
  "error": null
}
```

### What it does to get a clean image

- Scrolls the page once so lazy-loaded images and sections appear, then returns to the top.
- Hides common cookie and consent pop-ups with CSS. It does not click or accept anything for you.
- Skips known ad and tracking scripts, so pages load faster and have fewer pop-ups.
- Cuts very long pages at 12,000 image pixels by default (up to 16,000) so the file stays usable. On mobile (3x) that is the first 4,000 pixels of the page as you see it on the phone.
- If a page keeps loading forever (endless trackers or live updates), it is captured when the timeout per page is over instead of failing.

### Use cases

- **Client reports**: attach a mobile and desktop screenshot of each page you changed.
- **Change logs**: run it on a schedule and keep a dated image of a competitor's pricing page.
- **Design and QA**: check a page in dark mode and at three sizes in one run.
- **Archives**: save a PDF of an article or a terms page on the day you read it.
- **Previews**: make thumbnails for a link directory or a newsletter.

### Pricing

Pay per event: **$1.20 per 1,000 screenshots** ($0.0012 per screenshot). Apify adds a small fee for each run start. The compute cost of the browser is included, so you do not pay platform usage on top.

| Screenshots | Cost |
|---|---|
| 100 | $0.12 |
| 1,000 | $1.20 |
| 10,000 | $12 |

You pay only for pages with status `ok`. Failed pages, 404s, blocked pages and invalid addresses are free. Set a max cost per run in the Apify run options to cap spending.

**Compared with other options.** Other screenshot Actors on the Store charge $0.0006 to $0.01 per screenshot. Some of them also pass the platform usage on to you, and one popular free Actor uses 2 GB of memory per run. Here the price is flat and the compute is included.

Starting the browser takes a few seconds, so very small runs cost the same fixed amount of time. Put many URLs in one run when you can.

### How it treats other people's servers

- It follows robots.txt, including for the page a redirect leads to. If a page is disallowed, it is skipped and free.
- It loads each page once, like a visitor, and identifies itself with a User-Agent that ends in `SiteShotBot/1.0`.
- It does not log in, does not solve CAPTCHAs and does not get around bot protection. A page behind such a wall is reported as failed, free of charge.
- Addresses that are not on the public internet (localhost, private networks, cloud metadata) are refused, including inside redirects and page requests.

### Limits

- Public pages only. Pages that need a login, a cookie you set or a paid account are not supported.
- Some sites show a bot check or an empty page to automated browsers. You get that page or a failure, not the real content.
- Heavy single-page apps may need **Wait for = Network idle** or **Wait for element**.
- Full-page images are cut at 12,000 pixels by default and 16,000 at most. A few very heavy pages (3D, video, many animated layers) cannot be drawn that tall at the mobile 3x ratio: you then get a shorter image of the top of the page, and `height` shows how tall it is.
- Animations are frozen, and videos show their first frame.
- Up to 10,000 URLs per run.

### Works well with

- **[Sitemap URL Extractor](https://apify.com/opstoolkit/sitemap-url-extractor)**: list every page of a site, then pass the URLs here to keep a dated image of each one.
- **[Core Web Vitals Checker](https://apify.com/opstoolkit/core-web-vitals-checker)**: screenshot the same pages you test for LCP, INP and CLS, so a bad score has a picture next to it.
- **[Website SEO and Broken Link Audit](https://apify.com/opstoolkit/site-seo-link-audit)**: audit a site, then capture the pages with problems for the client report.

### Integrations

Everything Apify supports works here: schedules, webhooks, the REST API, and the official integrations with Zapier, Make, n8n and Google Sheets. The **API** tab on this page has ready code for JavaScript, Python and cURL.

### FAQ

**The screenshot shows a cookie banner. Why?**
The Actor hides the common ones. If a site uses an unusual banner, open an issue with the URL and I add it.

**Can I take a screenshot of a page behind a login?**
No. That is on purpose.

**Why is a page marked failed when it opens in my browser?**
Usually the site blocks automated visitors, or it needs more time. Try **Wait for = Network idle** and a longer timeout. If it still fails, open an issue with the URL.

**How long are the files kept?**
They stay in the run's key-value store as long as the run is stored under your Apify plan. Download what you need to keep.

**Something broke.**
Open an issue on the Issues tab with the run link. I reply within a day.

# Changelog

This Actor's version history is a separate document: https://apify.com/opstoolkit/website-screenshot-pdf/changelog.md

# Actor input Schema

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

Web pages to capture, one address per line, for example https://example.com/pricing. A line without https:// gets it added. Public pages only, no logins. Duplicates are merged. Up to 10,000 per run.

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

File type to create: png (default, sharp), jpeg (smaller files) or pdf (prints the page like a browser would). Example: pdf.

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

Screen size preset: desktop (1280 x 800, default), laptop (1440 x 900), tablet (820 x 1180), mobile (390 x 844) or custom. Mobile also loads the mobile version of the page. With custom, set the width and height below.

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

true (default) captures the whole page from top to bottom. false captures only the first screen. Ignored for PDF.

## `colorScheme` (type: `string`):

light (default) or dark. Sites that follow the visitor's color setting show their dark theme when this is dark. A site without a dark theme looks the same either way.

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

Width in pixels, 200 to 4000, for example 1600. Used only when device is custom. Leave empty otherwise.

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

Height in pixels, 200 to 4000, for example 900. Used only when device is custom. Leave empty otherwise.

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

Pixel ratio, 1 to 3. 1 is normal. 2 doubles the pixels in each direction for sharper images and bigger files. Leave empty to use the device default (3 on mobile, 2 on tablet).

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

Tallest full-page image in pixels, 1000 to 16000, default 12000. Longer pages are cut at this height so the file stays usable. These are image pixels: on mobile (3x) 12000 covers the first 4000 pixels of the page as seen on the phone.

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

When the page counts as loaded: load (default), domcontentloaded (fastest) or networkidle (slowest, for heavy single-page apps that keep loading files).

## `waitMs` (type: `integer`):

Extra pause in milliseconds after the page loads, 0 to 30000, default 700, so fonts, animations and lazy images settle. Example: 2000.

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

Optional CSS selector, for example #chart. The capture waits for it to appear, up to 20 seconds or the page timeout if that is shorter. If it never appears, the page is reported as failed (free). Leave empty to skip.

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

Optional CSS selector, for example main or #pricing. Captures only the first element that matches, instead of the page. If nothing matches, the page is reported as failed (free). Ignored for PDF. Leave empty to capture the page.

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

true (default) hides the common cookie and consent pop-ups with CSS. Nothing is clicked or accepted. false leaves them as they are.

## `blockTrackers` (type: `boolean`):

true (default) does not load known ad and analytics scripts, so pages load faster and the image is cleaner. false loads everything the page asks for.

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

JPEG quality from 30 to 100, default 80. Higher means a sharper and bigger file. Used only when format is jpeg.

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

Paper size for PDF files: A4 (default), A3, Letter or Legal. Ignored for images.

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

true turns the PDF page on its side. Default false (portrait). Ignored for images.

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

true (default) prints background colors and images, as a browser does when you tick that option. false leaves them out. Ignored for images.

## `captureErrorPages` (type: `boolean`):

false (default): a page that answers 404 or 500 is reported as failed and costs nothing. true: it is captured and charged like any other page.

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

Seconds to wait for one page, 5 to 120, default 30. A page that takes longer is reported as failed, which is free. Raise it for slow sites.

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

How many pages to capture at the same time, 1 to 8, default 3. 3 fits the 1 GB of memory this Actor runs with. Lower it to 1 or 2 for very heavy pages.

## Actor input object example

```json
{
  "urls": [
    "https://crawlee.dev",
    "https://www.python.org"
  ],
  "format": "png",
  "device": "desktop",
  "fullPage": true,
  "colorScheme": "light",
  "maxFullPageHeight": 12000,
  "waitUntil": "load",
  "waitMs": 700,
  "hideCookieBanners": true,
  "blockTrackers": true,
  "jpegQuality": 80,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfPrintBackground": true,
  "captureErrorPages": false,
  "timeoutSecs": 30,
  "maxConcurrency": 3
}
```

# Actor output Schema

## `captures` (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://crawlee.dev",
        "https://www.python.org"
    ]
};

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

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

```

## MCP server setup

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