# Full page screenshot (`practicaltools/apify-screenshot`) Actor

This Apify actor takes full-page screenshots of web pages with support for lazy loading content and provides temporary download URLs.

- **URL**: https://apify.com/practicaltools/apify-screenshot.md
- **Developed by:** [Practical Tools](https://apify.com/practicaltools) (community)
- **Categories:** Automation, Developer tools
- **Features:** Full permissions, Single-tenant, Server interface
- **Stats:** 56 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 1.00 out of 5 stars

## Pricing

from $50.00 / 1,000 successfully captured screenshots

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Web Screenshot Crawler - Apify Actor

This Apify actor takes full-page screenshots of web pages with support for lazy loading content and provides temporary download URLs.

### Features

- **Full-page screenshots**: Captures the entire page content
- **Lazy loading support**: Automatically scrolls through the page to trigger lazy-loaded content
- **Stealth browsing**: Uses Apify's built-in stealth capabilities
- **Proxy support**: Optional proxy configuration for requests
- **Temporary URLs**: Provides temporary download URLs that expire after 5 minutes
- **Configurable inputs**: Customize URL and CSS selector
- **Error handling**: Robust error handling with detailed logging
- **Pay-per-success**: Only charges when screenshots are successfully generated

### Pricing

This actor uses a **pay-per-success** model:

- ✅ **Charged only on success**: You're only charged when a screenshot is successfully generated
- ❌ **No charge on failure**: Failed runs (errors, timeouts, etc.) are not charged
- 💰 **Cost-effective**: Pay only for what you get

### Input Parameters

- **url** (required): The URL of the web page to screenshot
- **selector** (optional): CSS selector to wait for before taking the screenshot. Leave empty to skip waiting and take screenshot immediately after page load.
- **proxyConfiguration** (optional): Proxy configuration to use for the requests. Leave empty for no proxy.

### Output

The actor returns:

1. **Dataset**: JSON data with temporary download URL, metadata, and screenshot info
2. **Temporary Screenshot**: Stored temporarily in key-value store with auto-expiration

### API Response Example

```json
{
    "url": "https://dribbble.com/shots/26219895-Volio-Crypto-Banking-website",
    "screenshot": {
        "downloadUrl": "https://api.apify.com/v2/key-value-stores/{STORE_ID}/records/temp_screenshot_1751639090941.png",
        "filename": "temp_screenshot_1751639090941.png",
        "format": "png",
        "size": 2731255,
        "expiresNote": "This URL will expire automatically after 5 minutes",
        "runId": "abc123"
    },
    "timestamp": "2025-07-04T14:24:50.946Z",
    "status": "success"
}
```

### Usage

#### Getting the Screenshot

1. **Run the actor** via API or Apify Console
2. **Get the dataset** from the actor run
3. **Download the screenshot** using the `downloadUrl` from the response
4. **URL expires** automatically when the actor run is deleted

#### API Access

```javascript
// Get the dataset
const dataset = await apifyClient.dataset('your-dataset-id').listItems();
const result = dataset.items[0];

// Download the screenshot
const response = await fetch(result.screenshot.downloadUrl);
const imageBuffer = await response.buffer();
```

### Temporary Storage

- Screenshots are stored temporarily in the key-value store
- URLs expire automatically after 5 minutes
- No permanent storage costs
- Perfect for API integrations and temporary screenshot needs

# Actor input Schema

## `url` (type: `string`):

The URL of the web page to take a screenshot of

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

CSS selector to wait for before taking the screenshot. Leave empty to skip waiting for any specific element.

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

Proxy to use for the requests. Leave empty for no proxy.

## Actor input object example

```json
{
  "url": "https://example.com/",
  "selector": "",
  "proxyConfiguration": {}
}
```

# 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 = {
    "url": "https://example.com/",
    "selector": "",
    "proxyConfiguration": {}
};

// Run the Actor and wait for it to finish
const run = await client.actor("practicaltools/apify-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 = {
    "url": "https://example.com/",
    "selector": "",
    "proxyConfiguration": {},
}

# Run the Actor and wait for it to finish
run = client.actor("practicaltools/apify-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 '{
  "url": "https://example.com/",
  "selector": "",
  "proxyConfiguration": {}
}' |
apify call practicaltools/apify-screenshot --silent --output-dataset

```

## MCP server setup

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