Responses & downloads

POST /screenshot can return the image three ways. Choose with the response option (default comes from the server's DEFAULT_RESPONSE_MODE).

URL mode (default)

Returns a short-lived Google Cloud Storage signedUrl, its expiresAt, and a stable downloadUrl that 302-redirects to a fresh signed URL every time.

{
  "success": true,
  "data": {
    "signedUrl": "https://storage.googleapis.com/<bucket>/screenshots/<hash>.png?...",
    "expiresAt": "2026-01-01T00:00:00Z",
    "downloadUrl": "/api/v1/assets/screenshot/<token>",
    "storage": { "provider": "gcs", "bucket": "<bucket>", "key": "screenshots/<hash>.png" },
    "metadata": { "width": 1920, "height": 1080, "format": "png", "sizeBytes": 2456358 }
  }
}

Follow the stable redirect to download at any time:

curl -L "https://screenshotforweb.com/api/v1/assets/screenshot/<token>" -o screenshot.png

This downloadUrl is the shareable link for a capture — it needs no API key (the token is the credential), works in an <img> tag or a browser, and always serves the latest render. The dashboard playground surfaces it with a one-click Copy link after each render.

Base64 mode

Set "response": "base64" to get a data URI inline (no storage round-trip).

curl -s -X POST https://screenshotforweb.com/api/v1/screenshot \
  -H "X-API-Key: sk_live_your_key" -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"png","response":"base64"}' | jq -r '.data.screenshotUrl'
// -> data:image/png;base64,iVBORw0KGgo...

Binary download

POST /screenshot/download returns the raw file with Content-Disposition: attachment — pipe it straight to disk.

curl -X POST https://screenshotforweb.com/api/v1/screenshot/download \
  -H "X-API-Key: sk_live_your_key" -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","format":"pdf","fullPage":true}' --output page.pdf

Redirect endpoints (302)

These stable links always redirect to a fresh signed URL:

EndpointDelivers
/assets/screenshot/:tokena single screenshot
/batch/jobs/:jobId/download/:itemIda batch item
/batch/jobs/:jobId/download-alla batch ZIP
/web-archive/jobs/:jobId/download/:itemIdan archive item
/web-archive/jobs/:jobId/download-allan archive ZIP

forceRefresh

Captures are reused from storage when possible. Pass "forceRefresh": true to bypass reuse and render a fresh image (stored under a timestamped key).