# Website Screenshot Pro - Full-page, Mobile, Dark & PDF (`ennobling_spray/website-screenshot-pro`) Actor

Capture clean screenshots or PDFs of any URL in bulk. Full-page, mobile device emulation, dark mode, retina, cookie-banner removal, element capture, lazy-load scrolling. Pay only per captured image.

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

## Pricing

from $2.00 / 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.
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 Pro

Capture clean, full-page screenshots or PDFs of any list of URLs, with the fiddly bits handled for you: cookie banners hidden, lazy-loaded images triggered, mobile devices emulated, dark mode supported, retina output, element-only capture.

You pay **per captured image** (and per PDF if you enable it). Failed pages are reported in the results but are never billed.

### What you get

For every URL, one row in the dataset:

| Field                 | Meaning                                                  |
| --------------------- | -------------------------------------------------------- |
| `screenshotUrl`       | Direct link to the image (PNG or JPEG)                   |
| `pdfUrl`              | Direct link to the PDF, when enabled                     |
| `url`, `finalUrl`     | Requested URL and the URL after redirects                |
| `title`, `statusCode` | Page title and HTTP status                               |
| `width`, `height`     | Image dimensions in pixels                               |
| `ok`, `error`         | Whether the capture succeeded, and why not if it did not |

Images and PDFs are stored in the run's key-value store, so you can download them by link, embed them, or pull them via the API.

### Why this one

- **Cookie banners gone.** Hides OneTrust, Cookiebot, Quantcast, Usercentrics, TrustArc, Didomi, Sourcepoint and generic consent pop-ups before capture. Add your own selectors for chat widgets or sticky bars.
- **Full page that actually loads.** Scrolls through the page first so lazy-loaded images render instead of showing grey boxes.
- **Mobile and tablet emulation.** iPhone 14 / 14 Pro Max, Pixel 7, Galaxy S9+, iPad Pro 11, iPad Mini, with correct viewport, user agent, touch and scale factor.
- **Dark mode, retina, element capture, PDF.** `prefers-color-scheme: dark`, 2x output, capture a single CSS selector, or save an A4/Letter PDF alongside.
- **Fair billing.** Only successful captures are billed. Set a maximum run cost and the actor stops cleanly at the limit.

### Quick start

```json
{
    "urls": [{ "url": "https://apify.com" }, { "url": "https://news.ycombinator.com" }],
    "fullPage": true,
    "format": "png",
    "hideCookieBanners": true
}
```

Mobile dark-mode JPEGs:

```json
{
    "urls": [{ "url": "https://example.com" }],
    "device": "iPhone 14",
    "darkMode": true,
    "format": "jpeg",
    "quality": 85
}
```

Capture just the pricing table and also save a PDF:

```json
{
    "urls": [{ "url": "https://example.com/pricing" }],
    "selector": "#pricing",
    "pdf": true,
    "pdfFormat": "A4"
}
```

### Input options

| Option                             | Default        | Notes                                         |
| ---------------------------------- | -------------- | --------------------------------------------- |
| `urls`                             | required       | List of `{ "url": "..." }` objects            |
| `fullPage`                         | `true`         | Whole page vs viewport only                   |
| `format` / `quality`               | `png` / `80`   | `png` or `jpeg`; quality applies to JPEG      |
| `viewportWidth` / `viewportHeight` | `1280` / `800` | Ignored when a device is selected             |
| `deviceScaleFactor`                | `1`            | `2` for retina                                |
| `device`                           | `none`         | Phone/tablet emulation                        |
| `darkMode`                         | `false`        | Emulates dark colour scheme                   |
| `hideCookieBanners`                | `true`         | Hides common consent pop-ups                  |
| `hideSelectors`                    | `[]`           | Extra CSS selectors to hide                   |
| `selector`                         | -              | Capture only this element                     |
| `waitUntil`                        | `load`         | `load`, `domcontentloaded`, `networkidle`     |
| `waitForSelector`                  | -              | Wait for this selector before capture         |
| `delayMs`                          | `1000`         | Extra wait for animations and late JS         |
| `scrollToBottom`                   | `true`         | Trigger lazy loading before full-page capture |
| `pdf` / `pdfFormat`                | `false` / `A4` | Also save a PDF                               |
| `timeoutSecs`                      | `60`           | Per-page timeout                              |
| `maxConcurrency`                   | `5`            | Parallel pages                                |

### Using the API

```bash
curl -X POST "https://api.apify.com/v2/acts/<username>~website-screenshot-pro/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"urls":[{"url":"https://apify.com"}],"format":"jpeg","quality":80}'
```

The response is the dataset: one object per URL with a `screenshotUrl` you can fetch directly. Works the same from Python, Node, Make, Zapier, n8n or any MCP-capable AI agent.

### Tips

- Pages behind logins or bot protection (Cloudflare challenges, DataDome, PerimeterX, CAPTCHAs) are detected, returned as `ok: false` with the reason, and **never billed**. The actor does not attempt to bypass them.
- For very long pages, full-page captures are capped by the browser at roughly 16,384 px of height; use `selector` or viewport capture for extreme cases.
- `networkidle` gives the most complete render but can wait a long time on sites with constant background traffic; `load` plus `delayMs` is usually the best trade-off.

### Pricing

Pay per event: one event per successful screenshot, one per PDF. No charge for failures. Set a maximum charge per run in the Console or via `maxTotalChargeUsd` on the API to cap spend.

# Actor input Schema

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

One or more page URLs. Each successful capture is one billable screenshot (plus one PDF if enabled). Failed URLs are reported but not billed.

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

Capture the entire scrollable page instead of just the viewport.

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

PNG (lossless) or JPEG (smaller files).

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

1-100. Ignored for PNG.

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

Browser window width. Ignored when a mobile device is selected.

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

Browser window height. For full-page captures this only affects above-the-fold rendering.

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

1 = standard, 2 = retina/HiDPI (sharper, 4x the pixels).

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

Render as a phone or tablet (sets viewport, user agent, touch and scale factor).

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

Ask the page to render with prefers-color-scheme: dark.

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

Hides common cookie/consent pop-ups (OneTrust, Cookiebot, Quantcast, Usercentrics, TrustArc and generic patterns) before capturing.

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

Extra CSS selectors to hide before capture, e.g. chat widgets or sticky headers.

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

If set, only the first element matching this selector is captured instead of the page.

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

Navigation milestone to wait for before the delay starts. Network idle is most complete but slowest.

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

Optional CSS selector that must appear before capture (up to the timeout).

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

Wait this long after the page loads, for animations and late JavaScript.

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

Scroll through the page before a full-page capture so lazy-loaded images render.

## `pdf` (type: `boolean`):

Additionally save the page as a PDF (billed as one PDF event).

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

Paper size used when PDF is enabled.

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

Give up on a URL after this many seconds. Failed URLs are reported in the dataset and are not billed.

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

How many pages to render at once.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://apify.com"
    },
    {
      "url": "https://news.ycombinator.com"
    }
  ],
  "fullPage": true,
  "format": "png",
  "quality": 80,
  "viewportWidth": 1280,
  "viewportHeight": 800,
  "deviceScaleFactor": 1,
  "device": "none",
  "darkMode": false,
  "hideCookieBanners": true,
  "hideSelectors": [],
  "waitUntil": "load",
  "delayMs": 1000,
  "scrollToBottom": true,
  "pdf": false,
  "pdfFormat": "A4",
  "timeoutSecs": 60,
  "maxConcurrency": 5
}
```

# Actor output Schema

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

One row per URL: screenshot and PDF links, final URL, title, HTTP status, image size, success flag and error.

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

The captured image and PDF files, downloadable by link.

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

// Run the Actor and wait for it to finish
const run = await client.actor("ennobling_spray/website-screenshot-pro").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" },
        { "url": "https://news.ycombinator.com" },
    ] }

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

```

## MCP server setup

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

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/53aMPc5mIYxHzX5Nn/builds/WkWPm4TDyTqEZ5T9e/openapi.json
