# Website Screenshot Capture (`allscreenshots/website-screenshot-capture`) Actor

30+ device presets, full-page capture, dark mode, cookie banner blocking and batch processing for pixel-perfect website screenshots. Supports iPhone, iPad, Android, Desktop, and up to 100 URLs per run.

- **URL**: https://apify.com/allscreenshots/website-screenshot-capture.md
- **Developed by:** [Allscreenshots](https://apify.com/allscreenshots) (community)
- **Categories:** Developer tools, Automation, Other
- **Features:** Limited permissions
- **Stats:** 13 total users, 1 monthly users, 93.9% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 pixel-perfect screenshots of any website using the [AllScreenshots](https://allscreenshots.com) API. This Actor supports single URLs, bulk processing (up to 100 URLs), 30+ device presets, full-page capture, dark mode, ad blocking, and more.

### Features

- **30+ Device Presets**: iPhone (SE to 15 Pro Max), iPad, Android (Pixel, Galaxy), Desktop, and Social Media sizes
- **Bulk Processing**: Capture up to 100 URLs in a single run
- **Full Page Screenshots**: Capture entire scrollable pages
- **Dark Mode**: Force dark theme on supported websites
- **Ad & Cookie Banner Blocking**: Clean screenshots without distractions
- **Multiple Formats**: PNG, JPEG, WebP, or PDF output
- **Custom CSS Injection**: Hide elements or modify styles
- **Element Selection**: Capture specific page elements

### Quick Start

#### Minimum Configuration

```json
{
    "apiKey": "your-allscreenshots-api-key",
    "urls": ["https://example.com"]
}
```

#### Get Your API Key

1. Visit [AllScreenshots.com](https://allscreenshots.com)
2. Sign up for a free account
3. Copy your API key from the dashboard

### Input Parameters

#### Essential

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `apiKey` | String | Yes | Your AllScreenshots API key |
| `urls` | Array | Yes\* | List of URLs to screenshot |
| `url` | String | Yes\* | Single URL to screenshot |

\*Either `urls` or `url` is required.

#### Device & Viewport

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `devicePreset` | String | - | Device preset (e.g., `iphone-15-pro-max`, `desktop-hd`) |
| `viewportWidth` | Integer | 1920 | Custom viewport width (100-4096) |
| `viewportHeight` | Integer | 1080 | Custom viewport height (100-4096) |
| `deviceScaleFactor` | Integer | 1 | Pixel density (1-3) |

##### Available Device Presets

**Desktop**

- `desktop-hd` (1920x1080)
- `desktop-large` (1440x900)
- `desktop-retina` (2560x1440 @2x)
- `laptop` (1366x768)
- `laptop-retina` (1536x864 @2x)

**iPhone**

- `iphone-se`, `iphone-xr`, `iphone-12`, `iphone-12-pro-max`
- `iphone-14`, `iphone-14-pro-max`, `iphone-15`, `iphone-15-pro-max`

**iPad**

- `ipad`, `ipad-pro-11`, `ipad-pro-12-9`, `ipad-mini`

**Android**

- `pixel-5`, `pixel-7`, `pixel-7-pro`
- `galaxy-s21`, `galaxy-s23`, `galaxy-tab-s7`
- `surface-pro-7`

**Social Media**

- `facebook-og` (1200x630)
- `twitter-card` (1200x675)
- `linkedin-post` (1200x627)
- `instagram-square` (1080x1080)
- `instagram-portrait` (1080x1350)
- `instagram-story` (1080x1920)

#### Output Format

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `format` | String | `png` | Output format: `png`, `jpeg`, `webp`, `pdf` |
| `quality` | Integer | 90 | Image quality 1-100 (JPEG/WebP only) |
| `fullPage` | Boolean | false | Capture entire scrollable page |

#### Page Loading

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `delay` | Integer | 0 | Delay before capture (ms, 0-30000) |
| `waitFor` | String | - | CSS selector to wait for |
| `waitUntil` | String | `load` | Wait event: `load`, `domcontentloaded`, `networkidle` |
| `timeout` | Integer | 30000 | Page load timeout (ms, 1000-60000) |

#### Page Customization

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `darkMode` | Boolean | false | Force dark mode |
| `customCss` | String | - | Custom CSS to inject |
| `hideSelectors` | Array | - | CSS selectors of elements to hide |
| `selector` | String | - | Capture specific element only |

#### Content Blocking

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `blockAds` | Boolean | true | Block advertisements |
| `blockCookieBanners` | Boolean | true | Block cookie consent banners |
| `blockLevel` | String | `normal` | Blocking intensity: `none`, `light`, `normal`, `pro`, `pro_plus`, `ultimate` |

#### Output Options

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `outputToDataset` | Boolean | true | Save metadata to Dataset |
| `outputToKeyValueStore` | Boolean | true | Save images to Key-Value Store |
| `fileNamePattern` | String | `{domain}_{timestamp}.{format}` | File naming pattern |

### Output

#### Dataset

Each screenshot produces a dataset record:

```json
{
    "url": "https://example.com",
    "screenshotKey": "example_com_1705123456789.png",
    "screenshotUrl": "https://api.apify.com/v2/key-value-stores/xxx/records/example_com_1705123456789.png",
    "capturedAt": "2025-01-15T12:30:45.789Z",
    "format": "png",
    "viewport": "1920x1080",
    "devicePreset": null,
    "fullPage": false,
    "fileSize": 245678,
    "success": true,
    "error": null,
    "processingTimeMs": 1523
}
```

#### Key-Value Store

Screenshot images are stored with the key pattern you specify (default: `{domain}_{timestamp}.{format}`).

### Examples

#### Mobile Screenshot

```json
{
    "apiKey": "your-api-key",
    "urls": ["https://example.com"],
    "devicePreset": "iphone-15-pro-max",
    "format": "webp",
    "quality": 85
}
```

#### Full Page with Ad Blocking

```json
{
    "apiKey": "your-api-key",
    "urls": ["https://news-site.com/article"],
    "fullPage": true,
    "blockAds": true,
    "blockCookieBanners": true,
    "blockLevel": "pro"
}
```

#### Dark Mode Screenshots

```json
{
    "apiKey": "your-api-key",
    "urls": ["https://github.com", "https://twitter.com"],
    "darkMode": true,
    "devicePreset": "desktop-hd"
}
```

#### Social Media Images

```json
{
    "apiKey": "your-api-key",
    "url": "https://your-website.com/landing-page",
    "devicePreset": "facebook-og",
    "format": "jpeg",
    "quality": 90
}
```

#### Hide Elements

```json
{
    "apiKey": "your-api-key",
    "urls": ["https://example.com"],
    "hideSelectors": [".cookie-banner", "#popup", ".advertisement"],
    "customCss": "body { background: white !important; }"
}
```

#### Bulk Processing

```json
{
    "apiKey": "your-api-key",
    "urls": [
        "https://example.com",
        "https://google.com",
        "https://github.com",
        "https://twitter.com"
    ],
    "devicePreset": "desktop-hd",
    "format": "png"
}
```

### Pricing

This Actor uses the [AllScreenshots API](https://allscreenshots.com). You need an API key to use it.

- **Free tier**: 100 screenshots/month
- **Paid plans**: Higher limits available

Visit [AllScreenshots.com](https://allscreenshots.com/pricing) for pricing details.

### Support

- **Actor Issues**: [GitHub Issues](https://github.com/allscreenshots/apify-actor/issues)
- **API Documentation**: [AllScreenshots Docs](https://allscreenshots.com/docs)
- **API Support**: support@allscreenshots.com

### License

ISC

# Actor input Schema

## `apiKey` (type: `string`):

Your AllScreenshots API key. Sign up free at https://dashboard.allscreenshots.com/signup to get your key.

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

One or more URLs to capture. Supports up to 100 URLs per run.

## `devicePreset` (type: `string`):

Choose a pre-configured device or leave empty for custom viewport.

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

Capture the entire scrollable page, not just the viewport

## `blockCookieBanners` (type: `boolean`):

Automatically dismiss or hide cookie consent banners

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

Force dark mode/theme if the website supports prefers-color-scheme

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

Custom viewport width in pixels. Ignored when Device Preset is selected.

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

Custom viewport height in pixels. Ignored when Device Preset is selected.

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

Pixel density multiplier. Use 2 for Retina/HiDPI displays.

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

Image format for the screenshot

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

Compression quality 1-100. Only applies to JPEG and WebP formats.

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

Wait this many milliseconds after page load before taking screenshot

## `waitFor` (type: `string`):

CSS selector to wait for before capturing (e.g., '#content', '.loaded')

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

Browser event to wait for before capturing

## `timeout` (type: `integer`):

Maximum time to wait for page to load

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

Inject custom CSS before capturing. Use to hide elements or change styles.

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

CSS selectors of elements to hide before capture

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

CSS selector of element to capture instead of full page (e.g., '#main-content')

## `outputToDataset` (type: `boolean`):

Save screenshot metadata and URLs to the Actor's dataset for export

## `outputToKeyValueStore` (type: `boolean`):

Save screenshot binary files to the Actor's key-value store

## `fileNamePattern` (type: `string`):

Pattern for screenshot file names. Placeholders: {domain}, {timestamp}, {index}, {format}

## `url` (type: `string`):

Single URL to screenshot. Use 'URLs' field above for multiple URLs.

## Actor input object example

```json
{
  "urls": [
    "https://example.com"
  ],
  "devicePreset": "",
  "fullPage": false,
  "blockCookieBanners": true,
  "darkMode": false,
  "viewportWidth": 1920,
  "viewportHeight": 1080,
  "deviceScaleFactor": 1,
  "format": "png",
  "quality": 90,
  "delay": 0,
  "waitUntil": "load",
  "timeout": 30000,
  "outputToDataset": true,
  "outputToKeyValueStore": true,
  "fileNamePattern": "{domain}_{timestamp}.{format}"
}
```

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("allscreenshots/website-screenshot-capture").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"] }

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

```

## MCP server setup

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

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/Sn0KguPRIxRIVzIeY/builds/15sAMOA8ABfaMhVj6/openapi.json
