Skip to content
LinkedInInstagramFacebook

Screenshots API

The PeekShot Screenshot API allows you to capture high-quality screenshots of web pages programmatically. Easily integrate it into your applications for website monitoring, SEO tracking, and more.

Create a new screenshot by sending a POST request with the target URL and configuration options.

POST https://api.peekshot.com/api/v1/screenshots
HeaderRequiredDescription
x-api-keyYesYour unique API key for authentication
Content-TypeYesMust be application/json

Send a JSON payload with the following parameters:

ParameterTypeRequiredDescription
project_idstringYesUnique project identifier
urlstringYesThe website URL to capture
widthstringNoScreenshot width (default: 1680)
heightstringNoScreenshot height (default: 867)
inject_cssstringNoCustom CSS to apply
inject_jsstringNoCustom JavaScript to apply
file_typestringNoImage format (jpeg, png, etc.)
retinastringNo”true” for high-resolution screenshots
delaystringNoTime (in seconds) to wait before capturing
full_pagestringNo”true” to capture the entire page, “false” for viewport only
disable_javascriptstringNo”true” to disable JavaScript execution
emulate_devicestringNoSupported device name for mobile emulation
disable_animationsstringNo”true” to disable animations
proxy_urlstringNoHTTP proxy URL (supports authentication)
custom_headerstringNoInject custom header into request
element_selectorstringNoTarget a specific element. Use CSS selector (e.g., “#header”) or XPath with “xpath=” prefix (e.g., “xpath=//div[@id=‘main’]“)

You can route screenshot captures through a custom HTTP proxy using the proxy_url option.

http://username:password@host:port
{
  "project_id": "1",
  "url": "https://example.com"
}
{
  "project_id": "1",
  "url": "https://example.com",
  "width": "1920",
  "height": "1080",
  "file_type": "png",
  "retina": "true"
}
{
  "project_id": "1",
  "url": "https://example.com",
  "width": "1680",
  "height": "867",
  "inject_css": ".container { background: red !important; }",
  "full_page": "true",
  "delay": "2"
}
{
  "project_id": "1",
  "url": "https://example.com",
  "element_selector": "#main-content",
  "file_type": "png"
}
{
  "project_id": "1",
  "url": "https://example.com",
  "emulate_device": "iPhone 13",
  "full_page": "true"
}
curl --location 'https://api.peekshot.com/api/v1/screenshots' \
  --header 'x-api-key: your-api-key' \
  --header 'Content-Type: application/json' \
  --data '{
      "project_id": "1",
      "url": "https://example.com",
      "width": "1680",
      "height": "867",
      "file_type": "jpeg",
      "retina": "true",
      "delay": "0",
      "full_page": "false",
      "disable_javascript": "false"
  }'
{
  "status": "success",
  "message": "screenshot request added in queue",
  "data": {
    "url": "https://example.com",
    "requestId": 1,
    "creditRequired": 1,
    "organizationId": 1
  },
  "statusCode": 201
}
FieldTypeDescription
statusstringRequest status (“success” or “error”)
messagestringDescriptive message about the request
dataobjectResponse data containing request details
data.urlstringThe URL that was captured
data.requestIdintegerUnique identifier for this screenshot request
data.creditRequiredintegerNumber of credits consumed
data.organizationIdintegerOrganization ID associated with the request
statusCodeintegerHTTP status code
Status CodeError MessageDescription
400Invalid RequestCheck your input parameters
403ForbiddenInvalid or inactive API key
500Internal Server ErrorSomething went wrong on our end
  • Use appropriate dimensions for your use case to minimize processing time
  • Set reasonable delay values (avoid unnecessary waiting)
  • Choose optimal file formats (JPEG for photos, PNG for graphics)
  • Use element selectors to capture specific parts of pages
  • Monitor your credit usage through the API
  • Implement proper error handling and retry logic
  • Use projects to organize your screenshots
  • Use retina mode for high-DPI displays
  • Inject CSS/JS to hide unwanted elements (ads, popups)
  • Set appropriate delays for dynamic content
  • Test with different device emulations for responsive designs
  • The API processes requests asynchronously.
  • Large screenshots may take longer to process
  • Ensure the provided URL is publicly accessible
  • Proxy support is limited to HTTP proxies only
  • Custom JavaScript injection runs after page load

For further assistance, contact hello@peekshot.com.