# Website Screenshot API: Bulk PNG & JPEG, Full Page (`madpai/website-screenshot`) Actor

Paste a list of URLs and get a screenshot of each one, full page or first screen, at desktop, HD, tablet or mobile size, as PNG or JPEG. Each result includes the page title, status code and final URL. Cookie banners are hidden without accepting anything. Failed pages aren't charged.

- **URL**: https://apify.com/madpai/website-screenshot.md
- **Developed by:** [William Schultz](https://apify.com/madpai) (community)
- **Categories:** Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 84.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.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 (v0.1, local proof)

Playwright + Chrome. Input `urls`; options for viewport (desktop, desktop-hd, tablet, mobile), pixel density `deviceScaleFactor` (1–3, default 1), full page with a max height, PNG/JPEG, wait mode, delay, and visually hiding cookie banners (nothing is clicked).
Output: one dataset item per URL with `screenshotUrl` (public KV record link on the platform), status, title, size. PPE event `screenshot`, charged only for successful captures. A run always saves at least one item: URLs beyond your maximum charge get a free `charge-limit` item, and an input with no usable URL gets a free `invalid-input` item (the run still succeeds). `OUTPUT_SUMMARY` in KV.
Local: `CHROME_PATH=/usr/bin/google-chrome apify run --purge`. Tests: `npm test`. Docker image: apify/actor-node-playwright-chrome.

Pixel density: `deviceScaleFactor` 1 (default) gives images in CSS pixels (mobile 390 px wide). 2 or 3 gives retina-style images (mobile at 3 = 1170 px wide). At 2/3 the Actor captures one page at a time and cuts full-page images at 16384 image pixels (Chrome's limit). Measured peak memory (3 URLs, local, PSS of Node + Chrome): typical sites, mobile full page: 715 MB at 1x, 1055 MB at 3x; tablet full page at 2x 752 MB. 2x/3x full-page captures of very heavy pages may need more memory.

Memory and media: by default (`blockMedia: true`) audio and video are not downloaded, and Chrome runs all frames of a page in one renderer process (`--renderer-process-limit=1`, no per-site iframe processes); each page is closed right after its capture. If a page times out (for example a script that never stops running), the next page starts in a fresh browser so it isn't blocked. A still image never shows audio or video, but video players then show their poster, a placeholder or an error panel instead of a video frame. Default run memory is 2048 MB (ws-8: at 1024 MB a batch of heavy news pages reached 96%). Measured peak memory (local, PSS of Node + Chrome, desktop, first screen, 1x, maxConcurrency 1, 2048 MB, 2026-11-02): edition.cnn.com about 740 MB (741 MB; QA 728–741 MB), CNN with `blockMedia` off 906 MB; CNN + NBC News + BBC 957–1071 MB (47–52%), the same with `blockMedia` off 1032–1129 MB (50–55%); 8 heavy news pages (CNN, NBC, BBC, Fox, ABC, CBS, CNBC, NY Post, local PSS, with browser recycling): 1490–1601 MB (73–78%) by default, 1555–1670 MB (76–82%) with `blockMedia` off. Memory grows page by page within one browser (about 150–250 MB per heavy page), so the browser is restarted, with the same settings, when the Actor and Chrome together reach 60% of the run memory or after 3 pages, whichever comes first (`RECYCLE_MEMORY_FRACTION`, `RECYCLE_AFTER_PAGES` in `src/recycle.ts`). This is a local measurement; the first cloud run confirms it. Heavy, media-rich pages (large news sites) take longer per screenshot (about 6–21 s locally vs about 2 s for light pages), so batches of them take longer to finish; the price per screenshot is the same.

Politeness: about 1 request per second per host (slower when robots.txt sets a Crawl-delay), robots.txt always on unless you confirm you own the site. A 429 or 503 holds the host for its Retry-After (max 30 s), and after 3 consecutive 429s the host gets no more requests; while a host is held or paused, the browser sends it nothing at all (no sub-resources, no favicon). Chrome's automatic `/favicon.ico` request is never sent.

Example output item:

```json
{
  "url": "https://crawlee.dev/",
  "finalUrl": "https://crawlee.dev/",
  "statusCode": 200,
  "title": "Crawlee · Build reliable crawlers. Fast.",
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/0001-crawlee-dev.png",
  "screenshotKey": "0001-crawlee-dev.png",
  "format": "png",
  "viewport": "desktop",
  "deviceScaleFactor": 1,
  "width": 1366,
  "height": 768,
  "fullPage": false,
  "truncatedAtMaxHeight": false,
  "bytes": 82309,
  "error": null,
  "errorCode": null,
  "capturedAt": "2026-11-02T19:31:59.294Z"
}
```

`width` and `height` are CSS pixels; the image is `width × deviceScaleFactor` by `height × deviceScaleFactor` pixels.

Every input URL gets one item. Not captured URLs have `screenshotUrl: null`, are free, and say why in `error` / `errorCode`. With a run timeout of 330 seconds or less (including the default 300 seconds) no new page starts after 240 seconds; with a longer timeout, 45 seconds before it (no limit when no timeout is known). URLs not reached in time, pages whose loading the time limit cut short, and URLs whose robots.txt couldn't be fetched in time get `errorCode: "run-time-limit"`.

# Changelog

This Actor's version history is a separate document: https://apify.com/madpai/website-screenshot/changelog.md

# Actor input Schema

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

Public pages or domains to screenshot, one capture per unique URL. Social networks, people-search, dating and adult sites are always blocked, as are sites on our takedown list; blocked URLs are listed with a reason and never charged.

## `viewport` (type: `string`):

Screen size to render at.

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

1 = CSS pixels (default). 2 or 3 = retina-style images (e.g. mobile at 3 gives a 1170 px wide image). With 2 or 3, pages are captured one at a time and full-page captures are cut at 16384 image pixels. 2x/3x full-page captures of very heavy pages may need more memory.

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

Capture the whole scrollable page instead of just the first screen.

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

Full-page captures are cut at this height to keep files small.

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

Output image format.

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

1–100, JPEG only.

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

When the page counts as loaded.

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

Wait after load, for animations or lazy content.

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

Visually hide common consent pop-ups (nothing is clicked or accepted).

## `blockMedia` (type: `boolean`):

Don't download audio or video (a still image never shows them). Video players then show their poster, a placeholder or an error panel instead of a video frame. Turning this off needs more memory on video-heavy pages such as news front pages.

## `respectRobotsTxt` (type: `boolean`):

Skip URLs disallowed by robots.txt. Can only be turned off together with "I own these sites".

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

Pages captured in parallel. Keep 1 with the default 2048 MB memory; raise it only with more memory.

## `ownSiteConfirmed` (type: `boolean`):

Only for your own sites; allows turning off robots.txt.

## Actor input object example

```json
{
  "urls": [
    "https://crawlee.dev"
  ],
  "viewport": "desktop",
  "deviceScaleFactor": 1,
  "fullPage": false,
  "maxHeight": 8000,
  "format": "png",
  "jpegQuality": 80,
  "waitUntil": "load",
  "delayMs": 500,
  "hideCookieBanners": true,
  "blockMedia": true,
  "respectRobotsTxt": true,
  "maxConcurrency": 1,
  "ownSiteConfirmed": false
}
```

# Actor output Schema

## `screenshots` (type: `string`):

Dataset with one item per URL: url, finalUrl, statusCode, title, screenshotUrl (link to the stored image), screenshotKey, format, viewport, deviceScaleFactor, width, height (CSS pixels), fullPage, truncatedAtMaxHeight, bytes, error and errorCode (null on success; blocked, blocked-private, robots, http-error or failed, never charged), capturedAt.

## `summary` (type: `string`):

JSON counts for the run: itemsPushed, screenshots, failed, httpErrors, blocked, blockedPrivate, skippedRobots, skippedForBudget, finishedAt.

# 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://crawlee.dev"
    ]
};

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

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

```

## MCP server setup

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