Screenshot API
A JPEG of any page: the visible window or the whole page.
The Screenshot API opens a page in a real browser and returns a JPEG: the visible window, or the whole page from top to bottom.
Call it
curl https://data.upscrape.com/screenshot \ -H "Authorization: Bearer $UPSCRAPE_API_KEY" \ -H "Content-Type: application/json" \ -H "Prefer: wait=30" \ -d '{"url": "https://www.wikipedia.org/", "full_page": true}'
import base64import osimport requestsjob = requests.post( "https://data.upscrape.com/screenshot", headers={"Authorization": f"Bearer {os.environ['UPSCRAPE_API_KEY']}", "Prefer": "wait=30"}, json={"url": "https://www.wikipedia.org/", "full_page": True},).json()image = job["results"][0]["data"]["image"]with open("wikipedia.jpg", "wb") as f: f.write(base64.b64decode(image["data"]))
import { writeFile } from "node:fs/promises";const res = await fetch("https://data.upscrape.com/screenshot", { method: "POST", headers: { Authorization: `Bearer ${process.env.UPSCRAPE_API_KEY}`, "Content-Type": "application/json", Prefer: "wait=30", }, body: JSON.stringify({ url: "https://www.wikipedia.org/", full_page: true }),});const job = await res.json();const image = job.results[0].data.image;await writeFile("wikipedia.jpg", Buffer.from(image.data, "base64"));
The image is in results[0].data.image: base64 in data, with its content_type and size in bytes. It travels inside the JSON, so there is no link to expire.
Set up the shot
| Input | What it does |
|---|---|
full_page | The whole page, top to bottom, instead of the visible window. |
viewport_width, viewport_height | The browser window, 1440 by 900 by default; from 320 by 200 up to 3840 by 2160. Use 390 by 844 for a phone. |
wait_for_selector | Wait until an element matching this CSS selector appears, for pages that fill in after they load. |
wait_ms | Wait this many milliseconds before the shot, up to 10 seconds. |
The image is a JPEG.
Input
| Field | Type | Required | What it does | Example |
|---|---|---|---|---|
url |
string | yes | The page to screenshot. | https://www.wikipedia.org/ |
format |
string | no | The image format: jpeg. | jpeg |
full_page |
boolean | no | Capture the whole page, not just the visible window. | false |
viewport_height |
integer | no | The browser window height, in pixels. | 900 |
viewport_width |
integer | no | The browser window width, in pixels. | 1440 |
wait_for_selector |
string | no | Wait until an element matching this CSS selector appears. | |
wait_ms |
integer | no | Wait this many milliseconds before the screenshot. |
Response
A finished call answers with HTTP 200; the data is in results[0].data, and billing.credits_charged is what it cost. A call still running after the wait answers 202: see jobs and results.
This is results[0].data from a real run:
{ "captured_at": "2026-10-16T14:03:23.651658Z", "content_type": "image/jpeg", "final_url": "https://www.wikipedia.org/", "height": 900, "rendered": true, "status_code": 200, "width": 1440, "image": { "bytes": 60650, "content_type": "image/jpeg", "data": "/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUA…", "encoding": "base64" }, "warnings": []}
Fields
| Field | Type | What it is | Example |
|---|---|---|---|
captured_at |
string | When the screenshot was taken. | 2026-10-16T14:03:23.651658Z |
content_type |
string | The image's format. | image/jpeg |
final_url |
string | The address the browser ended on, after any redirects. | https://www.wikipedia.org/ |
height |
integer | The image's height in pixels. | 900 |
image |
object | The screenshot. | 4 fields |
image.bytes |
integer | The image's size in bytes. | 60,650 |
image.content_type |
string | The image's format, image/jpeg. | image/jpeg |
image.data |
string | The image itself, base64-encoded. Decode it and save it as a .jpg file. | /9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUA… |
image.encoding |
string | How data is encoded: base64. | base64 |
rendered |
boolean | Whether the page was drawn in a real browser. | true |
status_code |
integer | The site's HTTP status for the page, such as 200. | 200 |
warnings |
array | Anything that limited the screenshot; empty when all went well. | empty in this sample |
width |
integer | The image's width in pixels. | 1440 |
What to know
- The browser window is 1440 by 900 pixels unless you set viewport_width and viewport_height.
- full_page captures the whole page, top to bottom, in one image.
- For a page that fills in after it loads, wait for it with wait_for_selector or wait_ms.
- The image comes inside the JSON as base64, so there is no link to expire.
If a call fails
A failed call costs nothing. The response carries an error.code you can branch on; Errors and retries lists every code and which ones to retry.
Something missing or unclear? Ask the team that builds the endpoints.