# Website Screenshot API (`adhistory/website-screenshot-api`) Actor

Turn a list of public URLs into full-page, mobile or element screenshots (PNG/JPEG) with a download link for each. Hides cookie banners. Billed only for screenshots delivered: $1 per 1,000.

- **URL**: https://apify.com/adhistory/website-screenshot-api.md
- **Developed by:** [Brandon Ob](https://apify.com/adhistory) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% 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: full-page PNG or JPEG of any URL

Paste a list of public web pages and get one screenshot per page, each with a download link you can drop into a sheet, a report or another tool. Full page, first screen only, one element, phone or tablet size, dark mode, retina, with cookie banners hidden. You are charged only for screenshots that were delivered, never for a page that failed.

### What you get

One row per page in the dataset, and the image itself in the run's key-value store. Real output from the default run:

| url | title | httpStatus | device | format | imageBytes | screenshotUrl |
|---|---|---|---|---|---|---|
| https://apify.com | Apify: Marketplace of ready-to-run tools for AI | 200 | desktop | png | 962,969 | …/records/screenshot-001-apify-com.png |
| https://news.ycombinator.com | Hacker News | 200 | desktop | png | 249,360 | …/records/screenshot-002-news-ycombinator-com.png |

Also in each row: `finalUrl` (after redirects), `viewportWidth`, `viewportHeight`, `fullPage`, `storageKey`, `capturedAt`. The key-value store record `SUMMARY` lists every URL that could not be captured and why.

### How to use

1. Add your URLs, one per line. `https://` is added if you leave it out.
2. Pick a device (desktop, tablet, mobile), full page or first screen only, and PNG or JPEG.
3. Cookie banners from the common consent tools (OneTrust, Cookiebot, Didomi, Usercentrics, Quantcast and others) are hidden automatically; nothing is clicked or accepted. Turn it off with **Hide cookie banners**.
4. Optional: a CSS selector to capture one element (`#pricing`), selectors to hide (`#cookie-banner`), a delay for animations, dark mode, retina, a proxy.
5. Run it, then use the `screenshotUrl` column through the dataset export (CSV, JSON, Excel) or the API.

### Pricing

Pay per event: **$1.00 per 1,000 screenshots** (the dataset-item event) plus a $0.00005 Actor start. You set a maximum cost per run and the Actor stops cleanly at it. Pages that time out or fail to load are not charged.

### Limits (honest)

- Public pages only. Pages behind a login, a paywall or a CAPTCHA will show what a logged-out visitor sees, or fail.
- Full-page shots are capped at 16,000 pixels tall. Pages that scroll forever, or that load content only after you scroll, may not match what you see in your own browser. Use the delay option to give them time.
- Sites that block datacenter traffic may need the proxy option.
- Some pages differ by country, language or A/B variant; the screenshot shows what this browser received.
- Check that you are allowed to capture and reuse a page. Screenshots of other people's pages can be protected by copyright.

### FAQ

**How is this different from apify/screenshot-url?** Same job, with the options people keep asking for in one place: element capture, hiding cookie banners, mobile and tablet presets, dark mode, retina, JPEG quality and a per-page timeout that skips instead of failing the whole run.

**Something broke or you need a feature?** Open an issue on the Issues tab. I usually reply within a day.

# Actor input Schema

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

Public web pages, one per line. https:// is added if you leave it out. Pages behind a login are not supported.

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

Sets the default window size and, for tablet and mobile, a phone-style browser.

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

Capture the whole scrollable page, up to 16,000 pixels tall. Turn off for just the first screen.

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

PNG is sharp and larger; JPEG is smaller.

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

Optional. Screenshot just the first element that matches, for example #pricing or .hero.

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

Optional. Elements to hide before the shot, for example a cookie banner (#cookie-banner).

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

Hide consent pop-ups from the common cookie tools (OneTrust, Cookiebot, Didomi, Usercentrics, Quantcast, TrustArc, CookieYes and similar) before the shot. Nothing is clicked or accepted; the banner is only hidden in the screenshot.

## `delaySeconds` (type: `integer`):

Extra time for animations and late-loading content.

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

When the page counts as loaded. networkidle waits for requests to go quiet and is slower.

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

Ask the page for its dark color scheme, if it has one.

## `retina` (type: `boolean`):

Double the pixel density for sharper images and larger files.

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

Skips common ad and analytics requests. Pages load faster and cleaner.

## `width` (type: `integer`):

Optional. Overrides the device width.

## `height` (type: `integer`):

Optional. Overrides the device height.

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

1 to 100. Only used when the format is JPEG.

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

A page that takes longer is skipped and not charged.

## `maxItems` (type: `integer`):

Stop after this many screenshots. You are charged per screenshot delivered.

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

Optional. Use a proxy, for example to see a page as a visitor from another country.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://news.ycombinator.com"
  ],
  "device": "desktop",
  "fullPage": true,
  "format": "png",
  "hideCookieBanners": true,
  "delaySeconds": 0,
  "waitUntil": "load",
  "darkMode": false,
  "retina": false,
  "blockAds": true,
  "jpegQuality": 80,
  "timeoutSeconds": 45,
  "maxItems": 100
}
```

# Actor output Schema

## `screenshots` (type: `string`):

No description

## `summary` (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://apify.com",
        "https://news.ycombinator.com"
    ]
};

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

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

```

## MCP server setup

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