# Website Screenshot & PDF Capture - Full Page, Any Viewport (`samer-samaha/site-screenshot-pro`) Actor

Capture any web page as a PNG, JPEG or PDF. Full-page or viewport, custom size and scale, wait-for-selector support for pages that load late.

- **URL**: https://apify.com/samer-samaha/site-screenshot-pro.md
- **Developed by:** [Sam S](https://apify.com/samer-samaha) (community)
- **Categories:** Developer tools, Automation, AI
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 item 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 Capture - Full Page, Any Viewport

Capture any web page as a PNG, JPEG or PDF. Full-page or viewport, custom size and scale, wait-for-selector support for pages that load late.

### What you get

Every row contains:

- `input`
- `url`
- `format`
- `fileUrl`
- `fileKey`
- `fullPage`
- `timestamp`

```json
{
  "input": "https://apify.com",
  "url": "https://apify.com",
  "format": "png",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/smoke/records/https___apify_com_1787659722333.png",
  "fileKey": "https___apify_com_1787659722333.png",
  "fullPage": true,
  "timestamp": "2026-08-25T12:08:42.333Z"
}
```

### Input

| Field | Type | Required | Description |
|---|---|---|---|
| `urls` | array | yes | List of web page URLs to screenshot or convert to PDF. You can paste one or many. |
| `format` | string | no | Choose PNG or JPEG for an image, or PDF to save the page as a document. Default: `"png"`. |
| `fullPage` | boolean | no | When on, captures the entire scrollable page instead of just the visible area. Ignored for PDF (PDFs always paginate the full page). Default: `true`. |
| `waitUntil` | string | no | How the browser decides the page has started loading before it looks for extra readiness signals. 'domcontentloaded' works for almost all sites. Default: `"domcontentloaded"`. |
| `waitForNetworkIdle` | boolean | no | After the page loads, wait a bit longer for background requests (images, fonts, analytics) to settle down before capturing. Recommended for most sites. Default: `true`. |
| `networkIdleTimeout` | integer | no | Maximum time to wait for the network to go quiet before capturing anyway. Prevents the run from hanging on pages with constant background activity. Default: `12000`. |
| `waitForSelector` | string | no | Optional. If the page loads content dynamically, give a CSS selector (e.g. '#main-content') and the capture will wait until it appears. Default: `""`. |
| `extraWaitMs` | integer | no | Optional extra pause after all other waiting, useful for slow animations or lazy-loaded images. Default: `0`. |
| `viewportWidth` | integer | no | Width of the simulated browser window used for the capture. Default: `1280`. |
| `viewportHeight` | integer | no | Height of the simulated browser window used for the capture. Default: `800`. |
| `timeout` | integer | no | Maximum time to wait for the page to load before giving up on that URL. Default: `30000`. |
| `pdfFormat` | string | no | Paper size to use when the output format is PDF. Default: `"A4"`. |
| `landscape` | boolean | no | When on, PDF pages are generated in landscape orientation instead of portrait. Default: `false`. |
| `omitBackground` | boolean | no | When on, removes the default white background — useful for PNG screenshots of elements with transparency. Has no effect on JPEG or PDF. Default: `false`. |
| `proxyConfiguration` | object | no | Requests go out through this proxy. The datacenter pool stalled on page loads in testing, so residential is the default; clear it entirely if you would rather use Apify own IPs. Default: `{"useApifyProxy":true,"apifyProxyGroups":["RESIDENTIAL"]}`. |

### Use cases

- Visual regression checks — capture the same pages on a schedule and diff them.
- Archiving evidence of what a page looked like on a given date.
- Generating preview images for link cards, reports or dashboards.

### Pricing

$4.00 per 1,000 results. You are charged once per record written to the dataset, and never for a result you do not receive — validation failures and duplicates are dropped before billing.

**The first 3 items of every run are free**, so you can check that the output has the fields you need before paying for any of it.

### Notes

- Full-page or viewport capture, PNG, JPEG or PDF, with custom width, height and device scale.
- `waitForSelector` and `extraWaitMs` handle pages that render late — use them before blaming the capture.
- Files are written to the run's key-value store and the record carries a direct `fileUrl`.

### Support

Open an issue on this Actor if a field stops populating or a run returns nothing. Selector drift is a bug, not a fact of life — these parsers are re-tested weekly against the live site.

# Actor input Schema

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

List of web page URLs to screenshot or convert to PDF. You can paste one or many.

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

Choose PNG or JPEG for an image, or PDF to save the page as a document.

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

When on, captures the entire scrollable page instead of just the visible area. Ignored for PDF (PDFs always paginate the full page).

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

How the browser decides the page has started loading before it looks for extra readiness signals. 'domcontentloaded' works for almost all sites.

## `waitForNetworkIdle` (type: `boolean`):

After the page loads, wait a bit longer for background requests (images, fonts, analytics) to settle down before capturing. Recommended for most sites.

## `networkIdleTimeout` (type: `integer`):

Maximum time to wait for the network to go quiet before capturing anyway. Prevents the run from hanging on pages with constant background activity.

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

Optional. If the page loads content dynamically, give a CSS selector (e.g. '#main-content') and the capture will wait until it appears.

## `extraWaitMs` (type: `integer`):

Optional extra pause after all other waiting, useful for slow animations or lazy-loaded images.

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

Width of the simulated browser window used for the capture.

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

Height of the simulated browser window used for the capture.

## `timeout` (type: `integer`):

Maximum time to wait for the page to load before giving up on that URL.

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

Paper size to use when the output format is PDF.

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

When on, PDF pages are generated in landscape orientation instead of portrait.

## `omitBackground` (type: `boolean`):

When on, removes the default white background — useful for PNG screenshots of elements with transparency. Has no effect on JPEG or PDF.

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

Requests go out through this proxy. The datacenter pool stalled on page loads in testing, so residential is the default; clear it entirely if you would rather use Apify own IPs.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com"
  ],
  "format": "png",
  "fullPage": true,
  "waitUntil": "domcontentloaded",
  "waitForNetworkIdle": true,
  "networkIdleTimeout": 12000,
  "waitForSelector": "",
  "extraWaitMs": 0,
  "viewportWidth": 1280,
  "viewportHeight": 800,
  "timeout": 30000,
  "pdfFormat": "A4",
  "landscape": false,
  "omitBackground": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All records found in this run.

## `files` (type: `string`):

Files produced by this run, in the key-value store.

# 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://apify.com"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("samer-samaha/site-screenshot-pro").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://apify.com"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("samer-samaha/site-screenshot-pro").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://apify.com"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call samer-samaha/site-screenshot-pro --silent --output-dataset

```

## MCP server setup

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

```

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/zHdrskDv86LM2aZmN/builds/jmW6jKJKgMwFDQQSc/openapi.json
