# Website Screenshot (`sagnato/website-screenshot`) Actor

Screenshots of web pages as PNG, JPEG or PDF: the visible screen, the full page or one element. Free and polite: obeys robots.txt, opens one page per site at a time and keeps no personal data. Pages that block bots still get an image, with a plain note saying so.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 (PNG, JPEG, PDF, full page or element)

Take screenshots of public web pages, in bulk. For each URL you get an image or PDF in the run's key-value store and a row in the dataset with a link to the file, its size, the page's HTTP status and, when a page could not be captured, the reason.

### What you can set

- **What to capture**: the visible window (above the fold, at the width and height you set), the full page (up to a maximum height, so endless pages still finish), or one element picked by a CSS selector.
- **File type**: PNG, JPEG (with quality) or PDF.
- **Width, height and pixel density** (1× or 2× for sharp images).
- **Waiting**: every capture waits for the page to load, the network to go quiet, web fonts and images to finish. You can add "wait for this element" and an extra delay.
- **Lazy images**: optionally scroll down and back up before the capture so images that load on scroll appear.
- **Sticky headers and banners**: hidden by default in full-page and element captures, so they don't repeat down the image or cover content.
- **Dark mode**, where the page has one.
- **Time limit per page**: a page that hasn't finished by then is reported as failed, so one slow page can't use up the whole run.

Only the URLs are required; everything else has a default. Emoji and Chinese, Japanese and Korean text render properly.

### Polite by design

- Only public addresses are opened, and every request the page makes is checked the same way.
- robots.txt is read first and obeyed for our crawler, SagnatoBot.
- Pages on one site are opened one at a time, at least a second apart, or slower if the site's Crawl-delay asks.
- Video and audio are skipped.
- Nothing is kept but the files you asked for, in your own run storage.

### Cost

The actor is free; you only pay Apify platform usage. It runs at 2 GB of memory by default. In our test, 10 well-known pages took under a minute and cost under half a cent in total.

### When a site blocks bots

Some sites answer data-centre visitors with an error page (403). The actor still saves what the page showed and says so in the row: "the page answered 403; the image shows that error page". It never tries to get around a block.

# Actor input Schema

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

Full URLs of the pages to capture, one per line. Up to 1,000 per run.

## `capture` (type: `string`):

The visible window (above the fold), the whole page, or one element picked by a CSS selector.

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

CSS selector of the element to capture when "What to capture" is "One element", for example main or #pricing.

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

PNG keeps every pixel, JPEG is smaller, PDF keeps text selectable.

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

Browser window width.

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

Browser window height, which is the image height for "Visible window".

## `maxHeight` (type: `integer`):

A full-page capture stops here, so endless pages still finish.

## `scale` (type: `integer`):

1 for normal screens, 2 for sharp (retina) images at twice the size.

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

30 to 100. Only used for JPEG.

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

Optional CSS selector to wait for before capturing, for pages that load content late.

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

Extra time to wait after the page, its fonts and images have loaded. Most pages need none.

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

Scroll down the page (for at most 10 s) and back up before capturing, so images that load on scroll appear.

## `hideStickyElements` (type: `boolean`):

Hides fixed and sticky bars (headers, cookie banners, chat bubbles) in full-page and element captures, so they don't repeat or cover content.

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

Ask the page for its dark theme, where it has one.

## `pageTimeoutSecs` (type: `integer`):

A page that has not finished by then is reported as failed, so one slow page cannot use up the run.

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

Pages captured in parallel. Pages on one site are always opened one at a time, at least a second apart.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://en.wikipedia.org/wiki/Web_page"
  ],
  "capture": "viewport",
  "format": "png",
  "width": 1280,
  "height": 800,
  "maxHeight": 10000,
  "scale": 1,
  "jpegQuality": 80,
  "delayMs": 0,
  "scrollToLoad": false,
  "hideStickyElements": true,
  "darkMode": false,
  "pageTimeoutSecs": 30,
  "maxConcurrency": 3
}
```

# Actor output Schema

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

One result per URL: link to the file, size, status and the reason when a page could not be captured.

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

Every screenshot, stored in the run's key-value store.

## `report` (type: `string`):

The same results as a readable Markdown report.

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

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

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

```

## MCP server setup

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

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/iBoLlnJjUnBzKnn2j/builds/hNHbeMSm0U8biQVvg/openapi.json
