# Website Screenshot & PDF — Full Page, Mobile, Bulk URLs (`lundrik/website-screenshot`) Actor

Screenshot any list of URLs to PNG, JPEG or PDF: full page, visible area or one element, desktop or mobile. Cookie banners hidden, lazy images loaded. Pay only for screenshots that succeed – failed URLs are free.

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

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, Bulk URLs

**Capture clean full-page screenshots of any list of URLs — cookie banners hidden, lazy images loaded, sticky headers fixed — and pay only for screenshots that succeed.** PNG, JPEG or PDF; desktop, tablet or mobile; one URL or thousands, or every page of a site from its sitemap.

### Why this Actor

| | This Actor | Typical screenshot actors |
|---|---|---|
| Failed URLs (timeouts, 404, blocked) | ✅ **free**, with an error code and a reason | Often charged anyway |
| Price | ✅ fixed price per file, platform usage included | Platform usage on top – a slow page can cost several cents |
| Cookie banners | ✅ hidden for 11 consent platforms + cookie walls (never clicks Accept) | Banner covers the page |
| Sticky headers in full-page images | ✅ appear once, at the top | Repeated down the image or stuck in the middle |
| Lazy images | ✅ time-limited scroll, then back to the top | Grey placeholders, or the run hangs on endless scrolling |
| "Loading…" screenshots | ✅ waits for load, a short network-idle window, web fonts and your selector | Captures the spinner |
| Apps that scroll inside a box (dashboards, docs, SPAs) | ✅ the box is expanded, so full page means full page | Only the first screen |
| Part of a page | ✅ visible area, top N pixels, or one element by CSS selector | Full page only |
| Very long pages | ✅ captured in strips and stitched – no timeouts | Timeouts or blank bottoms |
| Emojis, Chinese, Japanese, Korean, Arabic | ✅ fonts installed | Empty boxes |
| Many pages of one site | ✅ `sitemapUrls` (respects robots.txt) | Paste every URL by hand |
| Required input | ✅ only `urls` | Several required fields |

### How to use

1. Paste your URLs (or a sitemap).
2. Pick format (PNG / JPEG / PDF), capture mode and device – or keep the defaults.
3. Run. Each URL gets one row with a link to its file; download them from the results table or via the API.

### Input examples

Full page on mobile:

```json
{ "urls": ["https://example.com", "https://apify.com"], "device": "mobile" }
```

Link previews (top 1200 px as JPEG) for every blog post of a site:

```json
{ "sitemapUrls": ["https://example.com/sitemap.xml"], "sitemapUrlFilter": "/blog/", "maxUrlsFromSitemaps": 200,
  "captureMode": "top", "topHeight": 1200, "format": "jpeg" }
```

One element (a pricing table):

```json
{ "urls": ["https://example.com/pricing"], "captureMode": "element", "selector": "#pricing" }
```

Main options: `format` (png, jpeg, pdf), `captureMode` (`viewport`, `fullPage`, `top` + `topHeight`, `element` + `selector`),
`device` (desktop, laptop, tablet, mobile), `viewportWidth` / `viewportHeight`, `deviceScaleFactor`, `waitUntil`, `waitForSelector`, `delay`,
`scrollToBottom`, `maxScrollSecs`, `hideCookieBanners`, `fixStickyElements`, `expandScrollContainers`, `selectorsToHide`, `darkMode`, `maxHeight`,
`pageTimeoutSecs`, `captureErrorPages`, `ignoreHttpsErrors`, `pdfPaperFormat`, `sitemapUrls`, `maxUrlsFromSitemaps`, `sitemapUrlFilter`, `respectRobotsTxt`.

### Output

Each URL gives one row (sitemap pages disallowed by robots.txt or on another host are skipped before capture – no row, no charge, a count in the log): `url`, `finalUrl`, `status` (`ok` / `error` / `skipped`), `charged`, `screenshotUrl`, `width`, `height`,
`httpStatus`, `pageTitle`, `truncated`, `cookieBannersHidden`, `stickyFixed`, `scrollContainerExpanded`, `errorCode`, `errorMessage`, `durationMs`.

```json
{
  "url": "https://example.com",
  "status": "ok",
  "charged": "fullpage",
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/.../records/example-com-1a2b3c4d.png?signature=...",
  "width": 1280,
  "height": 2140,
  "pageTitle": "Example Domain",
  "truncated": false,
  "cookieBannersHidden": 1,
  "errorCode": null
}
```

Files are stored in the run's key-value store; `screenshotUrl` is a signed link that works without an API token.
Files are kept according to your Apify plan's data retention. The row is written only after the file is saved, so the link works as soon as you read it.

Error codes (all free): `INVALID_URL`, `PRIVATE_ADDRESS_BLOCKED`, `DNS_NOT_FOUND`, `CONNECTION_FAILED`, `SSL_ERROR`, `TIMEOUT`, `HTTP_ERROR`,
`BLOCKED_BY_BOT_PROTECTION`, `NOT_HTML`, `PAGE_CRASHED`, `SELECTOR_NOT_FOUND`, `SITEMAP_INVALID`, `SPENDING_LIMIT_REACHED`, `INTERNAL_ERROR`.

### Pricing (pay per event, platform usage included)

Apart from the tiny Apify start fee, you pay only for files that were saved. Platform usage (compute, storage, traffic) is included in the price.

| Event | When it is charged | Price |
|---|---|---|
| `screenshot` | PNG or JPEG in `viewport`, `top` or `element` mode | $0.0025 |
| `fullpage` | PNG or JPEG in `fullPage` mode (the default) | $0.0055 |
| `pdf` | PDF file (any capture mode) | $0.0045 |
| Actor start | once per run (Apify standard) | $0.00005 per GB of memory per run (Apify standard) – $0.0001 at the default 2 GB |
| Failed URL | errors, blocked pages, timeouts, skipped URLs (sitemap pages disallowed by robots.txt are not captured at all) | **free** |

Example: 1,000 full-page screenshots cost $5.50; 1,000 visible-area screenshots cost $2.50.
Each URL is charged at most once per run, even if it was retried. The `charged` column in every row shows which event was charged.

Set a maximum cost per run and the Actor stops cleanly at your limit. If a run is restarted by the platform in the middle of a batch,
finished URLs are not repeated and are not charged twice.

### Use with AI agents (MCP)

The Actor works as a tool in the [Apify MCP server](https://mcp.apify.com), so Claude, ChatGPT, Cursor and other MCP clients can take screenshots:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com/?tools=lundrik/website-screenshot",
      "headers": { "Authorization": "Bearer <YOUR_APIFY_TOKEN>" }
    }
  }
}
```

Example prompt: *"Take a mobile screenshot of https://example.com and tell me if the cookie banner hides the main button."* The agent gets `screenshotUrl` (an image link it can open) plus `pageTitle`, `httpStatus` and a clear `errorCode` when a page cannot be captured.

From code (JavaScript):

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('lundrik/website-screenshot').call({ urls: ['https://example.com'], captureMode: 'viewport' });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].screenshotUrl);
```

### Memory

Use **2048 MB** (the default recommendation). In our test of 100 public sites, 2 GB gave 89 % successful viewport screenshots;
1 GB gave 83 % with more timeouts and was not cheaper. Heavy news and shop pages can need ~1.5–2 GB for a full-page capture or a PDF,
so a page that crashes at low memory may succeed with 4 GB. **4096 MB is about 2× faster** for full-page screenshots and PDFs
(in our test: 9.5 s instead of 17 s per URL for full pages) with the same success rate — choose it when speed matters; the price per file is the same. About 7 % of popular sites refuse automated browsers; those return
`BLOCKED_BY_BOT_PROTECTION` or `HTTP_ERROR` and cost nothing.

### FAQ

**I already use Apify's Website Screenshot Generator. Do I need to change my input?** No. Its fields keep their names (`urls`, `format`, `waitUntil`, `delay`, `viewportWidth`, `scrollToBottom`, `delayAfterScrolling`, `waitUntilNetworkIdleAfterScroll`, `selectorsToHide`), `{ "url": "…" }` objects work, and `networkidle0/2` are accepted. Unsupported fields (e.g. `proxy`) are ignored with a log message.

**Does it log in or bypass bot protection / CAPTCHAs?** No. Pages behind a login or a bot challenge return `BLOCKED_BY_BOT_PROTECTION` (or `HTTP_ERROR`) and are not charged.

**My full-page screenshot shows only one screen.** The site probably scrolls inside an inner box; `expandScrollContainers` (on by default) handles the common layouts. If it still happens, set `waitForSelector` to an element of the content, or tell us the URL in Issues.

**How do I capture only the part above the fold?** `captureMode: "top"` with `topHeight` (e.g. 800), or `captureMode: "viewport"`.

**Can I set the image height?** Yes: `viewportHeight` for the window, `topHeight` for a fixed-height crop, `maxHeight` as an upper limit for full pages.

**Why did my cookie banner stay?** Custom banners that do not use a known platform or a typical class name are not recognised. Add their CSS selector to `selectorsToHide`.

**The page has an invalid certificate.** Set `ignoreHttpsErrors: true`.

**Can I screenshot a whole website?** Give its sitemap in `sitemapUrls` (with `sitemapUrlFilter` and `maxUrlsFromSitemaps` to control which pages and how many; default 100, max 5,000). Pages on the sitemap's own host are taken; indexes up to 2 levels / 30 files; reading sitemaps stops after 2 minutes. The Actor does not follow links on its own. Clear `urls` if you only want the sitemap pages.

**What about very long pages?** Capped at 15,000 px by default (`maxHeight`, up to 30,000); the row shows `truncated: true`.

**Can I schedule it?** Yes — use Apify Schedules to capture pages daily or weekly. **From Make / Zapier / n8n?** Yes, through the Apify integrations and API.

### Limits

Public pages only. Private and internal addresses are blocked. Pages with endless scrolling stop at `maxScrollSecs` / `maxHeight`.
Respect each site's terms of use.

# Actor input Schema

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

Pages to capture, e.g. https://example.com. Plain URL strings or {"url": "..."} objects (the input format of Apify's Website Screenshot Generator works as-is). Duplicates are removed.

## `sitemapUrls` (type: `array`):

Optional: sitemap URLs, e.g. https://example.com/sitemap.xml. Pages listed in the sitemap (same host) are captured like URLs in `urls`, up to maxUrlsFromSitemaps. Sitemap indexes (2 levels, up to 30 files), .xml.gz and plain-text sitemaps work. Pages disallowed by robots.txt are skipped. If you give only sitemaps, the example URLs in `urls` are ignored automatically (or clear the field).

## `maxUrlsFromSitemaps` (type: `integer`):

Upper limit of pages taken from all sitemaps together (in addition to `urls`) – keeps the cost of a run predictable.

## `sitemapUrlFilter` (type: `string`):

Optional text filter for sitemap URLs, e.g. /blog/ or /products/. Case-insensitive.

## `respectRobotsTxt` (type: `boolean`):

Pages found in sitemaps that the site's robots.txt disallows are skipped (free). URLs you type in `urls` are always captured.

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

png = sharp, lossless (default); jpeg = smaller files; pdf = printable document of the page.

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

Only for JPEG.

## `captureMode` (type: `string`):

fullPage = the whole page top to bottom (default); viewport = only what fits on one screen; top = the first `topHeight` pixels (above-the-fold previews); element = one element picked by the CSS `selector`.

## `topHeight` (type: `integer`):

Only for captureMode = top: how many pixels from the top of the page to capture, e.g. 1200 for a link preview.

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

Only for captureMode = element: CSS selector of the element to capture, e.g. #pricing or .hero. The first match is used.

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

Hides consent banners of OneTrust, Cookiebot, Didomi, Usercentrics, Quantcast, TrustArc, CookieYes, Complianz, Iubenda, Osano, Sourcepoint and typical cookie walls. Never clicks Accept.

## `fixStickyElements` (type: `boolean`):

Fixed/sticky headers and bars appear once in full-page images instead of repeating.

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

Scrolls down (time-limited) so lazy images load, then returns to the top.

## `maxScrollSecs` (type: `integer`):

Infinite-scroll pages stop here.

## `delayAfterScrolling` (type: `integer`):

Pause after scrolling so late content can appear.

## `waitUntilNetworkIdleAfterScroll` (type: `boolean`):

After scrolling, wait briefly for the network to calm down.

## `waitUntilNetworkIdleAfterScrollTimeout` (type: `integer`):

Upper limit for that wait.

## `networkIdleWaitSecs` (type: `integer`):

Short, capped wait for the network to calm down after load. 0 = off.

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

Screen size and mobile emulation (touch, mobile layout). Override the size with viewportWidth / viewportHeight.

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

0 = use the device width (desktop 1280).

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

0 = use the device height (desktop 800).

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

2 = retina.

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

When the page counts as loaded. load (default) is right for most pages; domcontentloaded is faster; networkidle waits for quiet network (capped, never hangs). networkidle0/2 from Apify's Website Screenshot Generator are accepted.

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

Optional CSS selector to wait for before the capture (e.g. a chart or price that loads late). If it never appears, the URL fails with SELECTOR_NOT_FOUND (free).

## `delay` (type: `integer`):

Extra fixed wait in milliseconds before the capture, for animations. Usually not needed – the Actor already waits for load, a short network-idle window and web fonts.

## `selectorsToHide` (type: `string`):

CSS selectors to hide before the capture (chat widgets, popups, ads), one per line or comma-separated, e.g. #intercom-container, .newsletter-popup

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

Ask pages for their dark colour scheme.

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

Pages taller than this are cut at this height and marked truncated: true. Very long pages are captured in strips and stitched, so they do not time out.

## `expandScrollContainers` (type: `boolean`):

Some sites (web apps, dashboards, docs) scroll inside an inner container, so a normal full-page capture shows only one screen. This expands that container so the whole content is captured. Applies to fullPage, top and PDF.

## `pageTimeoutSecs` (type: `integer`):

Maximum time for one URL. Slower pages fail as TIMEOUT and are free.

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

If off, HTTP errors are reported as free failures.

## `ignoreHttpsErrors` (type: `boolean`):

Capture pages with an expired, self-signed or otherwise invalid certificate (staging sites, intranet test servers that are publicly reachable). Off = such pages fail with SSL_ERROR (free).

## `pdfPaperFormat` (type: `string`):

Paper size for PDF output.

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

How many pages are captured at the same time. 0 = automatic (recommended).

## Actor input object example

```json
{
  "urls": [
    "https://example.com",
    "https://apify.com"
  ],
  "sitemapUrls": [],
  "maxUrlsFromSitemaps": 100,
  "sitemapUrlFilter": "",
  "respectRobotsTxt": true,
  "format": "png",
  "jpegQuality": 80,
  "captureMode": "fullPage",
  "topHeight": 1200,
  "selector": "",
  "hideCookieBanners": true,
  "fixStickyElements": true,
  "scrollToBottom": true,
  "maxScrollSecs": 5,
  "delayAfterScrolling": 200,
  "waitUntilNetworkIdleAfterScroll": false,
  "waitUntilNetworkIdleAfterScrollTimeout": 3000,
  "networkIdleWaitSecs": 1,
  "device": "desktop",
  "viewportWidth": 0,
  "viewportHeight": 0,
  "deviceScaleFactor": 1,
  "waitUntil": "load",
  "waitForSelector": "",
  "delay": 0,
  "selectorsToHide": "",
  "darkMode": false,
  "maxHeight": 15000,
  "expandScrollContainers": true,
  "pageTimeoutSecs": 45,
  "captureErrorPages": false,
  "ignoreHttpsErrors": false,
  "pdfPaperFormat": "A4",
  "maxConcurrency": 0
}
```

# Actor output Schema

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

Dataset rows: url, status (ok | error | skipped), screenshotUrl (signed link to the file), width, height, errorCode, durationMs.

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

Default key-value store with the PNG, JPEG or PDF files (and the RUN_SUMMARY record).

# 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",
        "https://apify.com"
    ],
    "sitemapUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("lundrik/website-screenshot").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",
        "https://apify.com",
    ],
    "sitemapUrls": [],
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lundrik/website-screenshot"
        }
    }
}
```

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/GuqwBk4rmPsLJaXlB/builds/ieDDipBXLkbQd8Teh/openapi.json
