Skip to main content
Ssnap Docs
API Reference

Capture parameters

Every capture parameter, with types, ranges, defaults and interactions.

All parameters work identically on GET (query string) and POST (JSON body). Only url is required.

Target

ParameterTypeDefaultNotes
urlstring (uri)noneRequired. Must be a publicly routable http/https address. See URL restrictions.

Output

ParameterTypeDefaultNotes
formatjpeg | png | webp | pdfjpegpdf skips image post-processing and ignores selector.
qualityinteger 1–10080Applies to jpeg and webp. png is lossless and ignores it.
responsebinary | urlbinaryurl returns a signed link valid 24 hours.

Viewport and device

ParameterTypeDefaultNotes
device_idintegerserver default presetA device preset id. See Device emulation.
widthinteger 1–5000from presetApplied only together with height.
heightinteger 1–5000from presetApplied only together with width.
themelight | darklightEmulates prefers-color-scheme for the page.

width and height are applied after the device preset, so an explicit viewport overrides the preset's dimensions. Pass both; a lone width or height is ignored. The device's user agent still applies.

Capture behaviour

ParameterTypeDefaultNotes
full_pagebooleanfalseCaptures the whole scroll height instead of the viewport.
selectorstring ≤255noneCSS selector to clip to. Takes precedence over full_page; ignored for pdf.
network_idlebooleanfalseWaits for network activity to settle before capturing.
delayinteger 0–300000Extra milliseconds to wait after load.

selector and full_page are mutually exclusive: when both are given on an image format, the selector wins and the page is clipped to that element.

Image styling

Applied after the render, to image formats only. See Backgrounds, borders and watermarks.

ParameterTypeDefaultNotes
backgroundhex colournoneSix hex digits, # optional (#ffffff or ffffff).
border_widthinteger 1–200noneBorder expands the image rather than cropping it.
border_colorhex colour000000Only used when border_width is set.
watermark_textstring ≤255noneEnables the watermark.
watermark_sizeinteger 6–20024Font size in points.
watermark_colorhex colourffffff
watermark_xinteger 0–500020Offset from the left edge, in pixels.
watermark_yinteger 0–500020Offset from the top edge, in pixels.

Delivery

ParameterTypeDefaultNotes
cache_ttlinteger 0–25920000Seconds an identical earlier capture may be reused. A cache hit does not consume quota.
callback_urlstring (uri)noneWhen set, the capture is queued and the result POSTed here; the request returns 202. Subject to the same public-host checks as url.

Which parameters affect the cache key

The cache key is a hash of the target url, the device, and these output-affecting parameters:

theme, format, quality, device_id, width, height, full_page, network_idle, delay, selector, background, border_width, border_color, watermark_text, watermark_size, watermark_color, watermark_x, watermark_y.

cache_ttl, response and callback_url are delivery options and do not change the key. See Screenshot caching.

Validation

Parameters are validated before any browser work happens. A violation returns 422 with Laravel's standard validation error body:

{
  "message": "The url field is required.",
  "errors": {
    "url": ["The url field is required."]
  }
}

Next