Documentation / API reference

API reference

Single capture endpoint, exhaustive option list, webhook contract, and errors. Values mirror captureSchema in the application source.

Overview

ScreenNabster exposes /api/v1/capture for all capture types. The same option object works for GET and POST; only the encoding differs. Successful sync responses are raw bytes. Errors are JSON with error, code, and status.

Base URL for this environment: https://screennabster.vercel.app

Authentication

Header: X-API-Key: pk_…. Required on every call. Keys are created in the dashboard; inactive or unknown keys return 401.

curl
curl -X POST "https://screennabster.vercel.app/api/v1/capture" \
  -H "X-API-Key: pk_live_your_key" \
  -H "Content-Type: application/json" \
  -d "{\"url\":\"https://example.com\"}" \
  --output out.png

Endpoint

POST https://screennabster.vercel.app/api/v1/capture

GET https://screennabster.vercel.app/api/v1/capture?…

POST body: JSON object. GET: query parameters with comma-separated arrays and JSON strings where noted in the parameter tables.

Target

ParameterTypeRequiredDefaultDescription
urlstring (URL)one of url/htmlPublic http(s) page to load. Private IPs, localhost, and metadata hosts are rejected.
htmlstringone of url/htmlRaw HTML document to render in the browser instead of navigating to url.

Output

ParameterTypeRequiredDefaultDescription
outputpng | jpg | webp | pdf | htmloptionalpngRendered MIME type / format.
qualitynumber 0–100optional80Lossy image quality; ignored for PNG.
thumb_widthpositive intoptionalResize output to this width.
thumb_heightpositive intoptionalResize output to this height.

Viewport & device

ParameterTypeRequiredDefaultDescription
screen_widthpositive intoptional1280Viewport width in CSS pixels.
screen_heightpositive intoptional800Viewport height in CSS pixels.
screen_landscapebooleanoptionalfalseSwap width/height for landscape layout.
devicestringoptionalPlaywright device preset name (see worker device catalog) or legacy aliases iPad, Galaxy S21.
device_scale_factornumber 0.5–4optionalOverride device pixel ratio when emulating.

Page behaviour

ParameterTypeRequiredDefaultDescription
page_fullbooleanoptionalfalseCapture the full scrollable page.
waitint ms 0–10000optional0Extra sleep before screenshot.
wait_untilload | domcontentloaded | networkidle | commitoptionalloadPlaywright navigation wait condition.
wait_for_selectorstring (CSS)optionalWait until this selector matches before capture.
scroll_tonumberoptionalScroll vertically to this Y offset before capture.
selectorstring (CSS)optionalClip capture to the first matching element’s bounding box.
clip_xnumberoptionalManual clip rectangle origin X (viewport coords).
clip_ynumberoptionalManual clip rectangle origin Y.
clip_wnumberoptionalManual clip width.
clip_hnumberoptionalManual clip height.
click_selectorstring (CSS)optionalClick element before capture.
hover_selectorstring (CSS)optionalHover element before capture.
error_on_click_not_foundbooleanoptionaltrueFail if click_selector missing.
error_on_hover_not_foundbooleanoptionaltrueFail if hover_selector missing.
hide_selectorsstring[]optional[]Selectors to hide (display:none) before capture. GET: comma-separated list.

Appearance & scripting

ParameterTypeRequiredDefaultDescription
theme_darkbooleanoptionalfalsePrefer dark color scheme.
transparentbooleanoptionalfalseTransparent background where supported (e.g. PNG).
inject_cssstringoptionalCSS injected before capture.
inject_jsstringoptionalJavaScript executed in page before capture.

PDF options

ParameterTypeRequiredDefaultDescription
pdf_formatA4 | A3 | Letter | Legal | TabloidoptionalA4Printed page size.
pdf_landscapebooleanoptionalfalseLandscape orientation.
pdf_print_backgroundbooleanoptionaltrueInclude background graphics in PDF.
pdf_marginstringoptionalShorthand margin (CSS length).
pdf_margin_topstringoptionalTop margin override.
pdf_margin_rightstringoptionalRight margin override.
pdf_margin_bottomstringoptionalBottom margin override.
pdf_margin_leftstringoptionalLeft margin override.
pdf_scalenumber 0.1–2optionalScale factor for PDF output.

Cookies

ParameterTypeRequiredDefaultDescription
cookiesobject[] { name, value, domain?, path? }optional[]Cookies set before navigation. GET: JSON string of the array.

Blocking & filters

ParameterTypeRequiredDefaultDescription
strip_adsbooleanoptionalfalseBlock common ad network hosts.
filterscookie_banners | ads | popups | chats | trackersoptional[]Content filters applied by the worker. GET: comma-separated.
block_resourcesimage | stylesheet | font | media | script | xhr | fetchoptional[]Playwright resource types to abort. GET: comma-separated.

Geolocation

ParameterTypeRequiredDefaultDescription
geo_latnumber −90…90optionalEmulated latitude.
geo_lngnumber −180…180optionalEmulated longitude.
geo_accuracypositive numberoptionalAccuracy in meters.

Browser & HTTP

ParameterTypeRequiredDefaultDescription
browser_agentstringoptionalCustom User-Agent header.
auth_userstringoptionalHTTP Basic username (not stored on async jobs).
auth_passstringoptionalHTTP Basic password (not stored on async jobs).
headersRecord<string, string>optionalExtra request headers. Authorization, Cookie, Host, X-Forwarded-For, and worker secrets are rejected. GET: JSON object string.

Caching & async

ParameterTypeRequiredDefaultDescription
cachedbooleanoptionalfalseUse cached render when available.
backgroundbooleanoptionalfalseQueue job; respond with job_id immediately.
callback_urlstring (URL)optionalHTTPS URL for webhook when background job completes or fails.

Internal

ParameterTypeRequiredDefaultDescription
storage_bucketstringoptionalReserved for platform use. Do not depend on it in customer integrations.

Async jobs & webhooks

Set background: true. The API responds immediately with:

queue-response.json
{
  "job_id": "uuid",
  "status": "queued",
  "message": "Render queued. Results will be sent to your callback_url."
}

Basic auth credentials are stripped before the job is persisted — only the running worker session receives them. When rendering finishes, our backend uploads the binary to private storage, creates a time-limited signed URL, and POSTs to your callback_url if provided.

Webhook headers:

  • Content-Type: application/json
  • X-ScreenNabster-Signature: sha256=<hex> — HMAC-SHA256 of the raw body using SCREENNABSTER_WEBHOOK_SIGNING_SECRET on our side; verify with the same secret on yours (timing-safe compare).

Success payload shape:

webhook-completed.json
{
  "event": "capture.completed",
  "job_id": "uuid",
  "created_at": "2026-04-11T12:00:00.000Z",
  "result_url": "https://…signed…"
}

Failure payload shape:

webhook-failed.json
{
  "event": "capture.failed",
  "job_id": "uuid",
  "created_at": "2026-04-11T12:00:00.000Z",
  "error": "Worker error message"
}

Error codes

JSON body: { "error": string, "code": string, "status": number }. The HTTP status code matches status.

HTTPCodeMeaning
401MISSING_API_KEYNo X-API-Key header was sent.
401INVALID_API_KEY_FORMATKey must start with pk_.
401INVALID_API_KEYKey not found, revoked, or inactive.
400INVALID_BODYPOST body is not valid JSON.
400VALIDATION_ERROROptions failed validation (see error text for Zod paths).
429RATE_LIMIT_EXCEEDEDMonthly request quota for this key/user is exhausted.
500QUEUE_ERRORBackground job could not be written to the queue.
500RENDER_ERRORThe render worker failed or timed out for this capture.