# Website Screenshot & PDF API – Full Page, Mobile, Dark Mode (`kris_fili/website-screenshot-pdf`) Actor

Capture full-page or viewport screenshots (PNG, JPEG, WebP) and PDFs of any web page in bulk. Desktop, tablet and phone sizes, dark mode, cookie banners and ads hidden, element capture by CSS selector, custom waits.

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

## Pricing

from $1.00 / 1,000 screenshot or pdfs

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, Dark Mode

Capture **screenshots or PDFs of any web page** in bulk – full page or first screen, desktop, tablet or phone, light or dark mode – with **cookie banners and ads removed**.

- 🖼️ **PNG, JPEG, WebP or PDF**, full page (up to 20,000 px) or viewport only.
- 📱 **Devices**: desktop (1366, 1440, 1920 px), iPad, iPhone 15 Pro, Pixel 7 – sites serve their real mobile version.
- 🌙 **Dark mode** for sites that support it.
- 🍪 **Cookie pop-ups hidden** (OneTrust, Cookiebot, Usercentrics, Didomi, Quantcast and dozens more) – without accepting anything. **Ads and trackers blocked.**
- 🎯 **Capture one element** by CSS selector, **wait for an element**, hide your own selectors, add a delay.
- 🖼️ Lazy-loaded images appear (the page is scrolled before capture).
- 💸 **$0.001 per screenshot** – 1,000 screenshots for $1. Failed pages are free.

### Use cases

- **Visual monitoring** of your site, competitors or landing pages (schedule the run daily).
- **Archiving and compliance** – PDF or PNG proof of what a page showed and when (`takenAt`).
- **Thumbnails and previews** for directories, link previews and social posts.
- **SEO and QA** – check mobile and desktop layouts across many URLs at once.
- **AI agents** – let an LLM look at a page (works over MCP).

### How to use

1. Paste page URLs.
2. Choose format, device, full page or not, dark mode.
3. Click **Start**. The dataset lists every page with a **link to the image** (and a thumbnail preview in the table).

#### Input example

```json
{
  "urls": ["https://apify.com", "https://en.wikipedia.org/wiki/Web_scraping"],
  "format": "png",
  "fullPage": true,
  "device": "desktop",
  "darkMode": false,
  "hideCookieBanners": true
}
```

#### Output example

```json
{
  "url": "https://apify.com",
  "finalUrl": "https://apify.com/",
  "status": "ok",
  "statusCode": 200,
  "title": "Apify: Marketplace of ready-to-run tools for AI",
  "format": "png",
  "device": "desktop",
  "fullPage": true,
  "width": 1366,
  "height": 9932,
  "bytes": 868386,
  "key": "0001-apify.com.png",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/…/records/0001-apify.com.png?signature=…",
  "takenAt": "2026-10-13T15:20:02+00:00"
}
```

Pages that fail (DNS error, element never appeared…) get `status: "error"` and an `error` message – no charge.

### Pricing

| Event | Price |
|---|---|
| Screenshot or PDF captured | **$0.001** |

Apify platform usage is included. Proxy traffic (only if you turn on the optional proxy) is billed by Apify to your account.

### Use it from code and AI agents

```bash
curl -X POST "https://api.apify.com/v2/acts/kris_fili~website-screenshot-pdf/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://apify.com"], "device": "desktop-hd", "fullPage": false}'
```

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_TOKEN")
run = client.actor("kris_fili/website-screenshot-pdf").call(run_input={"urls": ["https://apify.com"], "format": "pdf"})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["url"], item.get("fileUrl"))
```

**MCP:** `https://mcp.apify.com?tools=kris_fili/website-screenshot-pdf`

Want the **text** of documents instead? See **[Document to Markdown](https://apify.com/kris_fili/document-to-markdown)** and **[Image to Text OCR](https://apify.com/kris_fili/image-to-text-ocr)**.

### FAQ

**Why is a page different from what I see?** Some sites show different content to new visitors, other countries or bots. Try `waitUntil: networkidle`, a longer delay, or the proxy with a country.

**Very long pages?** Full-page captures are limited to 20,000 px height (a warning tells you when a page was cut).

**Pages behind a login?** Not supported.

**Can I schedule it?** Yes – use Apify Schedules for daily or hourly captures.

Questions? Use the **Issues** tab.

# Actor input Schema

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

Web pages to capture. Missing https:// is added automatically.

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

Image format, or PDF (a printable document of the page).

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

Capture the whole scrollable page (up to 20,000 px). Off = only the first screen.

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

Screen size and device type (phones and tablets get the mobile version of the site).

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

Optional – overrides the device width.

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

Optional – overrides the device height (the visible screen; full page still captures everything).

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

Tell the site the visitor prefers a dark theme (works on sites that support it).

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

Hide common cookie consent pop-ups (OneTrust, Cookiebot, Usercentrics, Didomi, Quantcast and many more) without accepting anything.

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

Block requests to common ad and tracking networks – cleaner and faster screenshots.

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

Extra elements to hide, e.g. .chat-widget, #newsletter-popup.

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

Optional – e.g. #main, .product-card, table. The screenshot shows just that element.

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

When the page counts as loaded.

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

Optional – wait until this element is visible before capturing (e.g. a chart or a price).

## `delaySeconds` (type: `number`):

Wait this long after loading – for animations and late content.

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

Before a full-page capture, scroll through the page so lazy-loaded images appear.

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

Lower = smaller files.

## `deviceScaleFactor` (type: `number`):

Optional – 2 for sharp retina-quality images (bigger files).

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

Only for PDF output.

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

Only for PDF output.

## `timeoutSeconds` (type: `integer`):

If a page loads longer, what has loaded is captured (with a warning).

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

More pages at once need more memory for the run (about 512 MB per page).

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

Optional – route traffic through Apify Proxy (e.g. to see a country version of a site). Proxy traffic is billed by Apify to your account.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://en.wikipedia.org/wiki/Web_scraping"
  ],
  "format": "png",
  "fullPage": true,
  "device": "desktop",
  "darkMode": false,
  "hideCookieBanners": true,
  "blockAds": true,
  "waitUntil": "load",
  "delaySeconds": 1,
  "scrollToBottom": true,
  "quality": 80,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "timeoutSeconds": 45,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

```

## MCP server setup

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