Endpoint
GET https://api.screenshotly.dev/api/v1/screenshots/{screenshotId}
| Header | Required | Description |
|---|
screenshotly-api-key | Yes | Your API key |
Path parameters
Response
200 OK
Current status: "processing", "completed", or "failed".
The original URL that was captured.
URL to the captured screenshot image. Only present when status is "completed".
The output format (png, jpeg, webp).
ISO 8601 timestamp of when the capture was requested.
ISO 8601 timestamp of when the capture completed. Only present when status is "completed".
Error message if status is "failed". Otherwise null.
Completed screenshot
{
"id": "scr_abc123",
"status": "completed",
"url": "https://example.com",
"screenshotUrl": "https://api.screenshotly.dev/api/v1/screenshots/scr_abc123.png",
"format": "png",
"requestedAt": "2025-05-14T10:00:00Z",
"completedAt": "2025-05-14T10:00:03Z",
"error": null
}
Processing screenshot
{
"id": "scr_abc123",
"status": "processing",
"url": "https://example.com",
"format": "png",
"requestedAt": "2025-05-14T10:00:00Z",
"error": null
}
Failed screenshot
{
"id": "scr_abc123",
"status": "failed",
"url": "https://example.com",
"format": "png",
"requestedAt": "2025-05-14T10:00:00Z",
"error": "Page load timeout exceeded"
}
Error responses
| Status | Description |
|---|
| 401 | Unauthorized — invalid or missing API key |
| 404 | Not found — screenshot ID doesn’t exist |
Polling for completion
If you’re not using webhooks, poll this endpoint to check when a screenshot is ready:
async function waitForScreenshot(client, screenshotId) {
while (true) {
const result = await client.getScreenshot(screenshotId);
if (result.data.status === 'completed') {
return result.data.screenshotUrl;
}
if (result.data.status === 'failed') {
throw new Error(result.data.error);
}
// Wait 1 second before checking again
await new Promise(resolve => setTimeout(resolve, 1000));
}
}
For production use, prefer webhooks over polling. Webhooks are more efficient and reduce unnecessary API calls.
Example
curl https://api.screenshotly.dev/api/v1/screenshots/scr_abc123 \
-H "screenshotly-api-key: $SCREENSHOTLY_API_KEY"