# Website Screenshots and PDFs (`onescriptfix/website-screenshots-pdf`) Actor

Full-page or viewport screenshots of any public URL, taken in Chromium. Device presets, cookie-banner hiding, lazy-image scrolling, single-element capture and an optional PDF of the same page. You pay only for successful captures.

- **URL**: https://apify.com/onescriptfix/website-screenshots-pdf.md
- **Developed by:** [One Script Fix](https://apify.com/onescriptfix) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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 Screenshots and PDFs - Full Page, Mobile, No Cookie Banners

Turn a list of URLs into clean screenshots. Full-page or just the visible area, desktop or a real phone viewport, PNG,
JPEG or WebP, and a PDF if you want one. Cookie banners are hidden before the shot, lazy images are scrolled into view
first, and you can capture a single element instead of the whole page.

Good for monitoring how pages look over time, building link previews and thumbnails, archiving pages, QA of
responsive layouts, and reports that need a picture of a page.

### Quick start

```json
{
  "urls": ["https://www.bbc.com/news", "https://github.com/"],
  "viewport": "mobile",
  "format": "webp"
}
```

### Input

| Field | Default | What it does |
| --- | --- | --- |
| `urls` | required | Public pages to capture. Duplicates are removed. |
| `viewport` | `desktop` | `desktop` 1440×900, `laptop` 1280×800, `tablet` 820×1180, `mobile` 390×844 at 3× with a phone user agent, or `custom`. |
| `width`, `height` | empty | Size for the `custom` viewport. |
| `fullPage` | `true` | Capture the whole page height, not just the first screen. |
| `format` | `png` | `png`, `jpeg` or `webp`. |
| `quality` | `85` | JPEG and WebP quality. |
| `pdf` | `false` | Also save the page as a PDF (`pdfFormat` A4 or Letter). |
| `hideCookieBanners` | `true` | Hide common consent pop-ups (OneTrust, Cookiebot, Didomi, Usercentrics and others). Nothing is accepted on your behalf. |
| `scrollPage` | `true` | Scroll down first so lazy-loaded images appear. |
| `elementSelector` | empty | CSS selector; capture only that element. |
| `waitStrategy` | `load` | `load`, `networkidle`, `fixed` (wait `waitDelaySeconds`) or `selector` (wait for `waitSelector`). |
| `darkMode` | `false` | Ask the page for its dark theme. |
| `blockAds` | `false` | Block a short list of ad and analytics domains. |
| `css` | empty | Extra CSS to apply before the shot, for example to hide a chat widget. |
| `timeoutSeconds` | `60` | Time allowed per page. |

### Output

Images and PDFs are saved in the run's key-value store. The dataset has one row per captured page with links to the
files:

```json
{
  "url": "https://example.com/",
  "finalUrl": "https://example.com/",
  "statusCode": 200,
  "title": "Example Domain",
  "viewport": {"width": 1440, "height": 900, "deviceScaleFactor": 1, "preset": "desktop"},
  "fullPage": true,
  "format": "png",
  "width": 1440,
  "height": 900,
  "byteSize": 41040,
  "fileUrl": "https://api.apify.com/v2/key-value-stores/<store>/records/capture-a0f1ed89a1f1e61ad1410eb5.png",
  "pdfUrl": "https://api.apify.com/v2/key-value-stores/<store>/records/capture-a0f1ed89a1f1e61ad1410eb5.pdf",
  "capturedAt": "2026-10-03T05:35:25Z",
  "warnings": []
}
```

Pages that fail (timeouts, blocked by the site, robots.txt disallows, 404) are listed in the `OUTPUT` record with the
reason and are not charged.

### Pricing

$2.50 per 1,000 captured pages on the Free plan, $2.25 on Starter, $1.90 on Scale and $1.50 on Business. A PDF of the same
page is included in that price. Failed pages cost nothing and there is no start fee.

### FAQ

**Does it work on pages behind a login?** No, public pages only.

**Some pages still show a pop-up.** Banners from unusual consent tools can slip through. Use `css` to hide them, for
example `#my-banner { display: none !important; }`.

**Why is a page cut off or blank at the bottom?** Very long pages with infinite scroll never end. Use `fullPage: false`
or an `elementSelector` for those.

**Is robots.txt respected?** Yes. Pages a site asks crawlers not to visit are skipped and reported in `OUTPUT`.

# Actor input Schema

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

Public web pages to capture. Duplicates are skipped.

## `viewport` (type: `string`):

Desktop, tablet or mobile size, or Custom to set your own width and height. Mobile pages are rendered with a phone user agent and touch support.

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

Used only when Device is Custom.

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

Used only when Device is Custom.

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

PNG by default. JPEG and WebP files are smaller.

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

JPEG and WebP only, 1 to 100. Default 85.

## `pdfFormat` (type: `string`):

A4 by default. The PDF always contains the whole page.

## `waitStrategy` (type: `string`):

When to take the shot: after the page load event (default), when the network goes quiet, after a fixed delay, or when a CSS selector appears.

## `waitDelaySeconds` (type: `number`):

Used with the fixed delay option. Default 2 seconds.

## `waitSelector` (type: `string`):

Used with the selector option, for example "#main" or ".price".

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

Optional CSS selector. The image then shows only the first visible matching element.

## `css` (type: `string`):

Optional CSS injected before capture, for example to hide a chat widget. Up to 20,000 characters.

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

How long one page may take, including loading and capture. Default 60.

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

How many pages are captured in parallel. Default 2.

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

Capture the whole scrollable page instead of only the visible window.

## `pdf` (type: `boolean`):

Save a PDF of each page next to the image.

## `printBackground` (type: `boolean`):

Keep background colours and images in the PDF.

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

Hide common cookie and consent pop-ups before capture. Nothing is accepted on your behalf.

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

Block common ad and tracking scripts for a cleaner, faster capture.

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

Ask the site for its dark colour scheme, if it has one.

## `scrollPage` (type: `boolean`):

Scroll through the page first so images that load on scroll are included.

## Actor input object example

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

# Actor output Schema

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

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

```

## MCP server setup

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