API Reference
Generate Screenshot
The core engine. Captures a full, high-fidelity PNG of any public URL with fine-grained control over viewport, theming, caching, and speed.
POST
/api/screenshotDescription
Sends the target URL to a warm headless browser instance, intercepts non-essential network traffic when speed is prioritized, then returns a binary PNG. Identical recent requests are served from memory in milliseconds.
Request
Send a JSON body. Required header: Content-Type: application/json
Body parameters
Name
Type
Default
Description
urlRequiredstring—The target HTTP(S) URL to capture. Must be publicly reachable from our servers.widthinteger1280Viewport width in pixels. Range 320–3840.heightinteger800Viewport height in pixels. Range 240–4320. Full page is captured regardless.dark_modebooleanfalseEmulates the OS prefers-color-scheme: dark setting before rendering.is_thumbnailbooleanfalseIf true, the rendered image is downscaled and compressed to a 320×200 thumbnail.use_cachebooleantrueWhen true, identical recent requests are served instantly from in-memory cache.optimize_speedbooleantrueBlocks heavy media (video, large images) and custom fonts during render to dramatically reduce latency.
Example request body
{
"url": "https://stripe.com",
"width": 1440,
"height": 900,
"dark_mode": true,
"is_thumbnail": false,
"use_cache": true,
"optimize_speed": true
}Code examples
curl -X POST "https://api.example.com/api/screenshot" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"url": "https://example.com",
"width": 1280,
"height": 800,
"dark_mode": false,
"is_thumbnail": false,
"use_cache": true,
"optimize_speed": true
}' \
--output screenshot.pngResponse
200 OK — a raw binary PNG with Content-Type: image/png. The body is the image bytes; pipe it to a file or wrap it in a Blob in the browser.
Errors return JSON
On render failure the API responds with HTTP
500 and a JSON body of the form {"detail": "..."}. See the error handling page for common causes.Build it visually
Prefer to click instead of type? Use the interactive Playground to assemble a request and copy a ready-to-paste snippet.