# Website Screenshot API: Full Page PNG, JPEG & PDF in Bulk (`kleb-data/website-screenshot-api`) Actor

Capture full-page or viewport screenshots of any list of URLs as PNG, JPEG or PDF. Options for viewport, mobile, dark mode, element selector and hiding cookie banners. Files go to the key-value store, one dataset row per URL with a direct link.

- **URL**: https://apify.com/kleb-data/website-screenshot-api.md
- **Developed by:** [Kleb Data](https://apify.com/kleb-data) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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.

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 API: Full Page PNG, JPEG & PDF in Bulk

Give it a list of URLs and get one screenshot per page as PNG, JPEG or PDF. Each page is opened in a real Chromium browser, captured full-page or at viewport size, saved to the run's key-value store and listed in the dataset with a direct link to the file.

### What you can do with it

- Visual monitoring: capture the same pages on a schedule and compare them over time
- Thumbnails and link previews for directories, dashboards and reports
- Archive pages as PDF or full-page images
- Give an AI agent eyes on a page: pass the image URL to a vision model
- Capture desktop, mobile and dark-mode versions, or only one element (**Element selector**)

### Input

| Field | Meaning |
|---|---|
| `urls` | Pages to capture; `https://` is added when the scheme is missing |
| `format` | `png` (default), `jpeg` or `pdf` (A4 pages with backgrounds) |
| `fullPage` | Whole scrollable page (default on) or only the viewport |
| `viewportWidth`, `viewportHeight` | Browser window size, default 1280 x 800 |
| `deviceScaleFactor` | Pixel density 1 to 3 (default 1) |
| `mobile` | Phone emulation: 390 x 844, scale 3, mobile layout and touch; overrides the viewport and scale fields. The browser's own user agent is kept |
| `darkMode` | Request the page's dark color scheme |
| `waitUntil` | `load` (default), `domcontentloaded` or `networkidle` |
| `delayMs` | Extra wait after load, default 1000, max 15000 |
| `selector` | CSS selector; only the first matching element is captured |
| `hideSelectors` | CSS selectors of elements to hide before capture, such as cookie banners |
| `jpegQuality` | 1 to 100, default 80 |
| `maxPageHeight` | Full-page captures are clipped to this height in CSS pixels, default 20000 |
| `timeoutSecs` | Page load timeout, default 45 |
| `concurrency` | Pages captured in parallel, default 3, max 8 |

### Output (one item per URL)

```json
{
  "url": "https://apify.com/",
  "finalUrl": "https://apify.com/",
  "status": 200,
  "title": "Apify: Full-stack web scraping and data extraction platform",
  "format": "png",
  "screenshotKey": "001-apify.com.png",
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/AbCdEfGhIjKlMnOpQ/records/001-apify.com.png",
  "width": 1280,
  "height": 9412,
  "bytes": 1843201,
  "loadTimeMs": 1630,
  "capturedAt": "2026-11-20T09:15:42.118Z",
  "error": null
}
```

### Notes

- Files are stored in the run's default key-value store under `screenshotKey` and linked per row in `screenshotUrl`. They are kept as long as the run's storage is kept.
- `width` and `height` are the captured area in CSS pixels; the image has `deviceScaleFactor` times as many pixels on each side. For PDF they are the page's document size, and `fullPage` and `selector` do not apply.
- `status` is the HTTP status of the main response. An error page (404, 500) is still captured and returned with its status.
- URLs that fail (timeout, DNS error, selector not found) are returned with a short `error` message and no file.
- Pages that block automated browsers may return an error or show a challenge page. The actor uses a plain browser: no proxy, no CAPTCHA solving, no fingerprint changes.
- Private network addresses (localhost, 127.x, 10.x, 172.16-31.x, 192.168.x, 169.254.x, `::1` and similar) are refused, including when a public page redirects to one.
- 2 GB of memory is recommended. Lower `concurrency` for long pages or scale factors above 1.

### Pricing

Pay per event: $5.00 per 1,000 screenshots, platform usage included.

# Actor input Schema

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

Pages to capture. 'https://' is added when the scheme is missing. Private network addresses (localhost, 10.x, 192.168.x and similar) are refused.

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

Output file type. PDF is printed on A4 pages with backgrounds.

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

Capture the whole scrollable page. Turn off to capture only the viewport. Ignored for PDF.

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

Browser window width in CSS pixels.

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

Browser window height in CSS pixels.

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

Pixel density. 2 gives retina-sharp images at four times the pixel count.

## `mobile` (type: `boolean`):

Emulate a phone: 390x844 viewport, scale factor 3, mobile layout and touch. Overrides the viewport and scale fields. The browser's own user agent is kept.

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

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

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

Page event to wait for before capturing. 'networkidle' is slowest and suits pages that load content with JavaScript.

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

Extra wait after the page has loaded, for animations and late content.

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

Optional CSS selector. Only the first matching element is captured. Ignored for PDF.

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

CSS selectors of elements to hide before capturing, for example cookie banners or chat widgets.

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

1 to 100. Used only for JPEG.

## `maxPageHeight` (type: `integer`):

Full-page captures of longer pages are clipped to this height in CSS pixels.

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

Maximum time for a page to load.

## `concurrency` (type: `integer`):

Pages captured in parallel.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://news.ycombinator.com"
  ],
  "format": "png",
  "fullPage": true,
  "viewportWidth": 1280,
  "viewportHeight": 800,
  "deviceScaleFactor": 1,
  "mobile": false,
  "darkMode": false,
  "waitUntil": "load",
  "delayMs": 1000,
  "jpegQuality": 80,
  "maxPageHeight": 20000,
  "timeoutSecs": 45,
  "concurrency": 3
}
```

# Actor output Schema

## `results` (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://news.ycombinator.com"
    ]
};

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

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

```

## MCP server setup

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

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/1hwAoiyGnZSTEBRox/builds/NKA3xGbf9phc4aYlK/openapi.json
