# Website Screenshot API — Full Page, PNG/JPG/PDF, Retina (`x402opklaar/website-screenshot-api`) Actor

URLs in, screenshots out: full-page or viewport PNG/JPEG, whole-page PDF, retina (2x) scaling, custom viewport, dark-mode, element capture and consent-banner hiding. Failed pages are reported and never charged.

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

## Pricing

$4.00 / 1,000 screenshot captureds

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/platform/actors/running/actors-in-store#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 API — Full Page, PNG/JPG/PDF, Retina

URLs in, screenshots out. Render any web page to a **full-page** or **viewport** image (PNG or JPEG), or the whole page to a **PDF** — with retina scaling, a custom viewport, dark-mode emulation, single-element capture, and automatic consent-banner hiding. Each result comes back as a ready-to-use image URL.

- **Full-page or viewport** capture, PNG / JPEG / PDF
- **Retina (2x)** high-DPI output for crisp thumbnails and previews
- **Custom viewport** (width × height) — emulate desktop, tablet, or a fixed card size
- **Dark mode** via `prefers-color-scheme: dark`
- **Element capture** — pass a CSS `selector` to screenshot just one component
- **Clean shots** — common cookie/consent banners (OneTrust, Cookiebot, Usercentrics, …) hidden automatically; add your own with `hideSelectors`
- **Honest pricing** — you pay only for screenshots actually produced. Navigation errors and timeouts are reported and **never charged**

### Input

```json
{
    "urls": ["https://apify.com", "https://news.ycombinator.com"],
    "format": "png",
    "fullPage": true,
    "viewportWidth": 1280,
    "viewportHeight": 800,
    "deviceScaleFactor": 2,
    "darkMode": false,
    "waitUntil": "networkidle",
    "delayMs": 0
}
```

### Output (one dataset item per URL)

```json
{
    "url": "https://apify.com",
    "format": "png",
    "http_status": 200,
    "screenshotUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/screenshot-001-apify-com.png",
    "key": "screenshot-001-apify-com.png",
    "bytes": 412034,
    "viewport": "1280x800@2x",
    "fullPage": true
}
```

`screenshotUrl` is a public link to the stored image/PDF — embed it, download it, or hand it straight to an LLM.

### Pricing

One event: `screenshot-captured` — charged **only when an image or PDF is produced**. A page that fails to load, times out, or where the `selector` isn't found is reported with an `error` and **not charged**.

### Typical uses

- **Link previews / OG thumbnails** for apps, chat, and dashboards
- **Visual change monitoring** and QA snapshots
- **PDF archiving** of articles, invoices, or receipts
- **Feeding page images to vision LLMs** for layout understanding
- **Design galleries** and competitor-page capture at retina quality

### Works with AI agents

Exposed via Apify's MCP server — an agent can call *"screenshot this URL full-page at retina"* and get back an image URL in one step.

### FAQ

**Full-page PDF?** `format: "pdf"` renders the entire page to PDF (the `fullPage` and `selector` options don't apply to PDF).

**Bot-protected or geo-blocked pages?** Turn on `useApifyProxy`.

**Lazy-loaded content missing?** Increase `delayMs`, or set `waitUntil: "networkidle"` (the default).

**Bulk?** Pass many URLs; each is one dataset row and one charge, failures never charged.

# Actor input Schema

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

Page URLs to capture. Missing scheme defaults to https://.

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

png and jpeg are images; pdf renders the whole page to a PDF document.

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

Capture the entire scrollable page (images only). Turn off for just the viewport.

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

Browser viewport width in CSS pixels.

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

Browser viewport height in CSS pixels (the visible area; full-page shots extend beyond it).

## `deviceScaleFactor` (type: `string`):

2 produces high-DPI (retina) images at double resolution.

## `selector` (type: `string`):

CSS selector to capture a single element instead of the page. Ignored for PDF.

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

Emulate prefers-color-scheme: dark.

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

Navigation completion signal before capturing.

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

Additional wait after navigation, for late animations or lazy content (max 15000).

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

1–100, only applies to JPEG.

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

CSS selectors to hide before capture (added to the built-in consent/cookie banner list).

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

Route the browser through Apify proxy. Enable for geo-blocked or bot-guarded pages.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com"
  ],
  "format": "png",
  "fullPage": true,
  "viewportWidth": 1280,
  "viewportHeight": 800,
  "deviceScaleFactor": "1",
  "darkMode": false,
  "waitUntil": "networkidle",
  "delayMs": 0,
  "jpegQuality": 80,
  "useApifyProxy": 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://apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("x402opklaar/website-screenshot-api").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"] }

# Run the Actor and wait for it to finish
run = client.actor("x402opklaar/website-screenshot-api").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"
  ]
}' |
apify call x402opklaar/website-screenshot-api --silent --output-dataset

```

## MCP server setup

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

```

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/u6g7YjHghiIK3tTvZ/builds/ergWS0pa61WPIURdI/openapi.json
