Skip to main content

Take Screenshot

Overview

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.

Endpoint

POST https://api.peekshot.com/api/v1/screenshots

Authentication

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

Request Headers

HeaderDescription
x-api-keyYour unique API key for authentication
Content-Typeapplication/json

Request Body Parameters

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 JS to apply.
file_typestringNoImage format (jpeg, png, etc.).
retinastringNotrue for high-resolution screenshots.
delaystringNoTime (in seconds) to wait before capturing.
full_pagestringNotrue to capture the entire page, false for viewport only.
disable_javascriptstringNotrue to disable JavaScript execution.
emulate_devicestringNoSupported Devices
disable_animationsstringNotrue to disable Animations.
proxy_urlstringNoSupports proxies with or without authentication.
custom_headerstringNoInject custom header into request

Using a Proxy

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

Note: HTTPS and SOCKS5 proxies are not supported. Only HTTP proxies are allowed.

Proxy URL Syntax

http://username:password@host:port

Example Request

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://www.yourdomain.com/",
"width": 1680,
"height": 867,
"inject_css": ".container { background: red !important; }",
"inject_js": "document.querySelectorAll('.fixed, .sticky').forEach(el => { el.style.position = 'static'; }); const watermark = document.createElement('div'); watermark.style.position = 'fixed'; watermark.style.bottom = '10px'; watermark.style.right = '10px'; watermark.style.padding = '5px 10px'; watermark.style.background = 'rgba(0,0,0,0.7)'; watermark.style.color = 'white'; watermark.style.borderRadius = '4px'; watermark.style.fontSize = '12px'; watermark.textContent = 'Screenshot by PeekShot'; document.body.appendChild(watermark); document.querySelectorAll('img').forEach(img => { if (!img.complete) { img.style.border = '2px solid #ff0000'; } });",
"file_type": "jpeg",
"retina": true,
"delay": 0,
"full_page": false,
"disable_javascript": false
}'

Example Response

{
"status": "success",
"message": "screenshot request added in queue",
"data": {
"url": "https://www.yourdomain.com/",
"requestId": 1,
"creditRequired": 1,
"organizationId": 1
},
"statusCode": 201
}

Error Responses

Status CodeError MessageDescription
400Invalid RequestCheck your input parameters.
403ForbiddenInvalid or inactive API key.
500Internal Server ErrorSomething went wrong on our end.

Notes

  • The API supports high concurrency with minimal latency.
  • Ensure the provided URL is publicly accessible.
  • Large screenshots may take longer to process.

For further assistance, contact [email protected].