# Website Screenshot API - Full Page, Mobile, Element & PDF (`sonic_scraper/website-screenshot-api`) Actor

Website screenshot API for bulk URLs: full-page, visible-screen, element or PDF captures on desktop, laptop, tablet or mobile, with cookie banners hidden, sticky headers fixed, lazy images loaded and a crop height. Failed pages are never charged.

- **URL**: https://apify.com/sonic_scraper/website-screenshot-api.md
- **Developed by:** [Sonic Scraper](https://apify.com/sonic_scraper) (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 $2.20 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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, Mobile, Element & PDF

**Capture clean screenshots of any number of web pages: full page, visible screen, a single element or a PDF, on desktop, laptop, tablet or mobile. Cookie banners are hidden, sticky headers appear once instead of repeating, lazy images are loaded, and you can crop to any height. Pages that fail are never charged.**

Use it for website monitoring and visual archives, client reports, competitor and landing-page tracking, link previews and thumbnails, QA of responsive layouts, and as a screenshot tool for AI agents.

![Website Screenshot API output: laptop-size screenshots of Wikipedia, Stripe, Apify and GitHub captured in one run](https://api.apify.com/v2/key-value-stores/lwQu1lCMCLQIIhSMQ/records/website-screenshot-api-output.png)

*Real output from a run of Website Screenshot API: four pages captured at laptop size, cropped to 2,000 px.*

### What it fixes

Generic screenshot tools often give you pictures you cannot use. This Actor handles the usual problems:

| Problem | What this Actor does |
|---|---|
| A cookie banner covers half the page | Hides banners of the common consent platforms (OneTrust, Cookiebot, Didomi, Quantcast, Usercentrics, CookieYes, TrustArc, iubenda and more) and consent bars found by their text, in English, French, German, Spanish and Italian. It hides them; it never clicks "accept" for you. |
| The sticky header repeats down a full-page screenshot | Sticky and fixed headers are put back into the page flow, so they appear once at the top. Chat bubbles and bottom bars are hidden. |
| Images further down are blank | The page is scrolled through first (at most 8 seconds) so lazy images load. |
| A 40,000-pixel page you only need the top of | `maxHeight` crops from the top, for example 1080 for the first screen or 3000 for the top sections. |
| You need just one part of the page | `captureMode: "element"` with a CSS selector such as `#pricing` or `main`. |
| Emoji and Asian scripts show as boxes | Colour emoji and Chinese, Japanese and Korean fonts are installed. |
| A page never finishes loading | After the page timeout it is captured as it is, marked `loadedFully: false`, instead of failing. |
| You paid for screenshots that failed | Only successful captures are charged. Failures are listed in the `ERRORS` record with the reason. |

### Quick start

```json
{
  "urls": ["https://apify.com", "https://www.wikipedia.org"]
}
```

Mobile screenshots of the first two screens, as JPEG:

```json
{
  "urls": ["https://stripe.com", "https://www.bbc.com"],
  "device": "mobile",
  "maxHeight": 1700,
  "format": "jpeg"
}
```

Just the pricing table, in dark mode:

```json
{
  "urls": ["https://example-saas.com/pricing"],
  "captureMode": "element",
  "elementSelector": "#pricing",
  "darkMode": true
}
```

### Input

| Field | Default | What it does |
|---|---|---|
| `urls` / `urlsText` | – | Pages to capture. Paste hundreds at once in `urlsText`. |
| `captureMode` | `fullPage` | `fullPage`, `viewport` (visible screen) or `element`. |
| `elementSelector` | – | CSS selector for element mode. |
| `format` | `png` | `png`, `jpeg` (with `jpegQuality`) or `pdf`. |
| `maxHeight` | 15000 | Crop full-page captures from the top; 0 = whole page (up to 30,000 px). |
| `device` | `desktop` | `desktop` 1920x1080, `laptop` 1366x768, `tablet` (iPad, 2x), `mobile` (iPhone, 3x) or `custom` with `viewportWidth` / `viewportHeight`. |
| `darkMode` | false | Ask the page for its dark theme. |
| `hideCookieBanners` | true | Hide consent banners. |
| `fixStickyElements` | true | Sticky headers once at the top in full-page captures. |
| `loadLazyImages` | true | Scroll through the page first. |
| `selectorsToHide` | – | Your own CSS selectors to hide (pop-ups, ads, chat widgets). |
| `waitUntil`, `waitForSelector`, `delayMs` | load, –, 1000 | When to capture. |
| `pageTimeoutSecs` | 45 | Capture whatever has loaded after this long. |
| `maxConcurrency` | 3 | Pages in parallel (about 500 MB of memory per heavy page). |
| `proxyConfiguration` | none | Optional proxy, for example for a country-specific page. |

### Output

Each successful capture is one dataset row, and the file is saved in the run's key-value store:

```json
{
  "url": "https://stripe.com/",
  "finalUrl": "https://stripe.com/",
  "title": "Stripe | Financial Infrastructure to Grow Your Revenue",
  "httpStatus": 200,
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/stripe-com-1-a33a7da0.png",
  "key": "stripe-com-1-a33a7da0.png",
  "format": "png",
  "captureMode": "fullPage",
  "device": "desktop",
  "width": 1920,
  "height": 6000,
  "bytes": 3857850,
  "loadedFully": true,
  "durationMs": 7412,
  "capturedAt": "2026-11-21T14:20:03.511Z"
}
```

The **Screenshots** view shows a preview of every image next to its URL. Download files from the `screenshotUrl` links or from the run's key-value store, or send them on with Apify integrations, Make, Zapier or n8n. Files stay in the run's storage for the retention period of your Apify plan.

### Use it from code or an AI agent

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("sonic_scraper/website-screenshot-api").call(run_input={
    "urls": ["https://apify.com", "https://www.wikipedia.org"],
    "device": "laptop",
    "maxHeight": 3000,
})
for row in client.dataset(run.default_dataset_id).iterate_items():
    print(row["url"], row["screenshotUrl"])
```

AI agents can call it through the Apify MCP server at `https://mcp.apify.com?tools=sonic_scraper/website-screenshot-api`.

### Pricing

Pay per screenshot saved; see the Pricing tab for the current rate. Pages that fail (errors, timeouts with nothing rendered, invalid URLs, HTTP 4xx/5xx answers) are **not charged**, and the Actor stops before it would exceed your run's maximum charge.

### Limits

- **Sites with bot protection may refuse to load.** Some sites (for example parts of Cloudflare-protected or large news sites) answer an automated browser with 403 or a challenge page. Those pages fail and are not charged. The Actor does not solve CAPTCHAs or bypass bot checks.
- **Logins are not supported.** It captures what a logged-out visitor sees.
- **Banner hiding covers the common platforms, not every custom banner.** Add the banner's CSS selector to `selectorsToHide` if one slips through.
- **Very long pages are capped at 30,000 px** (browser limit); use `maxHeight` or element mode for the part you need.
- **PDFs are one page wide** with the screen styling (what you see), not the site's print stylesheet.

### FAQ

#### How do I take a full-page screenshot of a website without the cookie banner?

Add the URL and keep "Hide cookie and consent banners" on (the default). Banners from the main consent platforms and consent bars found by their text are hidden before the capture.

#### How do I screenshot only part of a page?

Use `maxHeight` to crop from the top, or set `captureMode` to `element` with a CSS selector to capture one section.

#### Can I take mobile screenshots?

Yes: set `device` to `mobile` (iPhone size, 3x pixel density) or `tablet`, or set a custom width and height.

#### Am I charged for pages that fail?

No. Only successful captures are saved to the dataset and charged; failures are listed in the `ERRORS` record with the reason.

#### Can I get a PDF instead of an image?

Yes: set `format` to `pdf`.

### Related actors

- [Technical SEO Audit Crawler](https://apify.com/sonic_scraper/technical-seo-audit-crawler): broken links, titles and other SEO issues for the same pages.
- [Website to Markdown Crawler](https://apify.com/sonic_scraper/ai-rag-web-crawler): the text of the pages as Markdown for AI and RAG.
- [Contact Details Scraper](https://apify.com/sonic_scraper/b2b-website-intelligence-scraper): emails, phones and tech stack from the same websites.
- [Google AI Overview Tracker](https://apify.com/sonic_scraper/google-ai-overview-tracker): whether your pages are cited in Google's AI Overviews.

### Support

Open an issue on the Issues tab with the URL and your run ID if a page does not look right. This is an independent tool and is not affiliated with the websites you capture.

# Actor input Schema

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

Pages to capture, one per line. "https://" is added when missing.

## `urlsText` (type: `string`):

Paste many URLs at once, separated by new lines, commas or spaces. Combined with the list above.

## `captureMode` (type: `string`):

Full page (scrolls the whole page, capped by "Maximum height"), only the visible screen, or one element.

## `elementSelector` (type: `string`):

For "One element": the CSS selector to capture, for example "#pricing", "main" or "article". The first visible match is used.

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

PNG (sharp, larger), JPEG (smaller) or PDF (the page as a single-width PDF).

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

1-100. Only for JPEG.

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

Crop full-page captures to this height from the top, for example 1080 for the part above the fold plus a bit, or 0 for the whole page (up to 30,000 px).

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

Desktop 1920x1080, laptop 1366x768, tablet 820x1180 (iPad, 2x), mobile 390x844 (iPhone, 3x), or custom width and height below.

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

Only for "Custom size".

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

Only for "Custom size".

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

Ask the page for its dark theme (prefers-color-scheme: dark), when it has one.

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

Hides banners of common consent platforms (OneTrust, Cookiebot, Didomi, Quantcast, Usercentrics, CookieYes and others) and consent bars found by their text, without clicking anything.

## `fixStickyElements` (type: `boolean`):

Sticky and fixed headers appear once at the top instead of repeating or covering content; chat bubbles and bottom bars are hidden.

## `loadLazyImages` (type: `boolean`):

Scroll through the page (at most 8 seconds) before a full-page capture, so lazy-loaded images appear.

## `selectorsToHide` (type: `array`):

CSS selectors to hide before capturing, for example ".newsletter-popup" or "#ad-banner".

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

When the page counts as loaded. "Network idle" is slower but safest for heavy pages.

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

Optional CSS selector to wait for (up to 20 s) before capturing, for example a chart that loads late.

## `delayMs` (type: `integer`):

Wait this long after loading, for animations to finish.

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

A page still loading after this is captured as it is (loadedFully: false) instead of failing.

## `maxConcurrency` (type: `integer`):

Higher is faster but needs more memory (about 500 MB per heavy page; the default 2 GB run handles 3).

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

Optional. Use a proxy, for example to load a country-specific version of a page.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://www.wikipedia.org"
  ],
  "captureMode": "fullPage",
  "format": "png",
  "jpegQuality": 80,
  "maxHeight": 15000,
  "device": "desktop",
  "viewportWidth": 1920,
  "viewportHeight": 1080,
  "darkMode": false,
  "hideCookieBanners": true,
  "fixStickyElements": true,
  "loadLazyImages": true,
  "waitUntil": "load",
  "delayMs": 1000,
  "pageTimeoutSecs": 45,
  "maxConcurrency": 3
}
```

# Actor output Schema

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

Preview, link, size and status for each capture.

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

The images and PDFs in the run's key-value store.

## `errors` (type: `string`):

Pages that could not be captured, with the reason. Never charged.

# 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://www.wikipedia.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sonic_scraper/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://www.wikipedia.org",
    ] }

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

```

## MCP server setup

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