Captures

Render and store a capture

Renders synchronously and keeps the result, so it stays available at /i/c/{id} and in the dashboard. Pass webhookUrl to be called back when the capture finishes instead of polling — see WebhookPayload.

post/api/captures

Request

  • Base URL: https://snaplab.dev
  • URL: https://snaplab.dev/api/captures
  • Auth: HTTP bearer

Request body

urlstring uri

Absolute http(s) URL to capture. Private, loopback, link-local and metadata addresses are refused.

htmlstring

Raw HTML rendered instead of navigating. Subresources are still SSRF-filtered.

templatestring

HTML with {{ path.to.value }} placeholders, substituted from data and HTML-escaped.

dataobject

Values for template (or for html, when no template is given).

cssstring

Stylesheet injected into <head> before load. html/template mode only.

googleFontsstring

Comma-separated Google Fonts families, e.g. Inter,Playfair Display (max 6).

format'png' | 'jpeg' | 'webp' | 'avif' | 'pdf'
viewport'desktop' | 'laptop' | 'tablet' | 'mobile' | 'wide'

Preset size. width/height/deviceScaleFactor override individual axes.

widthinteger
heightinteger
deviceScaleFactornumber

Pixel ratio. 2 = retina.

mobileboolean

Sugar for viewport: "mobile" (390x844 @3x, touch emulation).

fullPageboolean

Capture the whole scrollable document. Ignored when selector is set.

selectorstring

Capture just this element. PDFs stay vector/selectable.

qualityinteger

jpeg/webp/avif only.

waitUntil'auto' | 'load' | 'domcontentloaded' | 'networkidle'

"auto" waits for load, then for the network to be quiet for 150ms, capped at 400ms. "networkidle" is the full Playwright wait and costs ~0.5s more.

waitForSelectorstring

Wait (up to 10s) for this selector before capturing.

delayMsinteger
scrollYinteger

Scroll down this many pixels first (triggers lazy loading).

hideSelectorsstring[]

Elements to hide before capturing. Comma-separated in a query string.

dismissBannersboolean

Hide known cookie/consent/chat banners with a curated stylesheet.

blockAdsboolean

Abort requests to known ad, analytics and session-replay hosts.

customCssstring

CSS injected after load.

customJsstring

JavaScript evaluated after load.

headersobject

Extra request headers.

filenamestring

Suggested download name, sanitised. Sets content-disposition: inline; filename="…" on the returned bytes and on the hosted /i/c/{id} file (?download=1 there makes it an attachment). Include the extension you want — it is used verbatim.

cacheboolean

Set false to force a fresh render.

responseType'binary' | 'json'

binary streams the bytes; json stores the render and answers with a hosted URL.

Example request

{
  "pdf": {
    "pageRanges": "1-3",
    "width": "210mm",
    "height": "297mm"
  },
  "filename": "INV-2026-014.pdf"
}

Response

The completed capture row.

idstring
userIdstring
apiKeyIdstring nullable
urlstring
titlestring nullable
status'pending' | 'processing' | 'completed' | 'failed'
formatstring
selectorstring nullable
fullPageboolean
widthinteger
heightinteger
deviceScaleFactorinteger
darkModeboolean
fileKeystring nullable
fileSizeinteger nullable
fingerprintstring nullable
errorstring nullable
durationMsinteger nullable
cacheHitboolean
createdAtstring date-time
completedAtstring date-time nullable

Changes

No recorded changes to this operation across all 1 revision of this API.