# Website Screenshot & PDF (`cypherstone/website-screenshot-pdf`) Actor

Capture full-page screenshots (PNG/JPEG) or PDFs of one or many URLs, at any device size, with cookie-banner hiding. Each file is saved and linked in a results table.

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

## Pricing

from $5.00 / 1,000 url processeds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 & PDF** captures **full-page screenshots** (PNG or JPEG) or **PDF snapshots** of one or many web pages in a single run — at any viewport or device size, with automatic **cookie-banner hiding** — and saves each file with a direct link in a clean results table.

### What can the Website Screenshot actor do?

- **Take a full-page screenshot of any website** — the entire scrollable page, not just the visible part.
- **Screenshot many URLs at once** — pass a whole list and get one file plus one result row per page.
- **Save a web page as a PDF** — a print-ready PDF snapshot with backgrounds.
- **Capture at any device size** — set the viewport width and height for desktop, tablet, or mobile.
- **Get crisp retina images** — a 2× or 3× scale factor for high-DPI screenshots.
- **Hide cookie and consent banners** — common pop-ups are hidden automatically before the shot, and you can add your own selectors.
- **Wait for the page to settle** — choose the load strategy and add an extra delay for late-loading content.
- **Capture in dark mode** — render a site's dark theme if it has one.

### Use cases

- **Monitor how a page looks over time** — run on a schedule and keep a visual history.
- **Archive web pages as PDFs** for records or compliance.
- **Generate preview thumbnails** of URLs for a directory, dashboard, or link list.
- **QA and design review** — capture the same page across several viewport sizes.
- **Feed screenshots into other tools** — each capture is stored with a direct link you can pass downstream.

### Input

```json
{
  "urls": ["https://example.com", "https://apify.com"],
  "format": "png",
  "fullPage": true,
  "width": 1280,
  "height": 800,
  "deviceScaleFactor": 2,
  "hideCookieBanners": true,
  "waitUntil": "networkidle"
}
```

For a PDF, set `"format": "pdf"`. For JPEG, set `"format": "jpeg"` and optionally `"quality": 80`.

### Output

Each page produces one file (in the run's key-value store) and one dataset row:

| Field | Example |
|-------|---------|
| url | https://example.com |
| http\_status | 200 |
| format | png |
| bytes | 10893 |
| file | direct link to the image or PDF |

If a page fails to load, its row records the `error` instead — the run keeps going and captures the rest, so one bad URL never returns a blank result.

### Notes

- Viewport dimensions are clamped to sane limits; screenshots and PDFs run in headless Chromium.
- `fullPage` applies to image formats; PDFs always paginate the whole document.
- The actor captures only the URLs you give it and stores no personal data.

# Actor input Schema

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

One or more page URLs to capture.

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

png or jpeg image, or a pdf.

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

Capture the entire scrollable page (images only). Off = just the viewport.

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

Browser viewport width in pixels.

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

Browser viewport height in pixels (page height when not full-page).

## `deviceScaleFactor` (type: `integer`):

2 renders at 2x for crisp, high-DPI images.

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

Only used for jpeg.

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

Best-effort hiding of common consent/cookie pop-ups before capture.

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

Additional elements to hide before capture, e.g. .newsletter-modal.

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

When to consider the page loaded before capturing.

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

Pause after load before capturing, for late animations.

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

Render the page in its dark theme if it has one.

## Actor input object example

```json
{
  "urls": [
    "https://example.com"
  ],
  "format": "png",
  "fullPage": true,
  "width": 1280,
  "height": 800,
  "deviceScaleFactor": 1,
  "hideCookieBanners": true,
  "waitUntil": "networkidle",
  "delayMs": 0,
  "darkMode": false
}
```

# Actor output Schema

## `results` (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://example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cypherstone/website-screenshot-pdf").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("cypherstone/website-screenshot-pdf").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 cypherstone/website-screenshot-pdf --silent --output-dataset

```

## MCP server setup

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

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/kSpI2gvgZajPFvM1F/builds/BYfMThPGEbAYvaSL6/openapi.json
