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

Turn a list of URLs into full-page PNG / JPEG screenshots or A4 / Letter PDFs. Desktop, laptop, tablet and mobile sizes or your own width, lazy-load scrolling, hide cookie banners with CSS. One row per URL with file link, size, final URL and HTTP status. Failed URLs are not charged.

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

## Pricing

from $4.00 / 1,000 page 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 — full page, mobile sizes, bulk URLs

Give it a list of URLs; get back one **PNG or JPEG screenshot** or one **PDF** per URL, plus a table row for each URL
with the file link, pixel size, file size, final URL after redirects, HTTP status and page title.

- **Full page** screenshots (scrolls once so lazy-loaded images appear), or just the first screen
- **Device sizes**: desktop 1440×900, laptop 1280×800, tablet 768×1024, mobile 390×844, or your own width × height;
  pixel density 1×, 2× (retina) or 3×
- **PDF** on A4 or Letter, with the on-screen design or the site's own print style
- **Hide elements** such as cookie banners, chat bubbles or newsletter pop-ups with CSS selectors
- **You pay per file you get.** URLs that fail, time out, answer an error page or are skipped by the rules below get
  a row with the reason and no per-URL charge (the small per-run start fee still applies — see Pricing).

No crawling: each URL you enter is opened once; links are not followed.

### Who uses this

- Visual archives and change tracking of your own or your clients' pages (schedule it daily)
- SEO and marketing reports: how a landing page looks on mobile vs desktop
- Turning public articles, docs and guides into PDFs
- QA checks after a deploy: one run over your key URLs, look at the pictures
- Thumbnails / previews of links for a directory or newsletter

### Input

| Field | What it does | Default |
|---|---|---|
| `urls` | Page URLs, one file each (`example.com` becomes `https://example.com`). Up to 1,000. | — |
| `format` | `png`, `jpeg` or `pdf` | `png` |
| `fullPage` | Whole page (true) or first screen only (false). Not used for PDF. | `true` |
| `device` | `desktop`, `laptop`, `tablet`, `mobile` or `custom` (+ `width`, `height`) | `desktop` |
| `deviceScaleFactor` | Pixel density 1–3 | `1` |
| `waitUntil` | `domcontentloaded`, `load` or `networkidle` (waits up to 10 s more for late content) | `load` |
| `delayMs` | Extra wait before capturing, 0–10,000 ms | `0` |
| `scrollToLoad` | Scroll once through the page first so lazy images load (full page only) | `true` |
| `hideSelectors` | CSS selectors to hide, e.g. `#cookie-banner`, `.chat-widget`, `header > .promo` (up to 50) | none |
| `jpegQuality` | 1–100 (JPEG only) | `80` |
| `pdfFormat` / `pdfMedia` | `A4` / `Letter`; `screen` / `print` (PDF only) | `A4` / `screen` |
| `maxItems` | Open at most this many URLs (cost guard); the rest get a free `max_items` row | `100` |

Example:

```json
{
  "urls": ["https://www.python.org/about/", "https://en.wikipedia.org/wiki/Web_scraping"],
  "format": "png",
  "device": "mobile",
  "deviceScaleFactor": 2,
  "hideSelectors": ["#site-map"]
}
```

### Output

Files go to the run's **key-value store** (key `00001-host-path.png`, numbered in input order). Each URL also gets a
**dataset row** (export as JSON, CSV, Excel). The same URL entered twice is opened once and gets one row.

| Field | Meaning |
|---|---|
| `url` | The URL you entered |
| `status` | `ok` (file saved, charged) or `skipped` (free — see `skipReason`) |
| `fileUrl` | Link to the file in the key-value store |
| `fileKey` | The file's key in the key-value store |
| `format`, `device` | As requested |
| `width`, `height` | Image size in pixels (device pixels: 2× density doubles both); `null` for PDF |
| `pages` | Number of PDF pages; `null` for images |
| `fullPage`, `truncated` | Full-page capture, and whether a very tall page was cut (see Limits) |
| `bytes` | File size |
| `finalUrl`, `httpStatus`, `title` | Where the page ended up after redirects, its HTTP status and `<title>` |
| `takenAt` | Capture time (UTC) |
| `skipReason`, `detail` | Why a URL was not captured |

Real rows from test runs (2026-11-15, desktop PNG unless noted):

| url | status | width × height / pages | bytes | note |
|---|---|---|---|---|
| https://example.com/ | ok | 1440 × 900 | 88,993 | |
| https://en.wikipedia.org/wiki/Web_scraping | ok | 1440 × 8988 | 2,483,723 | full page |
| https://en.wikipedia.org/wiki/Web_scraping (PDF, Letter) | ok | 13 pages | 355,929 | |
| https://www.python.org/about/ (mobile, 2×, JPEG) | ok | 780 × 6450 | 478,365 | `#site-map` hidden |
| https://en.wikipedia.org/w/index.php?search=… | skipped | | | `robots_txt` — Wikipedia's robots.txt disallows /w/ |
| https://www.amazon.com/dp/… | skipped | | | `terms_of_use` |

The **RUN_REPORT** record in the key-value store adds totals: captures, skipped URLs by reason, seconds per capture.

#### Skip reasons (all free)

| skipReason | Meaning |
|---|---|
| `robots_txt` | The site's robots.txt disallows the page for our bot (`DojitoScreenshotBot`) — also checked after redirects |
| `terms_of_use` / `blocked_site` | Large retailers and marketplaces (Amazon, eBay, Walmart…), Google, YouTube, and social networks (Facebook, Instagram, Threads, LinkedIn, X/Twitter, TikTok) whose terms forbid robots — never opened |
| `private_page` / `login_page` | URL paths such as `/login`, `/signin`, `/account`, `/customer(s)`, `/cart`, `/checkout`, `/order(s)`, `/wishlist`, `/register`, `/signup`, `/password` — or a page that shows a password field |
| `invalid_url` | Not a public http(s) address (also: a redirect to a private / internal address) |
| `http_error` | The page answered 4xx / 5xx (you get the status, not a picture of the error page) |
| `load_error` / `timeout` / `browser_error` | The page did not load, took more than 30 s in total, or the browser failed |
| `file_too_large` | The file was over 20 MB — try JPEG, `fullPage: false` or density 1 |
| `max_charge` | The run reached the maximum cost per run you set |
| `max_items` | The URL is beyond `maxItems` and was not opened |

### How it works, and the rules it keeps

- A real headless Chromium (Playwright). Each URL gets a fresh browser context — no cookies shared between URLs.
- **One page per website at a time**, at least 2 seconds apart (longer if robots.txt sets a Crawl-delay), up to 1–4
  different sites in parallel depending on memory.
- **robots.txt is obeyed** for the bot name `DojitoScreenshotBot`; the browser identifies itself with its normal
  user agent plus `DojitoScreenshotBot/1.0 (+https://apify.com/dojito/website-screenshot-pdf; contact djkim@dojito.com)`.
- **No bypassing**: no proxy rotation or residential / anti-bot proxies, no CAPTCHA solving, no stealth plugins, no
  logging in. If a site shows a bot check or blocks the request, you get that result (or `http_error`), not a
  workaround.
- **Cookie banners are not "accepted"** — `hideSelectors` only hides elements with CSS; nothing is clicked.
- Only public pages: all browser traffic passes a small filter inside the run that connects only to public IP
  addresses (the address it checked is the one it uses). Redirects are followed one hop at a time, and each hop is
  checked (public address, robots.txt, the rules above) before it is requested. Pop-up windows are not opened.

### Limits

- **Very tall pages are cut** at 16,384 device pixels (Chromium's reliable maximum): 16,384 px at density 1, 8,192 CSS
  px at 2×. The row then says `truncated: true`.
- Pages that keep loading forever are captured when the 30-second budget is nearly used up, so some late content may be
  missing — raise `delayMs` or use `networkidle` for dashboards and charts.
- Sites with bot protection (Cloudflare challenges, CAPTCHAs) may show a challenge page or answer 403. We do not get
  around that.
- Content behind a login, a paywall or a cookie wall that needs a click is not reachable.
- `fileUrl` opens without a token unless your Apify account restricts general resource access; then use your token or
  a signed URL. Files are kept as long as your run's storage is retained on your plan.
- Web fonts and sites that render only after user interaction may look different from your own browser.
- `tablet` and `mobile` set the screen size, pixel density and touch, but keep the desktop browser's user agent: sites
  that pick their mobile version by user agent show the desktop one. Pages without a mobile layout (no
  `<meta name="viewport">`) are drawn at their desktop width and only the left part fits the narrow screen.
- One image is at most 40 million device pixels (width × height × density²), so `custom` 3840 × 2160 works at
  density 1 but not at 3; full-page captures stop at that size too (`truncated: true`).
- `title` is copied from the page as-is. If you open the CSV export in a spreadsheet, a title starting with `=`, `+`,
  `-` or `@` can be read as a formula — prefer the JSON / Excel export or import CSV as text.

### Pricing

Pay per event: **$5.00 per 1,000 captures** on the Free plan, $4.50 on Bronze, $4.00 on Silver and above (one PNG,
JPEG or PDF = one capture). Apify's standard **start fee** of $0.00005 per GB of run memory is added once per run
($0.00005 at the default 1 GB), also when nothing is captured. Skipped and failed URLs add no per-URL charge. The
platform usage (compute) is included — you do not pay it separately; only the start fee grows with memory. Set
"Maximum cost per run" in the run options to cap spending; the actor stops before capturing anything the limit would
not cover.

**Speed:** the default 1 GB memory opens one page at a time (about 5–7 s per full-page capture in our tests). For long
lists choose 2 GB in the run options: two different sites at a time, same price per capture.

### FAQ

**Can it log in or get past cookie walls?** No. It captures what a first-time visitor sees, minus the elements you
hide.

**Does it follow links / crawl a site?** No. One file per URL you enter. Use a sitemap or link extractor first if you
need many URLs from one site.

**Why was a page skipped with `robots_txt` when it opens in my browser?** The site's robots.txt asks bots not to fetch
that path. We respect it.

**Can I get both PNG and PDF?** Run it twice with the same URLs (one run per format).

**Is the data stored?** Only in your own run's storage on Apify. We do not keep copies.

### Responsible use

You are responsible for having the right to capture and use the pages you enter (copyright, the site's terms,
privacy laws). Screenshots of third-party pages are copies of their content: use them for your own reference,
monitoring, testing or reporting, and don't republish them without permission. General information, not legal
advice.

Not affiliated with any website it captures. Built on Playwright (Apache-2.0) and Chromium.

# Actor input Schema

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

Pages to capture, e.g. https://example.com/pricing (a bare example.com becomes https://example.com). One file per URL — links are not followed. Up to 1,000 per run.

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

PNG (sharp, larger), JPEG (smaller) or PDF (printable, selectable text).

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

Capture the whole scrollable page, not just the first screen. Pages taller than 16,384 device pixels are cut there (truncated = true). Ignored for PDF (a PDF always has every page).

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

Browser window size: desktop 1440×900, laptop 1280×800, tablet 768×1024, mobile 390×844 (tablet and mobile render as touch devices). 'custom' uses Width and Height below.

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

Only with Device size = custom. 320–3840.

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

Only with Device size = custom: the window height (the first screen when Full page is off). 240–2160.

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

1 = normal, 2 = retina (twice the width and height in pixels, about 4× the file size), 3 = extra sharp phone screens.

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

When the page counts as ready. 'load' suits most sites; 'networkidle' waits for late content (charts, feeds) up to 10 s more. A page that never gets there is still captured once its time is up.

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

Wait this long after loading, before capturing (animations, fonts). 0–10,000. Each URL has a 30 s limit in total.

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

With Full page: scroll down once (up to 20 screens) so lazy-loaded images appear, then back to the top.

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

Elements to remove from the capture, e.g. #cookie-banner, .newsletter-popup, \[aria-label='Chat']. Hidden with CSS only — nothing is clicked, no consent is given for you.

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

Only for JPEG. 1–100.

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

Only for PDF.

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

Only for PDF. 'screen' keeps the on-screen design; 'print' uses the site's print style (often cleaner for articles).

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

Stop after this many URLs (cost guard). 1–1,000.

## Actor input object example

```json
{
  "urls": [
    "https://example.com/"
  ],
  "format": "png",
  "fullPage": true,
  "device": "desktop",
  "width": 1440,
  "height": 900,
  "deviceScaleFactor": 1,
  "waitUntil": "load",
  "delayMs": 0,
  "scrollToLoad": true,
  "jpegQuality": 80,
  "pdfFormat": "A4",
  "pdfMedia": "screen",
  "maxItems": 100
}
```

# Actor output Schema

## `overview` (type: `string`):

One row per URL: fileUrl, format, width, height, pages, bytes, httpStatus, title, finalUrl, status / skipReason. Only rows with status ok are paid results.

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

All screenshots and PDFs of this run.

## `runReport` (type: `string`):

JSON: captures, skipped counts by reason (robots_txt, terms_of_use, login_page, http_error, timeout, ...), details, seconds per capture. Free.

# 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://example.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dojito/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://example.com/"] }

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

```

## MCP server setup

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