# Website Screenshot API – Full-Page, Mobile & PDF (`mikumans/website-screenshot`) Actor

Screenshot any URL: full-page or viewport PNG/JPEG, iPhone/Pixel/iPad emulation, single elements, dark mode and PDF. Hides cookie banners and ads. Bulk, fast, failures free.

- **URL**: https://apify.com/mikumans/website-screenshot.md
- **Developed by:** [Michiel Kustermans](https://apify.com/mikumans) (community)
- **Categories:** Developer tools, SEO tools
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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/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 & PDF

Take **clean screenshots of any website in bulk**: full-page or viewport, desktop or real mobile-device emulation, a single element, or a PDF, without cookie banners and ads. Paste URLs, click **Start**, download the images.

### What can you use it for?

- **Visual monitoring & archiving:** schedule daily captures of your site or competitors' pages.
- **Link previews & thumbnails** for directories, newsletters and reports.
- **Mobile/desktop QA:** check how pages render on iPhone, Pixel, iPad and desktop.
- **Competitor research:** capture just the pricing table or hero section with a CSS selector.
- **Compliance & evidence:** PDF snapshots of pages with a timestamp.
- **AI & datasets:** generate page images for vision models.

### Features

| Feature | This Actor | Typical screenshot Actors |
|---|---|---|
| Full page + viewport | ✅ | ✅ |
| Device presets (iPhone 15 Pro, Pixel 7, iPad Pro, desktop HiDPI) | ✅ | Sometimes |
| Capture a single element (CSS selector) | ✅ | Rarely |
| Hide cookie banners + block ads | ✅ | Rarely |
| Dark mode, custom CSS & JavaScript | ✅ | Rarely |
| PDF output | ✅ optional | Separate Actor |
| Retries with longer waits, parallel capture | ✅ | Varies |
| **Failed pages are free** | ✅ | ❌ usually charged |

### How to use

1. Add one or more URLs.
2. Optionally pick a device, full page, element selector, cookie-banner hiding, dark mode or PDF.
3. Click **Start**. Each page becomes a dataset row with a link to the image (and PDF) in the run's storage.

#### Example input

```json
{ "urls": [{ "url": "https://apify.com" }, { "url": "https://www.wikipedia.org" }],
  "device": "iphone", "fullPage": true, "hideCookieBanners": true, "blockAds": true, "savePdf": false }
```

#### Example output

```json
{ "url": "https://www.wikipedia.org", "title": "Wikipedia", "statusCode": 200, "device": "iphone", "width": 393, "height": 659,
  "fullPage": true, "format": "png", "bytes": 178011,
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/screenshot-8d1d8a3956ab" }
```

### Input reference

| Field | Default | Description |
|---|---|---|
| `urls` | – | Pages to capture |
| `device` | custom | `custom`, `desktop`, `iphone`, `pixel`, `ipad` |
| `width` / `height` | 1280 × 800 | Viewport for `custom` |
| `fullPage` | false | Whole scrollable page |
| `selector` | – | Capture only this element |
| `format` / `quality` | png / 80 | PNG or JPEG |
| `hideCookieBanners` / `blockAds` / `darkMode` | false | Clean-up and appearance |
| `customCss` / `customJs` | – | Injected before capture |
| `savePdf` / `pdfOnly` | false | PDF output |
| `waitUntil` / `delayMs` / `timeoutSecs` | load / 1000 / 45 | Loading behaviour |
| `maxConcurrency` / `maxRetries` / `retryExtraDelayMs` | 3 / 2 / 3000 | Throughput & reliability |
| `proxyConfiguration` | off | Optional Apify Proxy for sites that block cloud IPs |

### Pricing

Pay per result, with no platform usage fees on top. See the **Pricing** tab for the current price.

- 100 screenshots ≈ $0.20 · 1,000 screenshots ≈ $2 · 10,000 screenshots ≈ $20 (at $2 per 1,000)
- PDFs: $2 per 1,000, only when enabled.
- **Pages that fail to load are not charged.** They're listed in the run's `FAILED` record.
  The Apify Free plan's monthly credits cover a few thousand screenshots.

### Integrations

- **API:** run via the [Apify API](https://docs.apify.com/api/v2) or the JavaScript/Python clients, and get results as JSON, CSV, Excel or XML.
- **No-code:** native Apify integrations for **Make**, **Zapier** and **n8n**, plus Google Sheets, Slack, webhooks and **schedules**.
- **AI agents:** available through the Apify MCP server, so Claude, ChatGPT and other agents can call it as a tool.

### FAQ

**Why is the cookie banner still visible on some sites?** Hiding covers the major consent platforms. For others, add `customCss` like `#my-banner{display:none!important}`.
**The page looks unfinished.** Increase `delayMs` or set `waitUntil` to `networkidle`. Retries already wait longer automatically.
**A site blocks the screenshot.** Enable Apify Proxy (residential works best for strict sites).
**How do I get the image files?** Use `screenshotUrl` in each row, or open the run's key-value store (the "Screenshots" output tab).
**Is it legal?** Capturing public pages is generally fine. Respect copyright and each site's terms when you reuse the images.

### Related Actors from the same developer

- ⚡ **[Bulk PageSpeed & Lighthouse Checker](https://apify.com/mikumans/bulk-pagespeed-auditor)**: Core Web Vitals and Lighthouse scores for many URLs.
- 🗺️ **[Sitemap URL Extractor](https://apify.com/mikumans/sitemap-extractor-pro)**: every URL from a site's sitemaps, with new/removed URL monitoring.

**Workflow tip:** extract URLs with the Sitemap Extractor → audit them with the PageSpeed Checker → screenshot the flagged pages.

**Keywords:** website screenshot, screenshot API, full page screenshot, URL to image, URL to PDF, mobile screenshot, bulk screenshots, webpage capture, site thumbnail.

# Actor input Schema

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

Pages to screenshot.

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

Emulate a device (viewport, pixel ratio, user agent, touch). 'Custom' uses the width and height fields.

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

Viewport width (px).

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

Viewport height (px).

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

Capture the whole scrollable page.

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

Optional. Screenshot only the first element matching this selector, e.g. #pricing or .hero.

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

Image format.

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

JPEG quality.

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

Hide common consent popups (OneTrust, Cookiebot, Didomi, Quantcast…) and click 'Accept' where found.

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

Block common ad/tracker domains and hide ad slots.

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

Emulate prefers-color-scheme: dark.

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

CSS injected before capture, e.g. to hide elements.

## `customJs` (type: `string`):

JavaScript evaluated in the page before capture (e.g. click a tab, scroll).

## `savePdf` (type: `boolean`):

Also render the page as PDF. Charged as a separate 'PDF' event.

## `pdfOnly` (type: `boolean`):

Render PDF only, skip the image screenshot.

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

Wait until.

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

Wait after load before capturing.

## `timeoutSecs` (type: `integer`):

Navigation timeout (s).

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

Pages captured in parallel. Use 1–3 with 1 GB memory, more with more memory.

## `maxRetries` (type: `integer`):

Retries for failed pages. Retries wait for network idle and longer delays.

## `retryExtraDelayMs` (type: `integer`):

Added to the delay on each retry.

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

Proxy.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://apify.com"
    },
    {
      "url": "https://www.wikipedia.org"
    }
  ],
  "device": "custom",
  "width": 1280,
  "height": 800,
  "fullPage": false,
  "format": "png",
  "quality": 80,
  "hideCookieBanners": true,
  "blockAds": false,
  "darkMode": false,
  "savePdf": false,
  "pdfOnly": false,
  "waitUntil": "load",
  "delayMs": 1000,
  "timeoutSecs": 45,
  "maxConcurrency": 3,
  "maxRetries": 2,
  "retryExtraDelayMs": 3000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per URL with title, status and screenshot link

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

Screenshot image files

## `failed` (type: `string`):

Pages that could not be captured, with errors

## `pdfs` (type: `string`):

PDF files (when enabled)

# 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": [
        {
            "url": "https://apify.com"
        },
        {
            "url": "https://www.wikipedia.org"
        }
    ],
    "hideCookieBanners": true,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mikumans/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": [
        { "url": "https://apify.com" },
        { "url": "https://www.wikipedia.org" },
    ],
    "hideCookieBanners": True,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("mikumans/website-screenshot").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": [
    {
      "url": "https://apify.com"
    },
    {
      "url": "https://www.wikipedia.org"
    }
  ],
  "hideCookieBanners": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call mikumans/website-screenshot --silent --output-dataset

```

## MCP server setup

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

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/YQ7jmyZGhulrxRxBa/builds/0x954FGR2Wo86I4kS/openapi.json
