# Website Screenshot API for AI Agents (closes cookie banners) (`emttn/url-screenshot`) Actor

Website screenshot API: give it page URLs and get a PNG screenshot of each for AI agents, with the cookie or consent banner rejected or closed first. Never clicks through logins or paywalls, never hangs, respects robots.txt; charged per screenshot delivered, failed pages are free.

- **URL**: https://apify.com/emttn/url-screenshot.md
- **Developed by:** [Frameskim Tools](https://apify.com/emttn) (community)
- **Categories:** AI, Agents, Developer tools
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## URL Screenshot for AI Agents (closes cookie banners)

Give it page URLs and get a PNG screenshot of each one for AI agents, the way a person sees the page, without the cookie or consent banner on top. Built for AI agents and automations that need to look at a page: visual checks, evidence, archiving. One item per URL, with a signed link to the PNG. It is also an MCP server (`/mcp`) and HTTP API (`/screenshot`) for one page's viewport per call, charged per screenshot, without starting a run in your account; full pages still need a run (see Server interface below).

More: [URL Screenshot on frameskim.dev](https://frameskim.dev/url-screenshot)

### How it works

- Each URL is opened in headless Chromium as the FrameskimFetch bot, respecting robots.txt on every hop of the page and of its navigations, and only on public addresses. The images, styles and scripts the page loads are fetched as any browser fetches them.
- Cookie and consent banners are handled before the screenshot: the known consent platforms (OneTrust, Cookiebot, Didomi, Quantcast, TrustArc, Usercentrics and more) and a generic check in seven languages. The banner is rejected when there is a reject button, else accepted, else hidden (or left when hiding it could remove page content). Each item says what was done (`banner`).
- A box it recognizes (by its words in seven languages or a password field) as asking to log in, sign up, subscribe or pay, such as a paywall or an "accept or subscribe" wall, is never clicked or hidden: the screenshot shows it and the item says why.
- Nothing hangs: every page has hard time limits; a page that never finishes loading is captured as it is.
- Many sites show their banner only to visitors from Europe, so many pages have no banner to close.

### What you get

```json
{
  "url": "https://frameskim.dev/",
  "finalUrl": "https://frameskim.dev/",
  "title": "Frameskim: tools for AI agents",
  "screenshotUrl": "https://api.apify.com/v2/key-value-stores/aBcDeF123/records/screenshot-3f2a9c1d5e7b8a40?signature=...",
  "screenshotKey": "screenshot-3f2a9c1d5e7b8a40",
  "fullPage": false,
  "width": 1280,
  "height": 800,
  "bytes": 184233,
  "truncated": false,
  "banner": {"found": true, "action": "rejected", "framework": "Cookiebot", "reason": null}
}
```

- `screenshotUrl` is a signed link to the PNG in the run's key-value store; `screenshotKey` is its key there. The link stops working when Apify deletes the run's storage (unnamed storages expire after 7 days by default), so copy the PNG if you need it longer.
- `banner.action` is `rejected`, `accepted`, `hidden` or `left` (a login, sign-up or paywall box, or a banner it will not touch); `reason` says why when it was left or hidden.
- `truncated` is true when a full page was cut at the pixel cap.
- A URL that could not be captured has `url` and `error`, with the reason, and is not charged.
- The run's status message says how many screenshots were delivered and failed, and why the run stopped early, if it did.
- If nothing is delivered, the run still ends as succeeded: each page that failed is in the dataset with its `error`, the status message gives the first reason, and nothing was charged.

### Input

| Field | What it does |
|---|---|
| `urls` | From 1 to 100 public http or https URLs of HTML pages. A repeated URL is opened once. |
| `fullPage` | Capture the whole page instead of the window, up to 7,000 px tall at 1280 px wide. |
| `width` | Window width, from 320 to 1920 px (default 1280). |
| `height` | Window height, from 320 to 1080 px (default 800); a full page grows past it. |
| `closeBanners` | Reject, accept or hide the cookie or consent banner first (on by default). |

### Server interface (HTTP and MCP)

The actor is also a multi-tenant Server Actor: send a request to its server URL (on the Server tab) with your Apify API token in `Authorization: Bearer <token>` and get one screenshot back at once. You pay only the `screenshot` event of each screenshot delivered; no run starts in your account.

- `GET /screenshot?url=<page URL>&width=1280&height=800` or `POST /screenshot` with `{"url": "...", "width": 1280, "height": 800, "closeBanners": true}`: `200` with a run's item, without the key-value store link, plus `png` (the PNG as base64) and `mimeType`. A page that cannot be captured comes back as `422` with its `error`, and a bad URL or size as `400`; neither is charged.
- `POST /mcp`: an MCP server (streamable HTTP, stateless) with one tool, `url_screenshot`, that takes the same fields. Add the MCP URL from the Server tab to your agent with your token as the bearer.
- The viewport only, 18 seconds per request and a PNG up to 1 MB: full pages, larger screenshots and very heavy pages need a run of the actor. The page sends no request but GET or HEAD (no forms, uploads or tracking beacons). If your requests cost far more than the screenshots they deliver, they get `429` for a while.
- Requests and screenshots are not stored: the PNG comes back in the response, the server writes no dataset or key-value store, and its log has only the method, route and status of each request and short status and error lines, never the URL or who asked.

### Limits

- Each page gets up to 40 s in the browser, and a PNG larger than 7 MB is not stored.
- 1 page at a time.
- Set a maximum charge per run to cap spending: the run stops before a screenshot that would pass it.

### Pricing

This actor bills two events:

- `screenshot`: one per screenshot delivered.
- `full-page`: one more for each full-page screenshot.

Pages that fail are not charged.

### Site owners

Pages are opened as the `FrameskimFetch` bot, which checks `robots.txt` for each page, its redirects and its navigations (the images, styles and scripts a page loads are fetched as any browser fetches them). To keep your pages out, disallow `FrameskimFetch` in your `robots.txt` (the other Frameskim actors that fetch pages also honor that user agent, so the rule stops them too). Questions: support@frameskim.dev.

### Terms and privacy

URL Screenshot for AI Agents is operated by Emttn LLC and is not affiliated with, endorsed by or sponsored by the sites whose pages it captures, or by the makers of the consent platforms it recognizes. You are responsible for having a lawful basis to capture each page and for how you use its screenshot, including any personal data it shows. A site owner can opt out by disallowing `FrameskimFetch` in robots.txt. Terms: https://frameskim.dev/terms. Privacy: https://frameskim.dev/privacy. Questions: support@frameskim.dev.

# Actor input Schema

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

Public http or https URLs of HTML pages, from 1 to 100. Each screenshot delivered is one screenshot event.

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

Capture the whole page instead of the window, up to 8,960,000 pixels (7,000 px tall at 1280 px wide). Each full-page screenshot is one more full-page event.

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

Window width, from 320 to 1920 pixels.

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

Window height, from 320 to 1080 pixels; a full page grows past it.

## `closeBanners` (type: `boolean`):

Reject (or, without a reject button, accept or hide) the cookie or consent banner before the screenshot. Login, sign-up and paywall boxes are never touched.

## `failWhenEmpty` (type: `boolean`):

Internal: the run ends as failed, instead of succeeded with error items, when no screenshot is delivered. Used by health checks.

## Actor input object example

```json
{
  "urls": [
    "https://frameskim.dev/"
  ],
  "fullPage": false,
  "width": 1280,
  "height": 800,
  "closeBanners": true,
  "failWhenEmpty": false
}
```

# Actor output Schema

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

Dataset items: url, finalUrl, title, screenshotUrl (a PNG in the run's key-value store; it stops opening when Apify deletes the run's storage), screenshotKey, fullPage, width, height, bytes, truncated and banner; pages that could not be captured carry an error and are not charged.

# 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://frameskim.dev/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("emttn/url-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://frameskim.dev/"] }

# Run the Actor and wait for it to finish
run = client.actor("emttn/url-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://frameskim.dev/"
  ]
}' |
apify call emttn/url-screenshot --silent --output-dataset

```

## MCP server setup

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