# Website Screenshot API — Fast Full-Page, Pay on Success (`evanatlasx/webpage-screenshot`) Actor

Fast full-page website screenshots of any URL with Playwright Chromium. Sticky headers and cookie banners handled. PNG, JPEG or WebP. Charged only for successful captures — failures are free. $0.0015 per success.

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

## Pricing

from $1.50 / 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

## Webpage Screenshot — Fast Full-Page, Pay Only on Success

Take **fast, reliable full-page screenshots** of any public URL with Playwright Chromium.

**You pay only for successful screenshots.** Failed navigations, timeouts, and HTTP errors are returned in the dataset with a clear reason and **are not charged**.

### Why this Actor?

| Pain point (common elsewhere) | How we handle it |
|---|---|
| Runs hang / time out on long pages | Short per-page timeout (default 25s), capped lazy-scroll steps |
| Sticky / fixed headers duplicated down the page | Sticky/fixed elements converted to static before full-page capture |
| Cookie banners covering content | Built-in hide list for common consent CMPs + custom selectors |
| Charged even when the shot failed | PPE event `screenshot-captured` only after a successful image is stored |
| Infinite / lazy pages never finish | Segmented scroll with max steps + `maxHeight` truncation flag |

Suggested pricing (when published): **$0.0015 per successful screenshot**. Failures free.

### Features

- Full-page or viewport-only capture
- Formats: **PNG**, **JPEG**, **WebP**
- Configurable viewport, waitUntil, waitForSelector, delay
- Cookie-banner hiding (built-in + your selectors)
- Sticky/fixed header handling for clean full-page shots
- Segmented lazy-load scrolling with hard caps
- `maxHeight` with explicit `truncated: true` in output
- Concurrent captures (1–5)
- Per-URL status: `success` / `failed` with error reason and `durationMs`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `urls` | array | — | Required. http(s) URLs to capture |
| `fullPage` | boolean | `true` | Full scrollable page |
| `viewportWidth` / `viewportHeight` | integer | 1280 / 720 | Viewport size |
| `format` | string | `png` | `png` | `jpeg` | `webp` |
| `quality` | integer | 80 | JPEG/WebP quality |
| `waitUntil` | string | `domcontentloaded` | Navigation wait |
| `waitForSelector` | string | — | Optional CSS wait |
| `delay` | integer | 0 | Extra wait (ms) |
| `hideSelectors` | array | \[] | Extra CSS to hide |
| `hideCookieBanners` | boolean | `true` | Built-in cookie hide |
| `handleStickyHeaders` | boolean | `true` | Sticky/fixed fix |
| `lazyScroll` | boolean | `true` | Trigger lazy images |
| `maxHeight` | integer | 16384 | Height cap (px) |
| `pageTimeoutSecs` | integer | 25 | Per-URL timeout |
| `concurrency` | integer | 2 | Parallel pages |

### Output

One dataset item per URL:

```json
{
  "url": "https://example.com",
  "status": "success",
  "error": null,
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/.../records/screenshot-0001.png",
  "screenshotKey": "screenshot-0001.png",
  "width": 1280,
  "height": 2400,
  "truncated": false,
  "durationMs": 1820,
  "contentType": "image/png",
  "bytes": 245678,
  "statusCode": 200
}
```

Screenshots are stored in the run's **default key-value store**. Failures have `status: "failed"`, an `error` string, and no screenshot.

### Pricing (draft)

- Event: `screenshot-captured` — **$0.0015** per successful screenshot
- Failures: **$0**
- No default Apify Result (`apify-default-dataset-item`) double-charge

Platform compute/storage still applies per your Apify plan.

### Example

```json
{
  "urls": [
    "https://example.com",
    "https://apify.com"
  ],
  "fullPage": true,
  "format": "png",
  "pageTimeoutSecs": 25,
  "concurrency": 2
}
```

### Tips for speed

1. Keep `waitUntil` at `domcontentloaded` unless the page needs full network idle.
2. Use `concurrency: 2` on 1024–2048 MB memory; raise only if stable.
3. Lower `maxHeight` / `maxScrollSteps` for known short pages.
4. Prefer `jpeg`/`webp` with quality ~70–80 when PNG size matters.

### Limitations

- Pages taller than `maxHeight` are truncated (`truncated: true`).
- Bot-protected or login-walled pages may fail (reported, not charged).
- PDF capture is not supported in this version.

### Support

Open an issue on the Actor page or contact the developer via Apify.

# Actor input Schema

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

List of http(s) page URLs to capture. Strings or objects with a "url" field.

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

Capture the full scrollable page (recommended). Sticky/fixed headers are neutralized to avoid duplicated bars.

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

Browser viewport width in pixels.

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

Browser viewport height in pixels.

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

Output image format.

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

Quality 1–100 for jpeg/webp only. Ignored for png.

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

Playwright navigation waitUntil. Prefer domcontentloaded for speed; use networkidle only when needed.

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

Optional CSS selector that must appear before capture.

## `delay` (type: `integer`):

Extra wait after load (and after waitForSelector) before scrolling/capture. Cap 60s.

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

Extra CSS selectors to hide (display:none) before capture. Cookie banners are already covered by built-in list when enabled.

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

Hide common cookie / consent banners before capture.

## `handleStickyHeaders` (type: `boolean`):

Convert sticky/fixed elements to static before full-page capture so they do not repeat down the page.

## `lazyScroll` (type: `boolean`):

Segmented scroll (capped) to trigger lazy-loaded images before the full-page shot.

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

Hard cap on captured page height. Pages taller than this are truncated; output.truncated=true.

## `pageTimeoutSecs` (type: `integer`):

Short default timeout per URL. Failures are returned as status=failed and are NOT charged.

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

Parallel browser contexts (1–5). Keep low on small memory.

## `scrollStep` (type: `integer`):

Pixels per lazy-scroll step.

## `scrollPauseMs` (type: `integer`):

Pause between lazy-scroll steps.

## `maxScrollSteps` (type: `integer`):

Hard cap on lazy-scroll iterations (prevents runaway on infinite pages).

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

1 = standard, 2 = retina-like.

## Actor input object example

```json
{
  "urls": [
    "https://example.com",
    "https://quotes.toscrape.com/"
  ],
  "fullPage": true,
  "viewportWidth": 1280,
  "viewportHeight": 720,
  "format": "png",
  "quality": 80,
  "waitUntil": "domcontentloaded",
  "delay": 0,
  "hideCookieBanners": true,
  "handleStickyHeaders": true,
  "lazyScroll": true,
  "maxHeight": 16384,
  "pageTimeoutSecs": 25,
  "concurrency": 2,
  "scrollStep": 800,
  "scrollPauseMs": 120,
  "maxScrollSteps": 40,
  "deviceScaleFactor": 1
}
```

# Actor output Schema

## `screenshots` (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://example.com",
        "https://quotes.toscrape.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("evanatlasx/webpage-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://example.com",
        "https://quotes.toscrape.com/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("evanatlasx/webpage-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://example.com",
    "https://quotes.toscrape.com/"
  ]
}' |
apify call evanatlasx/webpage-screenshot --silent --output-dataset

```

## MCP server setup

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