# Website Screenshot & Web Page to PDF (Full Page, No Ads) (`geeky_goth_gamer/url-to-screenshot-pdf`) Actor

Take full-page website screenshots (PNG/JPEG) or save web pages as PDF with real Chrome. Input: URLs. Output: image and PDF download links. Cookie banners and ads removed; mobile and tablet presets. $0.01 per file, error pages free.

- **URL**: https://apify.com/geeky_goth_gamer/url-to-screenshot-pdf.md
- **Developed by:** [Chris Day](https://apify.com/geeky_goth_gamer) (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 $10.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

## URL to Screenshot & PDF

Turn any public web page into a **full-page screenshot** (PNG or JPEG) and/or a **print-quality PDF**. It is built for monitoring, archiving, reports, social previews, compliance evidence and AI vision pipelines.

### When an AI agent should use this

Use `geeky_goth_gamer/url-to-screenshot-pdf` when:

- You need to SEE a web page: a screenshot to check layout, read a chart, verify a change or show a user.
- You need to save or archive a web page as a PDF (receipts, articles, terms, evidence).
- You want a mobile or tablet view of a page (`device`).

Don't use it for:

- Extracting page text or data (use a scraper or web-to-Markdown Actor).
- Pages behind a login.

**Example input:**

```json
{
  "urls": [
    "https://example.com"
  ],
  "outputs": [
    "screenshot",
    "pdf"
  ],
  "device": "desktop"
}
```

**Output:** One dataset item per URL with `screenshotUrl` / `pdfUrl` (download links), `httpStatus`, `title`, `warnings`.

**Cost:** $0.01 per screenshot and $0.01 per PDF. Error pages (HTTP 400+) are free.

**Call it from an agent:**

- Apify MCP server: add `https://mcp.apify.com/?tools=geeky_goth_gamer/url-to-screenshot-pdf` to your MCP client; the tool is `geeky_goth_gamer--url-to-screenshot-pdf`. Or use `call-actor` with `"actor": "geeky_goth_gamer/url-to-screenshot-pdf"`.
- Python: `ApifyClient(token).actor("geeky_goth_gamer/url-to-screenshot-pdf").call(run_input=...)`, then read `client.dataset(run["defaultDatasetId"]).list_items().items`.
- HTTP: `POST https://api.apify.com/v2/acts/geeky_goth_gamer~url-to-screenshot-pdf/run-sync-get-dataset-items?token=YOUR_TOKEN` with the input JSON as the body.

### Why this one

- **Clean captures:** common cookie-consent pop-ups are hidden (OneTrust, Cookiebot, Quantcast, Didomi, Usercentrics, TrustArc and more), major ad and tracking networks are blocked, and lazy-loaded images are triggered by scrolling first.
- **Fast on heavy sites:** slow ads and trackers never hold the capture hostage. The Actor waits up to 15 s for the page to finish loading, then captures. In our tests a heavy news home page took 7–11 s, against 47 s when waiting for every resource.
- **Device presets:** desktop (1280×800), laptop, desktop-hd (1920×1080), tablet (2×) and mobile (3×, mobile mode). You can also set your own width and height, and dark mode.
- **PDF options:** A4, Letter, Legal, A3 or Tabloid; landscape; margins; backgrounds; and either the on-screen look or the site's print stylesheet.
- **Fair billing:** you pay only per file created. Error pages (HTTP 4xx/5xx, such as bot blocks) are saved but **not charged**. Failed pages are free. The Actor respects your **maximum cost per run** and never starts a capture it can't pay for.
- **Secure:** the browser is forced through a filtering proxy that resolves every hostname itself, refuses private, local and cloud-metadata addresses and non-web ports, and then connects to the exact address it checked. This also stops DNS rebinding. Video and audio streams, downloads, service workers and pop-up windows are disabled.

### Input

| Field | Default | Notes |
|---|---|---|
| `urls` (required) | — | Up to 500. `example.com` is read as `https://example.com`. |
| `outputs` | `["screenshot"]` | `screenshot`, `pdf` or both. |
| `device` | `desktop` | `desktop`, `laptop`, `desktop-hd`, `tablet` or `mobile`. |
| `fullPage` | true | Whole scrolling page; it is cut at `maxScreenshotHeight` (default 10,000 px, maximum 20,000). |
| `imageFormat` / `jpegQuality` | png / 80 | JPEG files are about 3–5× smaller. |
| `pdfFormat`, `pdfLandscape`, `pdfMarginMm`, `pdfPrintBackground`, `pdfMedia` | A4, false, 10, true, screen | |
| `waitUntil` | `load` | `domcontentloaded`, `load` (waits up to 15 s) or `networkidle` (also waits up to 20 s for the network to go quiet). |
| `delaySeconds` | 1 | Extra wait before capture (0–30). |
| `waitForSelector` | — | A CSS selector that must be visible before capture. |
| `scrollToBottom`, `hideCookieBanners`, `blockAds` | true | |
| `hideSelectors` | — | CSS selectors to hide, e.g. `#chat-widget`. |
| `darkMode` | false | |
| `viewportWidth` / `viewportHeight` | from device | 320–3840 × 240–2160. |
| `timeoutSecondsPerUrl` | 60 | 10–180. |

### Output

Files are saved in the run's key-value store. Each URL gives one dataset item:

```json
{
  "url": "https://www.abc.net.au/news",
  "status": "ok",
  "finalUrl": "https://www.abc.net.au/",
  "httpStatus": 200,
  "title": "ABC News & Headlines – Australian Broadcasting Corporation",
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/0001-www.abc.net.au-e02ea26d.png",
  "screenshotWidth": 1280, "screenshotHeight": 10000, "screenshotBytes": 4697000,
  "pdfUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/0001-www.abc.net.au-e02ea26d.pdf",
  "pdfPages": 26, "pdfBytes": 16135058,
  "billedEvents": ["screenshot", "pdf"],
  "warnings": ["The page is 10998px tall; the screenshot was cut at 10000px (maxScreenshotHeight)."],
  "blockedRequests": 0, "adsBlocked": 2, "bytesDownloaded": 6659000, "durationSeconds": 10.6
}
```

Failures look like `{"url": ..., "status": "error", "error": "The domain name could not be found."}` and are never charged.

### Pricing

- **Screenshot:** $0.01 per screenshot created.
- **PDF:** $0.01 per PDF created.
- **Actor start:** Apify's standard start fee.

Error pages (HTTP status 400 or above) and failed URLs are free.

### Limitations

- **No login or cookie injection,** so pages behind a sign-in show the sign-in page.
- **No proxy rotation:** some sites block data-centre traffic (you'll see HTTP 403/429, not charged).
- **Cookie banners:** hiding covers the common consent platforms; unusual banners can be removed with `hideSelectors`.
- **Not web pages:** direct links to files (PDF, ZIP and so on) are refused with a clear message. Use a document converter for those.
- **Screenshot size:** very tall pages are cut at `maxScreenshotHeight` (and at 32,000 physical pixels at 2×/3× scale). Files over 50 MB are not saved.

### Local development

```bash
pip install -r requirements.txt playwright pytest pillow   # the Docker image already ships Playwright + Chromium
CHROME_EXECUTABLE_PATH=/usr/bin/google-chrome python -m pytest -p no:asyncio   # SKIP_NETWORK=1 skips live-site tests
apify run
```

# Actor input Schema

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

REQUIRED. Public web page URLs to capture, e.g. \["https://example.com", "news.ycombinator.com"]. Up to 500 per run; a URL without a scheme is read as https://. Private, local and intranet addresses are refused.

## `outputs` (type: `array`):

Which files to create for every URL: \["screenshot"] (default), \["pdf"], or \["screenshot", "pdf"]. Each file is billed separately; pages that return HTTP 400 or above are not billed.

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

Screen size preset. desktop 1280×800, laptop 1440×900, desktop-hd 1920×1080, tablet 820×1180 (2×), mobile 390×844 (3×).

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

Capture the whole scrolling page, not just the visible screen.

## `imageFormat` (type: `string`):

PNG is lossless; JPEG files are much smaller.

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

JPEG quality from 1 to 100. Only used when imageFormat is "jpeg".

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

Paper size for the PDF, e.g. A4 or Letter.

## `pdfLandscape` (type: `boolean`):

Print the PDF in landscape orientation.

## `pdfPrintBackground` (type: `boolean`):

Include background colours and images.

## `pdfMarginMm` (type: `integer`):

PDF margin in millimetres on all sides.

## `pdfMedia` (type: `string`):

"screen" looks like the website; "print" uses the site's printer-friendly styles if it has them.

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

When to capture. "load" waits up to 15 s for the page to finish loading; "networkidle" also waits up to 20 s for network activity to stop. Slow ads never block the capture.

## `delaySeconds` (type: `number`):

Wait this long after loading, e.g. for animations.

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

Optional CSS selector that must be visible before capture, e.g. #main.

## `scrollToBottom` (type: `boolean`):

Scrolls through the page first so lazy-loaded images appear.

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

Hides common cookie-consent pop-ups (OneTrust, Cookiebot, Quantcast, Didomi and more).

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

CSS selectors of elements to hide, e.g. .ad-banner or #chat-widget.

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

Skips requests to major ad and tracking networks. Pages load faster and screenshots are cleaner.

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

Ask the site for its dark theme (if it has one).

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

Optional. Browser width in CSS pixels; overrides the device preset.

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

Optional. Browser height in CSS pixels; overrides the device preset.

## `maxScreenshotHeight` (type: `integer`):

Full-page screenshots of very long pages are cut at this height in CSS pixels (a warning is added).

## `timeoutSecondsPerUrl` (type: `integer`):

Pages that take longer are captured as they are, or skipped (not billed).

## Actor input object example

```json
{
  "urls": [
    "https://example.com"
  ],
  "outputs": [
    "screenshot"
  ],
  "device": "desktop",
  "fullPage": true,
  "imageFormat": "png",
  "jpegQuality": 80,
  "pdfFormat": "A4",
  "pdfLandscape": false,
  "pdfPrintBackground": true,
  "pdfMarginMm": 10,
  "pdfMedia": "screen",
  "waitUntil": "load",
  "delaySeconds": 1,
  "scrollToBottom": true,
  "hideCookieBanners": true,
  "blockAds": true,
  "darkMode": false,
  "maxScreenshotHeight": 10000,
  "timeoutSecondsPerUrl": 60
}
```

# Actor output Schema

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

No description

## `files` (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("geeky_goth_gamer/url-to-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("geeky_goth_gamer/url-to-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 geeky_goth_gamer/url-to-screenshot-pdf --silent --output-dataset

```

## MCP server setup

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