# Website Screenshot (`i-scraper/website-screenshot`) Actor

⚡️ Website screenshot: easy-peasy screenshots, PNG & JPG formats

- **URL**: https://apify.com/i-scraper/website-screenshot.md
- **Developed by:** [i-Scraper](https://apify.com/i-scraper) (community)
- **Categories:** Automation, Other
- **Stats:** 66 total users, 9 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

$6.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Website Screenshot - Capture High-Quality Screenshots

Capture professional screenshots of any website automatically. Perfect for website monitoring, documentation, archiving, and visual testing.

### Why Use Website Screenshot?

- **Save Time** - Automate screenshot capture for multiple websites at once
- **High Quality** - Get pixel-perfect PNG or optimized JPEG screenshots
- **Flexible Options** - Full-page capture, custom viewport sizes, or specific elements
- **Fast Performance** - Block unnecessary resources for faster screenshot generation
- **Reliable** - Built on Playwright browser automation for consistent results

### Key Features

📸 **Multiple Format Support** - Choose PNG for lossless quality or JPEG for smaller file sizes

🖼️ **Full-Page Capture** - Screenshot entire scrollable pages, not just visible viewport

⚡ **Smart Resource Blocking** - Speed up captures by blocking images, fonts, or stylesheets

🎯 **Wait for Elements** - Ensure dynamic content loads before capturing

🔧 **Custom Viewports** - Set any desktop, tablet, or mobile screen size

📊 **Batch Processing** - Capture multiple URLs in parallel

### Common Use Cases

🔍 **Website Monitoring** - Track visual changes on competitor websites or your own pages

📚 **Documentation** - Create visual guides and tutorials with screenshots

🗄️ **Archiving** - Preserve website snapshots for legal or compliance purposes

🧪 **Visual Testing** - Generate screenshots across different viewport sizes

📊 **Report Generation** - Add website screenshots to automated reports

### How to Use

#### Quick Start

1. Enter one or more website URLs
2. Click "Start" to run the actor
3. Download screenshots from the dataset results

#### Configuration Options

**URLs** (required) - List of websites to capture

**Viewport Size** - Set browser window dimensions (default: 1920x1080)
- Mobile: 375x667
- Tablet: 768x1024
- Desktop: 1920x1080

**Format** - Choose PNG for quality or JPEG for smaller files

**Full Page** - Capture entire scrollable page instead of just viewport

**Wait Options** - Control when screenshot is taken:
- Wait for page load
- Wait for specific elements to appear
- Add custom delay for animations

**Resource Blocking** - Speed up capture by blocking images, fonts, or other resources

### Output

Each screenshot produces a dataset record with the following fields:

- `url` - The URL that was screenshotted
- `screenshotKey` - Key-value store key for the screenshot file
- `screenshotUrl` - Public URL to access the screenshot (available after run completion)
- `format` - Screenshot image format used
- `viewportWidth` - Browser viewport width used
- `viewportHeight` - Browser viewport height used
- `fullPage` - Whether full page screenshot was captured
- `timestamp` - ISO timestamp when screenshot was taken
- `title` - HTML page title
- `status` - Success or error status
- `error` - Error message if screenshot failed (null on success)

### Example Configurations

#### Basic Screenshot
Capture a simple PNG screenshot with default settings:
```json
{
  "urls": ["https://apify.com"]
}
````

#### Full Page Screenshot

Capture entire scrollable page as high-quality JPEG:

```json
{
  "urls": ["https://example.com"],
  "format": "jpeg",
  "quality": 90,
  "fullPage": true
}
```

#### Mobile View Screenshot

Capture with mobile viewport dimensions:

```json
{
  "urls": ["https://example.com"],
  "viewportWidth": 375,
  "viewportHeight": 667
}
```

#### Fast Screenshot

Speed up capture by blocking unnecessary resources:

```json
{
  "urls": ["https://news.ycombinator.com"],
  "blockResources": ["image", "font"],
  "waitUntil": "domcontentloaded"
}
```

### What You Get

Each screenshot run provides:

- **Dataset** - Metadata for each screenshot including URL, timestamp, page title, and download link
- **Key-Value Store** - Actual screenshot image files in your chosen format
- **Error Details** - Clear error messages for any failed screenshots

Screenshots are accessible via public URLs after the run completes.

### Performance & Reliability

✅ **Fast** - Captures up to 5 screenshots simultaneously

✅ **Reliable** - Automatic retry logic and graceful error handling

✅ **Flexible** - Wait for page load, network idle, or specific elements

✅ **Smart** - Block resources you don't need for faster processing

# Actor input Schema

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

List of website URLs to capture screenshots from

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

Browser viewport width in pixels

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

Browser viewport height in pixels

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

Output image format

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

Capture the entire scrollable page (ignores viewport height)

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

Quality for JPEG format (0-100, only applies to JPEG)

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

When to consider navigation successful

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

Optional CSS selector to wait for before taking screenshot

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

Additional delay in milliseconds before taking screenshot

## `waitForImages` (type: `boolean`):

Auto-scroll page and wait for all images to load (recommended for full-page screenshots with lazy-loading)

## `blockResources` (type: `array`):

Resource types to block (e.g., images, stylesheets, fonts)

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

Select proxies to be used by the browser

## Actor input object example

```json
{
  "urls": [
    "https://apify.com"
  ],
  "viewportWidth": 1920,
  "viewportHeight": 1080,
  "format": "png",
  "fullPage": false,
  "quality": 80,
  "waitUntil": "load",
  "delay": 1000,
  "waitForImages": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `screenshotMetadata` (type: `string`):

Dataset containing metadata for each screenshot: URL, format, viewport dimensions, page title, status, and a link to the screenshot image.

## `screenshotImages` (type: `string`):

Key-value store containing the captured screenshot images in PNG or JPEG 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://apify.com"
    ]
};

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

# Run the Actor and wait for it to finish
run = client.actor("i-scraper/website-screenshot").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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"
  ]
}' |
apify call i-scraper/website-screenshot --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=i-scraper/website-screenshot",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Website Screenshot",
        "description": "⚡️ Website screenshot: easy-peasy screenshots, PNG & JPG formats",
        "version": "0.1",
        "x-build-id": "fNgkYjLbxqpwfb7Qj"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/i-scraper~website-screenshot/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-i-scraper-website-screenshot",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/i-scraper~website-screenshot/runs": {
            "post": {
                "operationId": "runs-sync-i-scraper-website-screenshot",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/i-scraper~website-screenshot/run-sync": {
            "post": {
                "operationId": "run-sync-i-scraper-website-screenshot",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "URLs to Screenshot",
                        "type": "array",
                        "description": "List of website URLs to capture screenshots from",
                        "items": {
                            "type": "string"
                        }
                    },
                    "viewportWidth": {
                        "title": "Viewport Width",
                        "minimum": 320,
                        "maximum": 3840,
                        "type": "integer",
                        "description": "Browser viewport width in pixels",
                        "default": 1920
                    },
                    "viewportHeight": {
                        "title": "Viewport Height",
                        "minimum": 240,
                        "maximum": 2160,
                        "type": "integer",
                        "description": "Browser viewport height in pixels",
                        "default": 1080
                    },
                    "format": {
                        "title": "Screenshot Format",
                        "enum": [
                            "png",
                            "jpeg"
                        ],
                        "type": "string",
                        "description": "Output image format",
                        "default": "png"
                    },
                    "fullPage": {
                        "title": "Full Page Screenshot",
                        "type": "boolean",
                        "description": "Capture the entire scrollable page (ignores viewport height)",
                        "default": false
                    },
                    "quality": {
                        "title": "JPEG Quality",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Quality for JPEG format (0-100, only applies to JPEG)",
                        "default": 80
                    },
                    "waitUntil": {
                        "title": "Wait Until",
                        "enum": [
                            "load",
                            "networkidle"
                        ],
                        "type": "string",
                        "description": "When to consider navigation successful",
                        "default": "load"
                    },
                    "waitForSelector": {
                        "title": "Wait for Selector",
                        "type": "string",
                        "description": "Optional CSS selector to wait for before taking screenshot"
                    },
                    "delay": {
                        "title": "Delay (ms)",
                        "minimum": 0,
                        "maximum": 30000,
                        "type": "integer",
                        "description": "Additional delay in milliseconds before taking screenshot",
                        "default": 1000
                    },
                    "waitForImages": {
                        "title": "Wait for Images",
                        "type": "boolean",
                        "description": "Auto-scroll page and wait for all images to load (recommended for full-page screenshots with lazy-loading)",
                        "default": true
                    },
                    "blockResources": {
                        "title": "Block Resources",
                        "type": "array",
                        "description": "Resource types to block (e.g., images, stylesheets, fonts)",
                        "items": {
                            "type": "string",
                            "enum": [
                                "document",
                                "stylesheet",
                                "image",
                                "media",
                                "font",
                                "script",
                                "texttrack",
                                "xhr",
                                "fetch",
                                "eventsource",
                                "websocket",
                                "manifest",
                                "other"
                            ]
                        }
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Select proxies to be used by the browser",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
