# Website Screenshot API: Full Page, Mobile & Desktop (`bite-sized-insights/website-screenshot-api`) Actor

Turn web page URLs or your own HTML into PNG or JPEG images with public links. Choose device, dark mode, full page or a single element, hide cookie banners, and wait for dynamic content. Failed captures are not charged.

- **URL**: https://apify.com/bite-sized-insights/website-screenshot-api.md
- **Developed by:** [bite-sized-insights](https://apify.com/bite-sized-insights) (community)
- **Categories:** Developer tools, Automation, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 56.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 row returneds

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

Turn any public web page, or HTML you generate yourself, into a PNG or JPEG image. Give it a list of URLs or HTML documents; every one comes back as an image file with a public link, its pixel size and its file size. Pick a device, capture the whole page or a single element, switch to dark mode and hide cookie banners.

### What this actor does

- **Captures web pages and raw HTML.** Paste URLs, pass your own HTML (email previews, social cards, reports), or both in the same run.
- **Real page rendering.** Pages are loaded the way a visitor sees them, including content that appears after the page opens, so modern sites come out complete instead of blank.
- **Device presets.** Desktop, laptop, tablet and phone, each with a matching window size and pixel density. Phones and tablets also get touch and mobile page layout. Override the width, height or pixel density (1x to 4x) for any custom size.
- **Full page or first screen.** Capture only what is visible on load, or the whole scrollable page.
- **Single elements.** Give a CSS selector and get just that element: a pricing table, a chart, a product card.
- **Light and dark mode.** Sites that follow the visitor's color preference switch with one setting.
- **PNG or JPEG.** PNG for lossless captures and transparent backgrounds, JPEG with adjustable quality for small files.
- **Page clean-up.** Hide elements such as cookie banners or chat widgets, add your own CSS, and freeze animations for steady results.
- **Wait conditions.** Wait for the page to finish loading, for the network to go quiet, for a specific element to appear, or for a fixed extra moment. Each screenshot has its own time limit.
- **Public image links.** Each image is stored with the run and linked in the results, ready to download or to hand to the next step of your workflow.
- **Runs sources in parallel** and delivers results as each one finishes.

### Quick start

```json
{
    "urls": ["https://example.com"]
}
```

Click **Start**. Each image appears in the results as soon as it is ready, with a link in the `image_url` column.

#### Full-page phone screenshot in dark mode

```json
{
    "urls": ["https://example.com"],
    "devicePreset": "mobile",
    "fullPage": true,
    "colorScheme": "dark",
    "format": "jpeg",
    "quality": 85,
    "hideSelectors": [".cookie-banner", "#chat-widget"]
}
```

#### Capture one element

```json
{
    "urls": ["https://example.com/pricing"],
    "selector": "#plans",
    "deviceScaleFactor": 2,
    "waitForSelector": "#plans"
}
```

#### Capture your own HTML

```json
{
    "urls": [],
    "htmlDocuments": ["<html><body style=\"font-family:sans-serif\"><h1>Launch day</h1></body></html>"],
    "viewportWidth": 1200,
    "viewportHeight": 630
}
```

The URL list has an example prefilled; empty it (as above) when you only want to capture HTML.

### Input parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `urls` | Array\[String] | `["https://example.com"]` | Public web pages to capture, up to 100. Domain or URL. |
| `htmlDocuments` | Array\[String] | `[]` | Complete HTML documents, up to 20, each up to 1,000,000 characters. |
| `devicePreset` | String | `desktop` | `desktop` 1920x1080, `laptop` 1440x900, `tablet` 820x1180, `mobile` 390x844 |
| `viewportWidth`, `viewportHeight` | Integer | from the device | Window size in pixels, 200 to 4000. |
| `deviceScaleFactor` | Number | from the device | Pixel density, 1 to 4. A value of 2 doubles width and height. |
| `colorScheme` | String | `light` | `light` or `dark`. |
| `fullPage` | Boolean | `false` | Capture the whole scrollable page instead of the first screen. |
| `selector` | String | - | CSS selector; captures only the first match. Not combinable with `fullPage`. |
| `format` | String | `png` | `png` or `jpeg`. |
| `quality` | Integer | `80` | JPEG quality, 1 to 100. Ignored for PNG. |
| `omitBackground` | Boolean | `false` | Transparent background where the page paints none. PNG only. |
| `hideSelectors` | Array\[String] | `[]` | CSS selectors of elements to hide, up to 25. |
| `customCss` | String | - | Extra styles applied for the capture, up to 20,000 characters. |
| `disableAnimations` | Boolean | `false` | Finish running animations and stop endless ones first. |
| `waitUntil` | String | `load` | `load`, `domcontentloaded` (fastest) or `networkidle` (waits for late content). |
| `waitForSelector` | String | - | CSS selector that must be present before the page is captured. |
| `waitMs` | Integer | `0` | Extra pause in milliseconds after the page is ready, up to 10000. |
| `timeoutSeconds` | Integer | `30` | Time limit per screenshot, 5 to 120. |
| `failOnHttpError` | Boolean | `true` | Skip the screenshot when the page answers with an error such as 404 or 500. |

At least one URL or one HTML document is required. Only public http(s) addresses are accepted: entries pointing at private or local addresses, containing credentials, or otherwise malformed are rejected as invalid input before any work starts.

#### Size limits

An image can hold at most 40 million pixels (width x height x pixel density squared). That fits a 1920 x 1080 window at 4x density, or a full page about 20,000 pixels tall at a width of 1920. Runs with a window that is too large for that are rejected up front. A full-page or element capture that turns out larger fails for that source only and is not charged. A single image can be up to 50 MB.

### Output

One row per source, in the results table and the dataset. The image itself is stored with the run; `image_url` is the public link to it.

#### Successful capture

```json
{
    "source": "https://example.com/",
    "source_type": "url",
    "status": "success",
    "image_url": "https://api.apify.com/v2/key-value-stores/xxxxxxxxxxxxxxxxx/records/screenshot-0001-1a2b3c4d.png",
    "image_key": "screenshot-0001-1a2b3c4d.png",
    "format": "png",
    "width": 1920,
    "height": 1080,
    "file_size_bytes": 28461,
    "capture_seconds": 0.92,
    "final_url": "https://example.com/",
    "http_status": 200,
    "error": null
}
```

#### Source that could not be captured

```json
{
    "source": "https://example.com/missing",
    "source_type": "url",
    "status": "failed",
    "image_url": null,
    "image_key": null,
    "format": null,
    "width": null,
    "height": null,
    "file_size_bytes": null,
    "capture_seconds": null,
    "final_url": null,
    "http_status": null,
    "error": "The page responded with HTTP 404"
}
```

Every row has the same keys. HTML inputs are labelled `HTML document 1`, `HTML document 2`, ... in `source`; `final_url` and `http_status` only apply to URL inputs.

A source fails when the page cannot be reached, answers with an error status (unless `failOnHttpError` is off), is not allowed (private or local addresses), has no element matching `selector`, or exceeds its time limit. Failed sources are not charged. A source that cannot be finished within the run's remaining time is not started: it gets a failed row with the code `time_limit` and is not charged. If the run is stopped or migrated, sources not yet started are left out and everything delivered so far stays in the dataset. A problem with the run's access to the screenshot service ends the run with an error message instead of producing rows.

### Pricing: pay per screenshot

You pay for every screenshot that was captured and delivered, plus a small flat fee per run. Failed sources are free. Apify's platform dataset-item fee ($0.00001 per row) applies to every row written to the dataset, including failed rows.

| Event | Price |
|---|---|
| Screenshot captured and delivered | $0.0155 on the Free plan (about $15.50 per 1,000 screenshots); cheaper on higher plans, see below |
| Run start | $0.00005 |

**Price per screenshot by Apify plan:**

| Plan | Price | Per 1,000 screenshots |
|---|---|---|
| Free | $0.0155 | $15.50 |
| Bronze | $0.0147 | $14.70 |
| Silver | $0.0132 | $13.20 |
| Gold, Platinum, Diamond | $0.0101 | $10.10 |

#### Free test runs

New users on Apify's free plan get up to 5 free runs of this actor (lifetime total), each capped to 3 sources. Runs started via the Apify Console's "Test" button are capped to 3 sources too, regardless of plan, and don't count against the 5 free runs.

### How long does a run take?

Most pages take one to five seconds each, with up to 2 sources processed at once. Pages that load content late, or that you ask to wait for an element or for the network to settle, take longer, up to the time limit you set. Results stream into the dataset as each source finishes.

### FAQ

#### Can I capture pages behind a login?

No. Only publicly reachable pages can be captured. For private content, pass the page's HTML in `htmlDocuments` instead.

#### Why is part of the page missing from my screenshot?

The page probably loads that content late. Try `waitUntil: networkidle`, `waitForSelector` with an element that appears once the content is there, or a short `waitMs`. Pages that reveal content while scrolling may need `customCss` to show it, since the capture does not scroll the page.

#### How do I get a sharper image?

Raise `deviceScaleFactor`. A value of 2 produces an image twice as wide and tall as the window size, the same as a retina screen.

#### How long are the image links available?

The files are stored with the run, so they stay available as long as the run's data does. Download or copy them if you need them for longer. Anyone who has the link can open the file, so treat links like the data they point to.

#### Can I get WebP?

Not at the moment. Use PNG for lossless captures or JPEG for small files.

### Related Actors

- [URL to PDF Converter](https://apify.com/bite-sized-insights/url-to-pdf-converter) - Archive pages as PDF.
- [image similarity score](https://apify.com/bite-sized-insights/visual-diff-api) - Detect visual changes automatically.
- [bulk image converter](https://apify.com/bite-sized-insights/bulk-image-converter-compressor-and-resizer) - Convert, compress and resize in bulk.

### Disclaimer

Only capture pages you are allowed to copy and store. The actor does not alter page content apart from the hiding and styling you ask for, and what ends up in the image depends on what the page shows at the time of capture.

***

**Need help?** Open an issue on the actor's repository or contact support through Apify Console.

# Actor input Schema

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

Public pages to capture, one image each. Domain or URL. Empty it to capture only HTML.

## `htmlDocuments` (type: `array`):

Complete HTML documents, one image each. Images and styles: inline or public URLs.

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

Window size and pixel density. Phones and tablets also get touch and mobile page layout.

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

Overrides the device's window width. Responsive pages react to it.

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

Overrides the device's window height. Also the height of the image unless full page is on.

## `deviceScaleFactor` (type: `number`):

Overrides the device's pixel density, 1 to 4. At 2 the image is twice as wide and tall.

## `colorScheme` (type: `string`):

Light or dark mode, for sites that follow the visitor's preference.

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

Capture the whole scrollable page, not only the first screen. Max 40 million pixels.

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

CSS selector, e.g. <code>#pricing</code>. First match only. Not combinable with full page.

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

PNG is lossless and supports a transparent background; JPEG is smaller.

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

1 (smallest file) to 100 (best quality). Used for JPEG only.

## `omitBackground` (type: `boolean`):

Leave the page background transparent where the page does not paint one. PNG only.

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

CSS selectors of elements to hide, e.g. <code>.cookie-banner</code>.

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

Extra styles for the capture, e.g. <code>.sticky-header { position: static; }</code>.

## `disableAnimations` (type: `boolean`):

Finish running animations and stop endless ones before capturing, for steady results.

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

When the page counts as loaded. Network idle waits for late content but takes longest.

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

CSS selector (e.g. <code>#content</code>) that must be on the page before it is captured.

## `waitMs` (type: `integer`):

Pause in milliseconds after the page is ready, for animations or late content.

## `timeoutSeconds` (type: `integer`):

Maximum seconds per screenshot, including loading and waiting. Timeouts are not charged.

## `failOnHttpError` (type: `boolean`):

Skip the screenshot when the page answers with an error status such as 404 or 500.

## Actor input object example

```json
{
  "urls": [
    "https://example.com"
  ],
  "htmlDocuments": [],
  "devicePreset": "desktop",
  "colorScheme": "light",
  "fullPage": false,
  "format": "png",
  "quality": 80,
  "omitBackground": false,
  "hideSelectors": [],
  "disableAnimations": false,
  "waitUntil": "load",
  "waitMs": 0,
  "timeoutSeconds": 30,
  "failOnHttpError": true
}
```

# Actor output Schema

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

One row per source with an image link, size and status

## `files` (type: `string`):

All captured images in the run's storage

# 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("bite-sized-insights/website-screenshot-api").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("bite-sized-insights/website-screenshot-api").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 bite-sized-insights/website-screenshot-api --silent --output-dataset

```

## MCP server setup

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

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/4U38beSCQrz0ejuOZ/builds/2jkJ9oYH4KxP8UVKT/openapi.json
