Screenshot API v1

Parameters, constraints, and examples for POST /api/v1/screenshots.

Authentication

Send your API key in the Authorization header:

Authorization: Bearer <api_key>

Create screenshot

Endpoint: POST /api/v1/screenshots
Body: JSON

Minimal request

curl -X POST "https://api.your-domain.com/api/v1/screenshots" \
  -H "Authorization: Bearer $SCREENSHOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'

Sync request (when allowed)

curl -X POST "https://api.your-domain.com/api/v1/screenshots" \
  -H "Authorization: Bearer $SCREENSHOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "mode": "sync",
    "timeoutMs": 8000,
    "fullPage": false
  }'

Key parameters

url
Required. Target URL to capture.
mode
Optional. async (default) or sync.
timeoutMs
Required for sync. Must be > 0 and < 10000.
fullPage
Optional. For sync mode, it must be false.
Sync mode constraints
Even if you request mode=sync, the server will fall back to async unless:
timeoutMs is provided AND 0 < timeoutMs < 10000 AND fullPage == false

Parameters reference (full)

Field Type Required Default Notes
urlstringYes-Target URL.
modestringNoasyncAccepts async or sync (case-insensitive).
timeoutMsint?No-Only used for sync. Must be 0 < timeoutMs < 10000.
fullPageboolNofalseSync requires false.
viewportobject?No-Viewport override.
formatstring?No-Suggested: png, jpeg, webp.
qualityint?No-Suggested: 1-100. Only meaningful for jpeg/webp.
waitUntilstring?No-Suggested: load, domcontentloaded, networkidle.
delayMsint?No-Extra delay after waitUntil.
selectorstring?No-Capture only a specific element.
headersobject?No-Dictionary of extra request headers.
cookiesarray?No-Cookie injection list.
javascriptstring?No-Custom JS to inject (implementation-dependent).
cssstring?No-Custom CSS to inject (implementation-dependent).
devicestring?No-Suggested: desktop/iphone/ipad/pixel.
strictDevicebool?No-If true, unsupported device should fail (implementation-dependent).
colorSchemestring?No-Suggested: light/dark/no-preference.
proxystring?No-Proxy string (implementation-dependent).
tracebool?No-Enable trace (implementation-dependent).
harbool?No-Enable HAR (implementation-dependent).
returnDombool?No-Return DOM (implementation-dependent).
returnNetworkbool?No-Return network info (implementation-dependent).
priorityint?No-Job priority (implementation-dependent).

viewport

FieldTypeRequiredNotes
viewport.widthintNoViewport width.
viewport.heightintNoViewport height.

cookies[]

FieldTypeRequiredNotes
cookies[].namestringYesCookie name.
cookies[].valuestringYesCookie value.
cookies[].domainstring?NoCookie domain.
cookies[].pathstring?NoCookie path.

Responses

Async (default)
{ "jobId": "<guid>", "status": "pending" }
Sync (completed)
{ "jobId": "<guid>", "status": "completed", "result": { "url": "https://..." } }
Sync (failed)
{ "jobId": "<guid>", "status": "failed", "errorMessage": "..." }
Sync (timeout)
{ "jobId": "<guid>", "status": "processing" }

Errors

HTTPWhenBody
400Missing/empty urlEmpty body (BadRequest)
401Invalid/missing API keyMiddleware response
402Quota exceeded{ "error": "quota_exceeded", "operationKey": "screenshot.capture", ... }
429Rate limited{ "error": "rate_limited", "operationKey": "screenshot.capture", ... }
404Job not foundNotFound

How-to examples

Practical examples for common integration needs.

Pass target-site auth token (via headers)

If the page you want to capture is protected (Bearer/JWT/session token), forward it using headers:
{
  "url": "https://example.com/dashboard",
  "headers": {
    "Authorization": "Bearer <target_site_token>"
  }
}

Set cookies (session-based login)

If the website uses cookies for authentication, pass them using cookies:
{
  "url": "https://example.com/account",
  "cookies": [
    { "name": "session", "value": "<cookie_value>", "domain": "example.com", "path": "/" }
  ]
}

Custom request headers (User-Agent / locale)

{
  "url": "https://example.com",
  "headers": {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
    "Accept-Language": "en-US,en;q=0.9"
  }
}

Viewport + format + quality

{
  "url": "https://example.com",
  "viewport": { "width": 1280, "height": 720 },
  "format": "jpeg",
  "quality": 85
}

Wait for page load + add delay

{
  "url": "https://example.com",
  "waitUntil": "networkidle",
  "delayMs": 500
}

Capture a specific element (selector)

{
  "url": "https://example.com/pricing",
  "selector": "#pricing"
}

Get status

Poll the job:

GET /api/v1/screenshots/{jobId}