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 downloadUrl that 302-redirects to a fresh signed URL each time it's opened.
{
"success": true,
"data": {
"signedUrl": "https://storage.googleapis.com/<bucket>/screenshots/<account>/<hash>.png?...",
"expiresAt": "2026-01-01T00:00:00Z",
"downloadUrl": "/api/v1/assets/screenshot/<token>",
"storage": { "provider": "gcs", "bucket": "<bucket>", "key": "screenshots/<account>/<hash>.png" },
"metadata": { "width": 1920, "height": 1080, "format": "png", "sizeBytes": 2456358 }
}
}Follow the redirect to download:
curl -L "https://screenshotforweb.com/api/v1/assets/screenshot/<token>" -o screenshot.pngThis downloadUrl is the shareable link for a capture — it needs no API key (the token is the credential) and works in an <img> tag or a browser. It lasts as long as the signed URL (15 minutes by default), and each link can only be opened so often a minute. The dashboard playground surfaces it with a one-click Copy link after each render.
To end a link before it expires, post it (or its token) to /download-links/revoke; /download-links/revoke-all ends every link issued for your account so far.
curl -X POST https://screenshotforweb.com/api/v1/download-links/revoke \
-H "X-API-Key: sk_live_your_key" -H "Content-Type: application/json" \
-d '{"url":"https://screenshotforweb.com/api/v1/assets/screenshot/<token>"}'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.pdfRedirect endpoints (302)
These links redirect to a fresh signed URL each time:
| Endpoint | Delivers |
|---|---|
/assets/screenshot/:token | a single screenshot |
/batch/jobs/:jobId/download/:itemId | a batch item |
/batch/jobs/:jobId/download-all | a batch ZIP |
/web-archive/jobs/:jobId/download/:itemId | an archive item |
/web-archive/jobs/:jobId/download-all | an 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).