# Website Screenshot & URL/HTML to PDF: Full Page, Mobile, Bulk (`ai_admin/website-screenshot`) Actor

Capture full-page or viewport screenshots of websites (PNG, JPEG, WebP) and save web pages or raw HTML as PDF. Desktop, laptop, tablet and phone devices, dark mode, element screenshots, cookie banners hidden, lazy images loaded.

- **URL**: https://apify.com/ai_admin/website-screenshot.md
- **Developed by:** [Andriy Kuzmenko](https://apify.com/ai_admin) (community)
- **Categories:** Developer tools, Automation, SEO tools
- **Security:** 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 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 & URL/HTML to PDF: Full Page, Mobile, Bulk

Capture any web page as an image or a PDF — the whole page or just the first screen, on desktop or a phone — in bulk,
with a download link for each file.

- **Screenshots:** PNG, JPEG or WebP; full page (up to 20,000 px) or viewport; a single element by CSS selector.
- **PDF:** save web pages or your own **raw HTML** (invoices, reports, templates) as PDF — A4, Letter, Legal, A3, A5,
  portrait or landscape, print or screen styles.
- **Devices:** desktop 1920×1080, laptop 1366×768, iPad Pro 11, iPhone 15 Pro, Galaxy S24 (real pixel density), or a
  custom viewport; **dark mode**.
- **Clean captures:** floating cookie and consent banners are hidden, lazy-loaded images are loaded by scrolling, and
  you can inject your own CSS (e.g. hide chat widgets).
- **Safe:** requests to private network addresses are blocked.

### Why this Actor

| | This Actor | Typical alternatives |
|---|---|---|
| **Devices** | Desktop, laptop, iPad, iPhone and Android at real pixel density, dark mode | Often desktop only |
| **PDF** | Web pages **and your own raw HTML** (invoices, reports) to PDF — A4/Letter, margins, print or screen styles | Often screenshot only, or a separate PDF tool |
| **Clean captures** | Cookie banners hidden, lazy images loaded, custom CSS, element screenshots | Banners and empty placeholders in the shot |
| **Safety** | Requests to private networks blocked | — |
| **Price** | **$4 per 1,000** captures | $0.83–20 per 1,000 |

### Input

```json
{
  "urls": [{ "url": "https://apify.com" }, { "url": "example.com" }],
  "format": "png",
  "device": "mobile",
  "fullPage": true,
  "hideCookieBanners": true,
  "waitUntil": "load",
  "delayMs": 0
}
```

HTML to PDF:

```json
{
  "html": "<h1>Invoice #42</h1><p>Total: €120</p>",
  "format": "pdf",
  "pdfFormat": "A4",
  "pdfMargin": "15mm"
}
```

| Field | Meaning |
|---|---|
| `urls` | Pages to capture (`https://` is added when missing) |
| `html` | Raw HTML to render (optional) |
| `format` | `png`, `jpeg`, `webp` or `pdf` |
| `device` | `desktop`, `laptop`, `tablet`, `mobile`, `android` |
| `fullPage` | Whole page or just the first screen |
| `selector` | Capture one element, e.g. `#pricing` |
| `hideCookieBanners`, `scrollToBottom`, `css` | Clean-up before capturing |
| `waitUntil`, `delayMs`, `timeoutSecs` | When to capture |
| `viewportWidth`, `viewportHeight`, `darkMode`, `quality` | Look of the capture |
| `pdfFormat`, `pdfLandscape`, `pdfScreenMedia`, `pdfMargin` | PDF options |

### Output

```json
{
  "url": "https://apify.com",
  "finalUrl": "https://apify.com/",
  "status": 200,
  "title": "Apify: Full-stack web scraping and data extraction platform",
  "format": "png",
  "device": "mobile",
  "key": "0001-apify.com.png",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/.../records/0001-apify.com.png",
  "width": 1179,
  "height": 14820,
  "bannersHidden": 1,
  "blockedRequests": 0
}
```

Pages that answer with an HTTP error (e.g. 404) are captured as they look, with `status` showing the code. A page that
does not load at all gets an `error` field instead and is **not charged**.

### Pricing

| Event | Price | What counts |
|---|---|---|
| `screenshot` | **$4 per 1,000** | one screenshot or PDF |

Plus Apify's standard start fee of $0.05 per 1,000 runs. The run stops before it would exceed your maximum charge per run.

### Related Actors

- [Office to PDF & PDF/A](https://apify.com/ai_admin/office-to-pdf) — Word, Excel, PowerPoint, HTML files → PDF/PDF-A
- [Document to Markdown for AI](https://apify.com/ai_admin/document-to-markdown) — PDFs, scans and Office files → Markdown
- [Image to Text OCR](https://apify.com/ai_admin/image-to-text-ocr) — read the text in screenshots

Open source: [github.com/AndriyVK/-apify-document-tools](https://github.com/AndriyVK/-apify-document-tools)

### Use with AI agents and code

- **MCP (Claude, Cursor, VS Code, any MCP client):** add `https://mcp.apify.com?tools=ai_admin/website-screenshot` as an MCP server —
  the agent gets one tool with this Actor's input schema and pays per use through your Apify account.
- **One HTTP call that returns the results:**

```bash
curl -X POST "https://api.apify.com/v2/acts/ai_admin~website-screenshot/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": [{"url": "https://apify.com"}], "format": "png", "device": "desktop", "fullPage": true}'
```

### Limits

- Pages behind a login, CAPTCHA or strong bot protection are captured as the visitor sees them (e.g. a login form).
- Full-page screenshots are capped at 20,000 px height; longer pages are cut.
- Some sites block data-centre IP addresses; such pages may load with an error or a block page.

# Actor input Schema

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

Web pages to capture. "example.com" without https:// works too.

## `html` (type: `string`):

HTML to render instead of (or in addition to) URLs — e.g. an invoice or report template to turn into PDF. External images and styles referenced by absolute https URLs are loaded.

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

png, jpeg, webp — screenshot; pdf — printable PDF of the page.

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

desktop 1920×1080, laptop 1366×768, tablet iPad Pro 11, mobile iPhone 15 Pro, android Galaxy S24 (phones and tablets at their real pixel density).

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

Capture the whole scrollable page (up to 20,000 px high), not just the first screen.

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

Capture only this element, e.g. #pricing or .chart. Empty = whole page.

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

Hide floating cookie and consent banners (OneTrust, Cookiebot, Didomi and similar).

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

Scroll through the page before capturing so lazy-loaded images appear.

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

load = page and images loaded (default); networkidle = no network activity for 0.5 s (single-page apps); domcontentloaded = fastest.

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

Wait this long before capturing (animations, charts).

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

Custom width in pixels; 0 = device default.

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

Custom height in pixels; 0 = device default.

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

Ask the site for its dark theme (prefers-color-scheme: dark).

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

10 (smallest) to 100 (best).

## `css` (type: `string`):

Injected before capturing, e.g. to hide chat widgets: .intercom-launcher{display:none!important}

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

For PDF output.

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

For PDF output.

## `pdfScreenMedia` (type: `boolean`):

Off = the site's print styles (clean, no menus); on = exactly as on screen.

## `pdfMargin` (type: `string`):

e.g. 0, 10mm, 0.5in

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

Give up on a page that does not load in this time (not charged).

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://apify.com"
    }
  ],
  "format": "png",
  "device": "desktop",
  "fullPage": true,
  "hideCookieBanners": true,
  "scrollToBottom": true,
  "waitUntil": "load",
  "delayMs": 0,
  "viewportWidth": 0,
  "viewportHeight": 0,
  "darkMode": false,
  "quality": 85,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfScreenMedia": false,
  "pdfMargin": "10mm",
  "timeoutSecs": 60
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items: url, status, title, fileUrl or error.

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

All screenshots and PDFs in the run's key-value store.

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

// Run the Actor and wait for it to finish
const run = await client.actor("ai_admin/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": [{ "url": "https://apify.com" }] }

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

```

## MCP server setup

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