# Website Screenshot & PDF API (`synthetic.ia/web-screenshot-pdf`) Actor

Render any public URL to a PNG/JPEG screenshot (viewport or full page) or a PDF, with size, format, quality, wait and proxy options. Playwright Chromium. Clean HTTP API + MCP. Pay per render.

- **URL**: https://apify.com/synthetic.ia/web-screenshot-pdf.md
- **Developed by:** [Synthetic](https://apify.com/synthetic.ia) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 renders

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 & PDF API

Render **any public web page** to a **screenshot** (PNG or JPEG) or a **PDF**, behind a clean HTTP API (and MCP tool). Viewport or **full-page** capture, custom size, retina scale, JPEG quality, paper size and orientation for PDFs, wait strategies, an extra delay for lazy content, and optional **Apify Proxy** for pages that block datacenter IPs. Powered by a real **Chromium** browser. Pay per render.

- 📸 **Screenshot** — PNG or JPEG, viewport or full page, custom width/height, retina `deviceScaleFactor`.
- 📄 **PDF** — A4/Letter/Legal/A3…, portrait or landscape, with or without backgrounds, custom scale and margins.
- ⏱️ **Control the wait** — `waitUntil` (load / DOM ready / network idle) plus an optional `delayMs` for animations and lazy images.
- 🛡️ **Safe by design** — only public http(s) URLs; localhost, private, link-local and cloud-metadata addresses are refused.
- 🌐 **Optional proxy** — route through Apify Proxy (incl. residential) for pages that block datacenter IPs.
- 💵 Pay per render.

### The use case it was built for

Thumbnails for links, PDF exports of invoices and reports, visual regression snapshots, "render this page for my agent" — one call in, a hosted image or PDF URL out. No browser to run, no key.

### Sample output (`screenshot`, url "https://example.com")

```json
{
  "ok": true, "operation": "screenshot", "requestedUrl": "https://example.com",
  "contentType": "image/png", "key": "screenshot-1750000000000-a1b2c3.png",
  "url": "https://api.apify.com/v2/key-value-stores/<storeId>/records/screenshot-1750000000000-a1b2c3.png",
  "format": "png", "fullPage": false, "title": "Example Domain",
  "finalUrl": "https://example.com/", "bytes": 26543, "width": 1280, "height": 800
}
```

The `url` points at the rendered file in the run's key-value store (fetch it with a plain GET — no token needed for the record).

### How to use

- **HTTP API (Standby):** POST or GET `/screenshot`, `/pdf`. `GET /` returns help. Example: `GET /screenshot?url=https://news.ycombinator.com&fullPage=true`.
- **Normal run:** pass `{ operation, url, ... }`; the JSON result lands in the dataset + key-value store, and the rendered file is stored alongside it.
- **MCP tool:** expose it to your agent via Apify's MCP server.

### Input

- **operation** — `screenshot` · `pdf`. **url** — the page to render.
- Screenshot: **fullPage**, **format** (png/jpeg), **quality**, **width**, **height**, **deviceScaleFactor**.
- PDF: **paper** (A4/Letter/…), **landscape**, **printBackground**, **scale**, **margin**.
- Both: **waitUntil**, **delayMs**, **timeoutMs**, **useApifyProxy** (+ **apifyProxyGroups**).

### Pricing

**Per render** from **$0.008** (down to $0.003 on higher tiers). One successful screenshot or PDF = one render.

### Related Actors

- **[PDF Tools](https://apify.com/synthetic.ia/pdf-tools)** — merge, split, extract, render existing PDFs.
- **[Image Converter](https://apify.com/synthetic.ia/image-converter)** — convert, resize and optimize images.

### FAQ

**Do I need a key?** No. For pages that block datacenter IPs, enable `useApifyProxy` (proxy usage is billed by Apify separately).

**Can it capture the whole page?** Yes — set `fullPage: true` for a screenshot.

**Why is my screenshot missing late content?** Increase `delayMs`, or set `waitUntil: networkidle` so lazy images and fonts finish loading.

**Which private URLs are blocked?** Anything non-public: localhost, `10.x`, `192.168.x`, `172.16–31.x`, `169.254.x` (incl. cloud metadata) and their IPv6 equivalents.

### Notes & limits

Uses Playwright Chromium (a real browser is required to render pages faithfully). Rendered files live in the key-value store for the run's retention window. Navigation timeout is capped at 60s. Some sites deliberately block automated browsers.

# Changelog

This Actor's version history is a separate document: https://apify.com/synthetic.ia/web-screenshot-pdf/changelog.md

# Actor input Schema

## `operation` (type: `string`):

Render a screenshot or a PDF.

## `url` (type: `string`):

The public page to render (http/https).

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

Capture the whole scrollable page, not just the viewport.

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

PNG (lossless) or JPEG (smaller).

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

1–100, only for JPEG.

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

Browser width in px.

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

Browser height in px (ignored for full-page height).

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

1–3; 2 doubles the pixel density.

## `paper` (type: `string`):

PDF page size.

## `landscape` (type: `boolean`):

Landscape orientation.

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

Include background colors/images.

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

When to consider the page loaded before capturing.

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

Wait this long after load before capturing (0–15000).

## `timeoutMs` (type: `integer`):

Max time to load the page (3000–60000).

## `useApifyProxy` (type: `boolean`):

Route the browser through Apify Proxy (for pages that block datacenter IPs).

## `apifyProxyGroups` (type: `array`):

Optional proxy groups (e.g. RESIDENTIAL). Leave empty for the default.

## Actor input object example

```json
{
  "operation": "screenshot",
  "url": "https://example.com",
  "fullPage": false,
  "format": "png",
  "quality": 80,
  "width": 1280,
  "height": 800,
  "deviceScaleFactor": 1,
  "paper": "A4",
  "landscape": false,
  "printBackground": true,
  "waitUntil": "load",
  "delayMs": 0,
  "timeoutMs": 30000,
  "useApifyProxy": false,
  "apifyProxyGroups": []
}
```

# Actor output Schema

## `result` (type: `string`):

No description

## `runs` (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 = {
    "url": "https://example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("synthetic.ia/web-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 = { "url": "https://example.com" }

# Run the Actor and wait for it to finish
run = client.actor("synthetic.ia/web-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 '{
  "url": "https://example.com"
}' |
apify call synthetic.ia/web-screenshot-pdf --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,synthetic.ia/web-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/gAwZWGWpro1cgsoge/builds/9KXfpPZQFaXZtDNeJ/openapi.json
