# Website Screenshot & PDF API (`szabidev/website-screenshot-api`) Actor

Capture full-page or viewport screenshots and PDFs of any URL: PNG, JPEG or PDF, desktop/laptop/tablet/mobile, dark mode, cookie-banner hiding, element screenshots, custom CSS. Public file links in the output.

- **URL**: https://apify.com/szabidev/website-screenshot-api.md
- **Developed by:** [Szabi Dev](https://apify.com/szabidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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

## Website Screenshot & PDF API

Capture **screenshots and PDFs of any web page**: full page or visible screen, **PNG, JPEG or PDF**, on **desktop, laptop, tablet or mobile**. Hides cookie banners for clean shots, supports **dark mode**, **single-element screenshots** and custom CSS. Every capture gets a **public link** you can use straight away.

### What it's for

- **Website monitoring and archiving**: visual snapshots on a schedule.
- **Competitor tracking**: capture pricing pages and landing pages daily.
- **SEO and marketing reports**: mobile vs desktop screenshots for clients.
- **Thumbnails and link previews** for apps and directories.
- **PDF export** of articles, invoices or docs pages.
- **QA and visual checks** after deploys.

### Features

- Many URLs per run, captured in parallel.
- **Full page** (lazy images loaded by auto-scroll) or visible screen only.
- Devices: Desktop 1920×1080, Laptop 1366×768, Tablet 820×1180 (retina), Mobile 390×844 (retina, real mobile site), or a custom size.
- **Hide cookie / consent banners** visually (nothing is clicked or accepted).
- **Dark mode** for sites that support it.
- **Element screenshot** with a CSS selector (`#pricing`, `.hero`, `table`).
- **Custom CSS** injection (hide chat widgets, ads, popups).
- Extra wait time for animations; JPEG quality control.
- Failed URLs are listed with the error and are **not charged**.

### Input example

```json
{
  "urls": ["https://en.wikipedia.org/wiki/Web_scraping", "example.com"],
  "format": "png",
  "device": "mobile",
  "fullPage": true,
  "hideCookieBanners": true,
  "darkMode": false
}
```

### Output example

```json
{
  "url": "https://apify.com",
  "status": "ok",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/.../records/apify-com-1a2b3c4d.png",
  "format": "png",
  "device": "mobile",
  "width": 390,
  "height": 844,
  "fullPage": true,
  "bytes": 845123,
  "finalUrl": "https://apify.com/",
  "httpStatus": 200,
  "pageTitle": "Apify: Full-stack web scraping and data extraction platform"
}
```

### Pricing

**$3 per 1,000 captures** ($0.003 each), plus a tiny per-run start fee. Failed captures are free. No monthly rental. Platform usage is included.

### FAQ

**How long are files kept?** As long as the run's storage is kept under your Apify plan's data retention. Download them or copy `fileUrl` to your own storage if you need them forever.

**Pages behind a login?** Not supported; it captures what a logged-out visitor sees.

**Missing something?** Open an issue on the Issues tab. I usually reply within 24 hours.

# Actor input Schema

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

Pages to capture. 'example.com' works too.

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

PNG for sharp images, JPEG for small files, PDF for documents.

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

Viewport and device type. Tablet and mobile render the site's mobile layout at retina resolution.

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

Capture the whole scrollable page (up to 30,000 px tall) instead of only the visible screen.

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

Hides common consent pop-ups for clean captures (nothing is clicked or accepted).

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

Sites that support dark mode render dark.

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

e.g. #pricing, .hero, table. Captures just that element.

## `waitMs` (type: `integer`):

For pages with animations or late-loading content.

## `scrollToLoadLazyImages` (type: `boolean`):

Scrolls down the page before capture so lazy-loaded images appear.

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

Overrides the device width.

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

Custom height (px, optional).

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

Only for JPEG. Lower = smaller files.

## `customCss` (type: `string`):

e.g. hide a chat widget: .intercom-launcher { display:none !important }

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

How many pages are captured at the same time.

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

Use a proxy to capture pages as seen from another country.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Web_scraping",
    "https://example.com"
  ],
  "format": "png",
  "device": "desktop",
  "fullPage": true,
  "hideCookieBanners": true,
  "darkMode": false,
  "waitMs": 1000,
  "scrollToLoadLazyImages": true,
  "jpegQuality": 85,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

All captures as a table (also JSON, CSV, Excel via the dataset API).

# 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://en.wikipedia.org/wiki/Web_scraping",
        "https://example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("szabidev/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://en.wikipedia.org/wiki/Web_scraping",
        "https://example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("szabidev/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://en.wikipedia.org/wiki/Web_scraping",
    "https://example.com"
  ]
}' |
apify call szabidev/website-screenshot-api --silent --output-dataset

```

## MCP server setup

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