Menu
Docs/Async Screenshots

Async Screenshots

Enqueue a screenshot job and get the result delivered to your webhook URL. The API returns immediately with 202 Accepted and a job_id.

POST/v1/async/screenshot

Async screenshots require a Growth+ plan and a configured webhook_url.

Parameters

ParameterTypeDefaultDescription
url*stringThe URL to screenshot.
webhook_url*stringURL to receive the result via POST when the screenshot is ready.
widthnumber1280Viewport width in pixels. Min 320, max 3840.
heightnumber720Viewport height in pixels. Min 240, max 2160.
formatenumpngOutput format: png, jpeg, or webp.
qualitynumber80Compression quality for jpeg/webp. 1–100.
full_pagebooleanfalseCapture full scrollable page height.
retinabooleanfalseUse 2× DPR (HiDPI).
delaynumber0Wait N ms after load. Max 10000.
wait_untilenumloadload, domcontentloaded, or networkidle.
cssstringCustom CSS to inject before capture.
jsstringJavaScript to execute before capture.
dark_modebooleanfalseEmulate dark mode.
block_adsbooleanfalseBlock ads and trackers.
stealthbooleanfalseBypass bot detection.
devicestringDevice preset name.
bypass_cspbooleanfalseDisable Content Security Policy.
proxystringProxy URL (http/https/socks5).
countryenumCountry for residential proxy: US, GB, DE, JP.

Response (immediate)

{
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "job_id": "job_abc123",
  "status": "queued",
  "message": "Screenshot job queued. Result will be sent to your webhook URL.",
  "webhook_url": "https://your-app.com/webhook",
  "url": "https://example.com"
}

Webhook delivery

When the screenshot is ready (or fails), SnapSharp sends a POST request to your webhook_url:

Success:

{
  "event": "screenshot.completed",
  "request_id": "550e8400-...",
  "job_id": "job_abc123",
  "url": "https://example.com",
  "success": true,
  "image_base64": "iVBORw0KGgo...",
  "content_type": "image/png",
  "size_bytes": 145230,
  "timestamp": "2026-03-28T12:00:00Z"
}

Failure:

{
  "event": "screenshot.failed",
  "request_id": "550e8400-...",
  "job_id": "job_abc123",
  "url": "https://example.com",
  "success": false,
  "error": "Navigation timeout after 30000ms",
  "timestamp": "2026-03-28T12:00:05Z"
}

Webhook headers:

HeaderDescription
X-Request-IdOriginal request ID
X-Webhook-Signaturesha256=<HMAC> — HMAC-SHA256 of the body, keyed with the request_id

Example

curl -X POST https://api.snapsharp.dev/v1/async/screenshot \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://github.com",
    "webhook_url": "https://your-app.com/webhooks/screenshot",
    "width": 1440,
    "full_page": true,
    "dark_mode": true
  }'

Errors

CodeErrorDescription
400validation_errorInvalid URL or missing webhook_url
401unauthorizedMissing or invalid API key
403plan_requiredGrowth+ plan required
429rate_limitedRate limit exceeded
503queue_unavailableJob queue not available — retry later