# Website Screenshot API: Bulk URL to PNG/JPEG (`liora-tools/website-screenshot`) Actor

Take screenshots of any list of websites with headless Chrome: viewport or full page, desktop or mobile, PNG or JPEG, retina scale, delay and cookie-banner hiding. Each image gets a public URL. Fast, cheap pay-per-screenshot pricing.

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

## Pricing

from $1.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: bulk URL to PNG or JPEG, full page or viewport, desktop or mobile

Capture **screenshots of any list of web pages** with real headless Chrome. Choose viewport or **full-page**,
**desktop or mobile (iPhone)**, PNG or JPEG, retina scale, an extra delay for animations, and automatic
**cookie-banner hiding**. Every screenshot is stored with a **public image URL**, ready for your app, report,
spreadsheet or AI vision model.

### Fixes for the most common screenshot complaints

We read the public reviews and issues of the most-used screenshot Actor on Apify. The recurring complaints were:
full-page mode returning only the part above the fold, sticky headers appearing in the wrong place, loading
screens captured even with a delay, runs that "didn't work and still used up my credits", and slow runs that time
out. What this Actor does:

| Complaint | What we do |
|---|---|
| Full page shows only the first screen | Pages that scroll inside a 100vh box are expanded before the shot, so the whole page is captured. `maxFullPageHeight` cuts very long pages (default 8,000 px) quickly: a 48,000 px Wikipedia article takes about 1 s instead of timing out. Those rows have `fullPageMethod: "tall-viewport"` and `pageHeightPx`. |
| Sticky header ends up at the bottom or repeats | `fixStickyHeaders` (on by default) pins fixed and sticky bars so they appear once, at their place on the page. |
| Loading spinner or blank image boxes in the shot | `waitForImagesAndFonts` (on by default) waits for web fonts and images (up to 5 s near the top, up to 8 s for the whole page in full-page or scroll mode). You can also use `waitForSelector`, `delayMs` and `waitUntil`. |
| Failed or blank result still charged | Only successful screenshots are charged. A one-colour (blank) image is reported as an error and is free (`blankIsFailure`). |
| Emojis drawn as boxes | Colour-emoji and CJK fonts are installed in the image. |
| Need only the top of the page or a set height | Set `viewportHeight` with `fullPage` off for an above-the-fold preview, or use `maxFullPageHeight` to cut a full-page shot. |
| Slow runs and timeouts | Lightweight Chromium with a shared browser, media blocked, optional ad and tracker blocking, and one free retry on navigation timeout (`maxRetries`). |

### Use cases

- Visual monitoring of competitors' homepages and pricing pages (schedule daily runs)
- Thumbnails and link previews for directories, CRMs and bookmarking apps
- QA and visual regression snapshots across desktop and mobile
- Feed page images to GPT-4o, Claude or Gemini vision for analysis
- Archiving and compliance evidence of how a page looked on a date

### Input

```json
{
  "urls": ["https://apify.com", "https://www.python.org"],
  "device": "desktop",
  "fullPage": true,
  "format": "jpeg",
  "jpegQuality": 80,
  "delayMs": 500
}
```

### New options (v0.2)

| Option | What it does |
|---|---|
| `format: pdf` | Vector PDF with selectable text (screen styles) |
| `selector` | Screenshot one element (`#pricing`, `.chart`, `header`) |
| `hideSelectors`, `customCss` | Hide chat widgets/popups, inject your own CSS |
| `waitForSelector`, `scrollToBottom` | Wait for an element; scroll once so lazy images load |
| `darkMode`, `locale`, `timezoneId` | prefers-color-scheme: dark, browser language and time zone |
| `blockAds` | Blocks ~30 common ad/analytics hosts (faster, cleaner) |
| `transparentBackground` | PNG without the white background |
| `compareWithPrevious`, `changeThresholdPercent` | Visual change monitor: `diffPercent`, `changed`, and the previous image when it changed |

Not included on purpose: "stealth" or anti-bot evasion, CAPTCHA solving, proxies to get around blocks, and logging in with your session cookies. Cookie banners are hidden with CSS, never accepted.

### Output

```json
{
  "url": "https://apify.com", "status": "ok", "statusCode": 200, "title": "Apify: Full-stack web scraping…",
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/…/records/apify.com-d0734ca4",
  "format": "png", "width": 1280, "fullPage": false, "bytes": 136903, "durationMs": 1519
}
```

Images are saved in the run's key-value store. `screenshotUrl` downloads the file directly.

### Pricing (pay per event)

| Event | Price |
|---|---|
| `screenshot`: each successful screenshot | **$0.001** ($1 per 1,000) |
| `full-page`: add-on, only when `fullPage` is on | $0.0005 |
| Run start (`apify-actor-start`, per GB of memory, default 1 GB) | $0.001 |

Example: 100 viewport screenshots cost about $0.10 + $0.001.

Failed, timed-out and robots.txt-skipped pages are **free**.

- With the free Apify screenshot Actor you pay platform compute yourself (memory × time). Here the price is fixed
  and predictable.

### Notes

- Cookie banners are hidden with CSS only. Nothing is clicked or accepted on your behalf.
- No captcha solving and no login. Pages behind bot protection may show the protection page.
- Only public `http(s)` URLs. Private and local network addresses are refused.

# Actor input Schema

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

Pages to capture.

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

Mobile uses an iPhone user agent and touch viewport.

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

Capture the whole scrollable page instead of just the viewport.

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

JPEG files are much smaller.

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

Only for JPEG.

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

Default 1280 (desktop) or 390 (mobile).

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

Default 800 (desktop) or 844 (mobile).

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

2 = retina.

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

Capture just one element, e.g. #pricing, .chart, header.

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

CSS selectors to hide before capturing (chat widgets, popups, ads).

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

Wait until this CSS selector appears before capturing.

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

Scrolls the page once (up to 30,000 px) so lazy-loaded images appear, then returns to the top.

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

Emulates prefers-color-scheme: dark.

## `blockAds` (type: `boolean`):

Blocks requests to ~30 common ad/analytics hosts. Cleaner and faster screenshots.

## `customCss` (type: `string`):

CSS injected before capturing.

## `transparentBackground` (type: `boolean`):

Omit the default white background.

## `locale` (type: `string`):

e.g. de-DE, fr-FR, ja-JP. Sets navigator.language and Accept-Language.

## `timezoneId` (type: `string`):

IANA zone, e.g. Europe/Berlin.

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

When the page counts as loaded.

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

Wait after load, for example for animations.

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

Hides common consent pop-ups with CSS. Nothing is clicked or accepted.

## `maxFullPageHeight` (type: `integer`):

Very long pages are cut at this height.

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

Pages that take longer fail (free).

## `waitForImagesAndFonts` (type: `boolean`):

Before the shot, wait until web fonts and images have loaded (up to 5 s for images near the top, up to 8 s for the whole page in full-page or scroll mode), so you do not get loading spinners or blank image boxes.

## `fixStickyHeaders` (type: `boolean`):

For full-page shots, fixed and sticky headers, chat bubbles and bars are pinned in place so they appear once instead of floating over the middle or bottom of the image. Pages that scroll inside an inner box are expanded so the full page is captured.

## `blankIsFailure` (type: `boolean`):

If the image is one flat colour (white or black page, unrendered app), it is reported as an error and not charged.

## `maxRetries` (type: `integer`):

Retry page loading when it times out. Retries are not charged.

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

Skip pages the site disallows for crawlers (free).

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

Higher values need more memory.

## `compareWithPrevious` (type: `boolean`):

Compares each screenshot with the one from the previous run (same URL and settings) and reports diffPercent and changed. The old image is saved when something changed.

## `changeThresholdPercent` (type: `string`):

A screenshot counts as changed when at least this share of pixels differs.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://www.python.org"
  ],
  "device": "desktop",
  "fullPage": false,
  "format": "png",
  "jpegQuality": 80,
  "deviceScaleFactor": 1,
  "selector": "",
  "hideSelectors": [],
  "waitForSelector": "",
  "scrollToBottom": false,
  "darkMode": false,
  "blockAds": false,
  "customCss": "",
  "transparentBackground": false,
  "locale": "en-US",
  "timezoneId": "",
  "waitUntil": "load",
  "delayMs": 0,
  "hideCookieBanners": true,
  "maxFullPageHeight": 8000,
  "timeoutSecs": 30,
  "waitForImagesAndFonts": true,
  "fixStickyHeaders": true,
  "blankIsFailure": true,
  "maxRetries": 1,
  "respectRobotsTxt": true,
  "maxConcurrency": 3,
  "compareWithPrevious": false,
  "changeThresholdPercent": "0.5"
}
```

# Actor output Schema

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

Screenshot rows with links to the image files.

# 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://www.python.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("liora-tools/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://apify.com",
        "https://www.python.org",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("liora-tools/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://apify.com",
    "https://www.python.org"
  ]
}' |
apify call liora-tools/website-screenshot --silent --output-dataset

```

## MCP server setup

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