# Website Screenshot API - Full Page, Element, PDF (`birchline/website-screenshot-api`) Actor

Capture screenshots of any list of public web pages as PNG, JPEG or PDF. Full page or a single element, desktop or phone presets, dark mode, cookie banners hidden. Instant failures are free.

- **URL**: https://apify.com/birchline/website-screenshot-api.md
- **Developed by:** [Birchline Data](https://apify.com/birchline) (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 screenshot captureds

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

Capture screenshots of any list of public web pages as **PNG, JPEG or PDF**. Give it URLs; get back one file per page plus a table with the file link, page title, HTTP status and image size.

You pay per page captured. URLs that fail instantly (bad address, unknown domain) are free.

### What it does

- **Full page or viewport.** The whole scrollable page, or just what a visitor sees first.
- **Single element.** Pass a CSS selector such as `#pricing` to capture only that block.
- **Phone, tablet or desktop.** Use a device preset (`iPhone 15`, `Pixel 7`, `iPad Pro 11`, and about 200 more) or set your own viewport size.
- **Dark mode.** Asks the site for its dark theme.
- **Cleaner captures.** Common cookie banners are hidden, and you can hide any other element (chat widgets, ads) by selector.
- **Lazy-loaded images.** The page is scrolled before a full-page capture so images further down are loaded.
- **PDF.** Prints the page on A4 with backgrounds.
- **Bulk.** Hundreds of URLs in one run, several pages captured at once.

### Input

Only `urls` is required.

```json
{
    "urls": ["https://apify.com", "https://en.wikipedia.org/wiki/Screenshot"],
    "format": "png",
    "fullPage": true
}
```

| Field | Default | Meaning |
| --- | --- | --- |
| `urls` | required | Pages to capture. A missing scheme is treated as `https`. |
| `format` | `png` | `png`, `jpeg` or `pdf`. |
| `fullPage` | `true` | Whole page (`true`) or visible viewport (`false`). |
| `selector` | none | CSS selector of one element to capture instead of the page. |
| `device` | none | Playwright device name, for example `iPhone 15`. Overrides the viewport size. |
| `viewportWidth`, `viewportHeight` | `1366`, `768` | Browser window size in pixels. |
| `colorScheme` | `light` | `light` or `dark`. |
| `waitUntil` | `domcontentloaded` | `domcontentloaded`: the page is captured once its HTML is ready plus up to 8 seconds for the load event, whether or not the event arrives. `load`: wait for the load event for the whole timeout; a page that never finishes is captured as it is and marked `partial`. `networkidle`: slowest, for JavaScript-heavy pages. |
| `delayMs` | `500` | Extra wait before capturing. |
| `scrollToBottom` | `true` | Scroll through the page before a full-page capture. |
| `hideCookieBanners` | `true` | Hide common consent banners with CSS. |
| `hideSelectors` | none | Extra CSS selectors to hide. |
| `jpegQuality` | `80` | 1-100, JPEG only. |
| `maxHeight` | `20000` | Taller pages are cut at this height. |
| `timeoutSecs` | `30` | Per-page load timeout. A page that has drawn something by then is captured as it is and marked `partial`. Each page also has a hard limit of this plus 30 seconds for the whole capture. |
| `maxConcurrency` | `4` | Upper limit on pages captured at once. Also limited to 1 page per GB of run memory. |
| `proxyConfiguration` | none | Optional proxy, for country-specific content. |

#### Capture one element on a phone, in dark mode

```json
{
    "urls": ["https://example.com/pricing"],
    "selector": "#plans",
    "device": "iPhone 15",
    "colorScheme": "dark",
    "format": "jpeg"
}
```

### Output

Files are saved to the run's key-value store. The dataset has one row per URL:

```json
{
    "url": "https://en.wikipedia.org/wiki/Screenshot",
    "status": "ok",
    "finalUrl": "https://en.wikipedia.org/wiki/Screenshot",
    "httpStatus": 200,
    "title": "Screenshot - Wikipedia",
    "format": "png",
    "width": 1280,
    "height": 800,
    "bytes": 102893,
    "key": "0001-en-wikipedia-org-wiki-screenshot.png",
    "fileUrl": "https://api.apify.com/v2/key-value-stores/<store-id>/records/0001-en-wikipedia-org-wiki-screenshot.png",
    "partial": false,
    "error": null,
    "capturedAt": "2026-11-11T18:12:22.976Z",
    "durationMs": 1474,
    "charged": "screenshot"
}
```

A failed URL has `"status": "failed"` and a plain-language `error`, for example `Timed out while loading the page` or `Domain name could not be resolved`. The run continues with the remaining URLs.

A site that turns the visit away (HTTP 401, 403 or 429, or a "checking your browser" page) is reported as failed with a message saying so, for example `The site showed a bot check instead of the page (HTTP 403)`. The Actor does not try to get around such blocks.

`partial` is `true` when the page had not finished loading at the timeout and was captured as it was, or when a very heavy page could not be captured in full in the time available and only the visible part was captured (the `error` field says which). `charged` shows what the row cost you: `screenshot`, `failed-page` or `null` (free).

### Limits to know about

- **Public pages only.** Pages behind a login are not supported, and local or internal addresses are refused.
- **Cookie banners.** Widely used consent tools are hidden. A site with a custom banner may still show it; add its selector to `hideSelectors`.
- **Very tall pages** are cut at `maxHeight` (20,000 px by default) to keep files a usable size.
- **Sites that block automated visitors.** The Actor opens pages like an ordinary desktop Chrome browser (Linux, English), with no tricks to hide that it is automated. Some sites still refuse requests that come from data-center addresses, such as Stack Overflow (a Cloudflare bot check) and sec.gov (HTTP 403, rate limit). Those are reported as failed, and fast refusals are free. The proxy option, with residential addresses, may get through; the Actor never solves CAPTCHAs.
- **Speed and memory.** The Actor runs with 1 GB by default (1 page at a time) and at most 2 GB (2 pages at a time). The platform gives a run CPU in proportion to its memory, so at 1 GB a large, script-heavy page can take 20 to 50 seconds to render and capture, while simple pages take 2 to 5 seconds. A larger memory setting gives the run more CPU and is the way to speed these up.

### Tips

- For pages that draw content with JavaScript after loading, set `waitUntil` to `networkidle` or raise `delayMs`.
- For the fastest bulk runs of simple pages, use `delayMs: 0` and turn `scrollToBottom` off.
- Long, heavy pages are the slowest. Setting `fullPage` to `false`, or a lower `maxHeight`, makes them much quicker.
- Set a maximum cost per run in the run options. The Actor stops cleanly when that limit is reached.

### Cost

| What | Charged |
| --- | --- |
| Page captured (including a partial capture) | the **screenshot** price |
| Page the browser worked on for 5 seconds or more but could not capture (for example it never answered) | the smaller **failed-page** price |
| URL that fails instantly: invalid, private or unknown address, or a site that refuses the visit straight away | free |
| Starting a run | the small **Actor start** price, once per GB of memory |

Current prices are shown on the Pricing tab. Capturing many URLs in one run is cheaper than one run per URL, because the start price is paid once.

### Questions or problems

Open an issue on the Issues tab with the URL and the input you used. Reports with a reproducible URL are fixed fastest.

# Actor input Schema

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

Public web pages to capture. A missing scheme is treated as https. Duplicates are captured once.

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

PNG is lossless, JPEG gives smaller files, PDF prints the page on A4 with backgrounds.

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

On: the whole scrollable page. Off: only the visible viewport. Ignored when an element selector is set.

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

CSS selector of one element to capture instead of the page, for example #pricing or .hero. The first match is used.

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

A Playwright device name such as iPhone 15, Pixel 7 or iPad Pro 11. Sets viewport, pixel density and user agent. Leave empty to use the viewport size below.

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

Browser window width. Ignored when a device preset is set.

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

Browser window height. Ignored when a device preset is set.

## `colorScheme` (type: `string`):

Dark asks the site for its dark theme, if it has one.

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

When the page counts as loaded. Default: the HTML is ready, then up to 8 more seconds for the page load event, and the page is captured either way. Page load event: wait for the load event for the whole timeout, and mark the page partial if it never comes. Network idle is slowest and suits pages that load content with JavaScript.

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

Additional wait before capturing, for animations or late content.

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

Scrolls down the page before a full-page capture so lazy-loaded images appear.

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

Hides widely used consent banners with CSS. Nothing is clicked or accepted. Unusual banners may remain; add their selector below.

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

CSS selectors of elements to hide before capturing, such as chat widgets or ads.

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

Only used for JPEG output.

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

Pages taller than this are cut at this height instead of producing a very large file.

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

How long to wait for a page to load. A page that has drawn something by then is captured as it is and marked partial. A page that shows nothing is reported as failed.

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

Upper limit on pages captured at once. The Actor also limits this to 1 page per GB of run memory.

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

Use a proxy when a site shows different content by country or blocks data-center addresses.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://en.wikipedia.org/wiki/Screenshot"
  ],
  "format": "png",
  "fullPage": true,
  "viewportWidth": 1366,
  "viewportHeight": 768,
  "colorScheme": "light",
  "waitUntil": "domcontentloaded",
  "delayMs": 500,
  "scrollToBottom": true,
  "hideCookieBanners": true,
  "jpegQuality": 80,
  "maxHeight": 20000,
  "timeoutSecs": 30,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `captures` (type: `string`):

Status, file link, page title, HTTP status and image size for every URL.

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

The PNG, JPEG or PDF files, stored under the key given in each dataset row.

# 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/Screenshot"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("birchline/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://en.wikipedia.org/wiki/Screenshot",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("birchline/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://en.wikipedia.org/wiki/Screenshot"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call birchline/website-screenshot-api --silent --output-dataset

```

## MCP server setup

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