Skip to main content

Endpoint

GET https://api.screenshotly.dev/api/v1/screenshots/{screenshotId}

Headers

HeaderRequiredDescription
screenshotly-api-keyYesYour API key

Path parameters

screenshotId
string
required
The unique ID of the screenshot job, returned by the capture endpoint.

Response

200 OK

id
string
The screenshot job ID.
status
string
Current status: "processing", "completed", or "failed".
url
string
The original URL that was captured.
screenshotUrl
string
URL to the captured screenshot image. Only present when status is "completed".
format
string
The output format (png, jpeg, webp).
requestedAt
string
ISO 8601 timestamp of when the capture was requested.
completedAt
string
ISO 8601 timestamp of when the capture completed. Only present when status is "completed".
error
string
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

StatusDescription
401Unauthorized — invalid or missing API key
404Not 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"