Skip to content
LinkedInInstagramFacebook

Get Screenshot

Retrieve the details and download URL of a specific screenshot using its request ID.

GET https://api.peekshot.com/api/v1/screenshots/{requestId}

All requests must include the x-api-key header with a valid API key.

HeaderRequiredDescription
x-api-keyYesYour unique API key for authentication
ParameterTypeRequiredDescription
requestIdintegerYesThe unique ID of the screenshot request
curl --location 'https://api.peekshot.com/api/v1/screenshots/123' \
  --header 'x-api-key: your-api-key'

When the screenshot is completed:

{
  "status": "success",
  "message": "screenshot request status fetched successfully",
  "data": {
    "id": 1,
    "organizationId": 1,
    "projectId": 1,
    "status": "COMPLETE",
    "url": "https://peekshot.com/",
    "screenshotImageSize": 1012796,
    "options": {
      "delay": 0,
      "fresh": true,
      "width": 1680,
      "height": 867,
      "output": "json",
      "retina": false,
      "language": "en-GB,en-US;q=0.9,en;q=0.8",
      "block_ads": false,
      "dark_mode": false,
      "file_type": "jpeg",
      "full_page": false,
      "disable_javascript": false,
      "block_cookie_banner": false
    },
    "screenshotUrl": "https://peekshot.s3.ap-south-1.amazonaws.com/6/image.jpeg",
    "creditsRequired": 1,
    "duration": "9.864",
    "isActive": true,
    "createdAt": "2025-03-23T09:11:25.906Z",
    "updatedAt": "2025-03-23T09:11:25.906Z",
    "deletedAt": null,
    "deletedByUserId": null
  },
  "statusCode": 200
}
Status CodeError MessageDescription
400Invalid RequestCheck your input parameters
403ForbiddenInvalid or inactive API key
500Internal Server ErrorSomething went wrong on our end
  1. Implement Polling Logic: For screenshots that take time to process, implement polling with reasonable intervals (2-5 seconds)

  2. Handle Different Status States: Always check the status field and handle all possible states appropriately

  3. Cache Results: Once a screenshot is completed, cache the download URL to avoid repeated API calls

  4. Error Handling: Implement robust error handling for network issues and API errors

  5. Optimize Polling: Use reasonable intervals when polling to avoid unnecessary load