Screenshot API
Reference

POST /screenshot

Full request body reference, response shapes, and curl examples.

Capture a Render of a public URL. Single endpoint: POST /screenshot.

Requires Authentication via Authorization: Bearer shot_….

Request body

Content-Type: application/json. Extra fields are rejected (400 invalid_input).

url (required)

Typestring
Example"https://example.com"

Target URL. Must use http or https. Private, loopback, and link-local addresses are blocked (403 url_not_allowed).

format

Type"png" | "jpeg" | "webp"
Default"png"
Example"webp"

Output image format.

quality

Typeinteger
Default80
Bounds1100
Example90

JPEG/WebP compression quality. Ignored for PNG.

viewport

Typeobject
Default{"width": 1280, "height": 720}

Simulated browser window size before dpr scaling.

viewport.width

Typeinteger
Default1280
Bounds3203840

viewport.height

Typeinteger
Default720
Bounds2402160

dpr

Typeinteger
Default1
Allowed1, 2, 3
Example2

Device pixel ratio. Final image dimensions are viewport × dpr (unless full_page expands height).

full_page

Typeboolean
Defaultfalse
Exampletrue

Capture the full scrollable page instead of the viewport. Maximum height is 32,768 px (422 page_too_tall if exceeded).

block_ads

Typeboolean
Defaulttrue
Examplefalse

Block common ad and tracker domains via Playwright request interception.

wait_until

Type"load" | "domcontentloaded" | "networkidle"
Default"load"

Navigation lifecycle event before capture.

wait_for

Typestring | null
Defaultnull
Example"#main-content"

Optional CSS selector to wait for before screenshot. Must be syntactically valid and balanced. Returns 422 selector_not_found if the element never appears.

delay

Typeinteger (milliseconds)
Default0
Bounds010000
Example500

Extra wait after navigation and wait_for before capture.

cache_ttl

Typeinteger (seconds)
Default300
Bounds086400
Example3600

How long an identical request may be served from cache. 0 disables caching. See Caching & idempotency.

response_type

Type"image" | "json"
Default"image"
  • "image" — raw bytes in the response body
  • "json" — JSON metadata with a hosted URL. See Storage.

Minimal request

{
  "url": "https://example.com"
}

Full request example

{
  "url": "https://example.com",
  "format": "webp",
  "quality": 85,
  "viewport": { "width": 1440, "height": 900 },
  "dpr": 2,
  "full_page": false,
  "block_ads": true,
  "wait_until": "networkidle",
  "wait_for": "#content",
  "delay": 250,
  "cache_ttl": 300,
  "response_type": "image"
}

Response: response_type=image (default)

HTTP/1.1 200 OK
Content-Type: image/png
X-Request-Id: req_01HW3QXP...
X-Render-Cached: false
X-Render-Billable: true
X-RateLimit-Limit: 5
X-RateLimit-Remaining: 4
X-RateLimit-Reset: 1762624860
X-Quota-Limit: 100
X-Quota-Remaining: 99
X-Quota-Resets-At: 1764547200

<binary image bytes>

Content-Type reflects format (image/png, image/jpeg, or image/webp).

Curl: download PNG

curl -X POST http://localhost:8000/screenshot \
  -H 'Authorization: Bearer shot_yourkey_here' \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com","format":"png"}' \
  -o screenshot.png

Response: response_type=json

{
  "url": "https://cdn.example.com/r/01HW3QXP9ZK4M2JQT6XBVCYNFD.webp",
  "format": "webp",
  "width": 2880,
  "height": 1800,
  "bytes": 142567,
  "cached": false,
  "billable": true,
  "render_duration_ms": 2341,
  "request_id": "req_01HW3QXP...",
  "expires_at": "2026-06-08T11:00:00Z"
}

Same rate-limit and quota headers as image mode apply on the HTTP response.

Curl: JSON with URL

curl -X POST http://localhost:8000/screenshot \
  -H 'Authorization: Bearer shot_yourkey_here' \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com","response_type":"json","format":"webp","dpr":2}'

Optional headers

HeaderDescription
Idempotency-KeySafe retry token. See Caching & idempotency.

Errors

See Errors for the complete code table. Validation failures return 400 invalid_input with field and issue.

Render wall time

Every Render is bounded by a 30-second wall-time budget. Exceeding it returns 503 render_timeout with timeout_ms: 30000.