vøiddo guidesAll Actors on Apify

Website screenshot API: how to turn a URL into a PNG, JPEG or WEBP image (Python, cURL, no code)

Capture a public web page as a PNG, JPEG or WEBP image: any viewport size, full page, retina scaling, optional cookie-banner hiding. This guide shows the output fields, a working input, and Python, JavaScript and cURL code for the Actor v0iddo/url-screenshot on Apify.

Open Website screenshot API on Apify

What data you get

One row per result. Every row can be downloaded as JSON, CSV, Excel or HTML, or read through the API.

FieldLabelTypeExample
index#number0
file_urlFileURLhttps://api.apify.com/v2/key-value-stores/Gmq1hy2PAfT6TQ7Bt/records...
filenameFile nametextscreenshot.png
mimeTypetextimage/png
bytesBytesnumber71152
creditsCreditsnumber3
msTime (ms)number1283
file_keytextresult-001-screenshot.png
widthnumber1280
heightnumber800
formattextpng
final_urltexthttps://example.com/
http_statusnumber200
titletextExample Domain
load_statetextnetworkidle
truncatedtrue/falsefalse
blocked_requestsnumber0

Input example

This is the input that is pre-filled on the Actor page. Change the values for your own run.

{
  "url": "https://example.com"
}
Input fieldTypeWhat it does
url (required)stringPublic http(s) URL (robots.txt is honoured), or an inline data:text/html URL
widthintegerViewport width in CSS px
heightintegerViewport height in CSS px
full_pagebooleanCapture the whole scrollable page (capped at 16384 CSS px / 50 megapixels)
formatstringFile format of the result.
qualityintegerjpeg / webp quality
delay_msintegerExtra wait after load, before the shot
device_scale_factorstringPixel density (2 = retina) (a number)
block_cookie_bannersbooleanHide common cookie-consent dialogs (best effort)
itemsarrayOptional. A list of input objects with the same fields as above; every object is processed in its own right and the top-level fields act as shared defaults.

Output sample

Real rows from a run of the Actor. Fields that name people are left out of the sample.

[
  {
    "index": 0,
    "file_url": "https://api.apify.com/v2/key-value-stores/Gmq1hy2PAfT6TQ7Bt/records/result-001-screenshot.png?signature=1zfATwZwqmmlfl8OgA6Um",
    "file_key": "result-001-screenshot.png",
    "filename": "screenshot.png",
    "mime": "image/png",
    "bytes": 71152,
    "width": 1280,
    "height": 800,
    "format": "png",
    "final_url": "https://example.com/",
    "http_status": 200,
    "title": "Example Domain",
    "load_state": "networkidle",
    "truncated": false,
    "blocked_requests": 0,
    "credits": 3,
    "ms": 1283
  }
]

Code: Python, JavaScript and cURL

Get your API token in Apify Console under Settings, then Integrations. The Actor id is v0iddo/url-screenshot.

Python (apify-client)

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {'url': 'https://example.com'}

run = client.actor("v0iddo/url-screenshot").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

JavaScript (apify-client)

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const input = {
  "url": "https://example.com"
};

const run = await client.actor('v0iddo/url-screenshot').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

cURL

curl -X POST "https://api.apify.com/v2/acts/v0iddo~url-screenshot/run-sync-get-dataset-items" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Price

$4.25 per 1,000 results. You pay per result row. There is no separate charge per run. Higher Apify plans pay less per result, down to $2.98 per 1,000. See the pricing tab for your plan. A new Apify account gets $5 of platform credit every month.

FAQ

What data does the Website screenshot API return?

Each result is one row in an Apify dataset. Fields include index, file_url, filename, mime, bytes, credits, ms, file_key, and more. The table above shows every field with an example value.

How do I use the Website screenshot API from Python?

Install the apify-client package, create a client with your Apify API token, call the Actor v0iddo/url-screenshot with an input like the one above, and read the rows from the run's dataset. The Python snippet above does exactly that.

Can I use it without writing code?

Yes. Open the Actor page on Apify, fill in the input form (an example is already filled in), press Start, and download the results as JSON, CSV, Excel or HTML. You can also schedule runs there.

How much does it cost?

$4.25 per 1,000 results. You pay per result row. There is no separate charge per run. Higher Apify plans pay less per result, down to $2.98 per 1,000. A new Apify account gets $5 of platform credit every month.

How do I limit the number of results?

Set a maximum cost for a run in the run options on Apify, and the run stops when it is reached.

Can I send the results to Google Sheets, Make, Zapier or n8n?

Yes. Apify datasets connect to Google Sheets, Slack, Make, Zapier and n8n, and a webhook can call your own service when a run finishes. You can also export the dataset as JSON, CSV or Excel.

Open Website screenshot API on Apify

Related guides