Lightweight screenshot API
POST /api/screenshot
If SCREENSHOT_API_KEY is configured, include the header:
X-API-Key: your-key
{
"url": "https://example.com", // required
"width": 1280, // optional (100-3840, default: 1280)
"height": 720, // optional (100-2160, default: 720)
"fullPage": true, // optional (default: true)
"format": "png", // optional: png, jpeg, webp, avif
"quality": 80, // optional: 1-100 (jpeg/webp/avif only)
"waitFor": 0 // optional: 0-30000 ms
}
By default, the raw image is returned with the appropriate Content-Type header.
To receive JSON with a base64-encoded image, send Accept: application/json:
{
"success": true,
"contentType": "image/png",
"size": 123456,
"base64": "iVBORw0KGgo..."
}
// 400 — Bad request (invalid URL, blocked URL, missing fields) // 401 — Unauthorized (missing or invalid API key) // 502 — Screenshot capture failed // 503 — Server at capacity, try again later