# Website Screenshot Generator - Full Page, Mobile, PDF (`tonyginkleheim/website-screenshot-generator`) Actor

Take screenshots of any list of websites as PNG, JPEG or PDF. Desktop, laptop, tablet or mobile, full page or a single element, dark mode, cookie banners hidden. You get a direct link to every file and pay only for successful screenshots.

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

## Pricing

$2.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

### What this screenshot tool does

It opens each URL in a real Chrome browser and saves a screenshot as PNG, JPEG or a PDF. You can capture the first screen or the full scrollable page, emulate a laptop, tablet or phone, switch on dark mode, or capture a single element with a CSS selector.

Cookie and consent popups are clicked away or hidden before the capture, so you get the page and not the banner. Each file gets a direct download link in the results.

### Features

- Devices: desktop 1920x1080, laptop 1366x768, iPad and iPhone 14, or any custom width and height
- Full page capture that scrolls first so lazy images load
- PNG, JPEG with a quality setting, or an A4 PDF
- Element screenshots with a CSS selector, for example `header` or `#pricing`
- Dark mode through `prefers-color-scheme`
- Wait until load, HTML parsed or network idle, plus an optional extra delay
- Video and audio blocked by default to keep runs quick

### Typical uses

- Visual archives of competitor pages or landing pages
- Thumbnails for link directories and dashboards
- Proof of how a page looked on a given date
- Mobile and dark mode checks across many URLs at once

### Output example

Values are illustrative.

```json
{
  "url": "https://example.com",
  "finalUrl": "https://example.com/",
  "title": "Example Domain",
  "httpStatus": 200,
  "device": "desktop",
  "format": "png",
  "bytes": 48213,
  "fileName": "example.com_327c3fda87.png",
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/.../records/example.com_327c3fda87.png",
  "status": "ok"
}
```

The files are also stored in the run's key-value store, where you can download them all at once.

### Pricing

| Event | Charged when |
|---|---|
| `screenshot` | a screenshot or PDF was saved |

Pages that fail to load (DNS errors, timeouts) are retried once and are not charged if they still fail.

### FAQ

#### Some popups are still visible. What can I do?

Most consent tools are handled, but not every custom popup. Add a short extra delay, or use the element selector to capture just the part you need.

#### Can it log in to a page first?

No. It captures pages that are publicly reachable.

#### What about sites that block bots?

Switch on the proxy. A residential proxy helps with many of them.

# Actor input Schema

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

Pages to capture, one per line.

## `startUrls` (type: `array`):

Optional. Upload a list or link a file of URLs.

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

Viewport and device emulation.

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

Capture the whole scrollable page instead of the first screen.

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

File type.

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

Only for JPEG.

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

Clicks Accept where possible and hides common consent popups.

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

Render with prefers-color-scheme: dark.

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

Optional CSS selector. Captures only that element.

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

When the page counts as ready.

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

Wait this long before capturing, for animations or late content.

## `scrollToLoad` (type: `boolean`):

Only for full page.

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

Overrides the device width. Set height too.

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

Overrides the device height.

## `timeoutSecs` (type: `integer`):

Give up on a page after this long.

## `blockMedia` (type: `boolean`):

Faster and cheaper.

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

Parallel requests.

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

Proxy settings.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com"
  ],
  "device": "desktop",
  "fullPage": false,
  "format": "png",
  "jpegQuality": 80,
  "hideCookieBanners": true,
  "darkMode": false,
  "waitUntil": "load",
  "delayMs": 0,
  "scrollToLoad": true,
  "timeoutSecs": 45,
  "blockMedia": true,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

All results as JSON

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

Every saved file

# 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": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tonyginkleheim/website-screenshot-generator").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": False },
}

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

```

## MCP server setup

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

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/5s8DK67qiH2Zo9E16/builds/K6qgNODV1gqAk7jfD/openapi.json
