v2

latestOpenAPI 3.1.0Proprietary2026-07-26211984.6 KB
Screenshot

Capture screenshot (returns image binary)

Accepts a JSON body with capture parameters. Returns the screenshot as a binary image with metadata in response headers (x-screenshot-*, x-rendex-*).

post/v1/screenshot

Request body

urlstring uri

Webpage URL to capture (mutually exclusive with html and markdown)

htmlstring

Raw HTML to render (up to 5 MB, mutually exclusive with url and markdown)

markdownstring

Markdown to render as styled HTML, then capture (up to 5 MB, mutually exclusive with url and html)

dataobject

Mustache template data object. When present, the html or markdown string is treated as a logic-less Mustache template and rendered against data before capture. Valid only with html or markdown — returns 400 if combined with url. Serialized size must not exceed 256 KB. Syntax: {{var}} (HTML-escaped), {{{var}}} (raw), {{#items}}…{{/items}} (loop), {{^x}}…{{/x}} (inverted section), {{a.b}} (nested access).

format'png' | 'jpeg' | 'webp' | 'pdf'

Output format

widthinteger

Viewport width in pixels

heightinteger

Viewport height in pixels

fullPageboolean

Capture full scrollable page (capped at 16384px height)

qualityinteger

Image quality (JPEG and WebP only)

delayinteger

Wait milliseconds after page load before capture

darkModeboolean

Emulate dark color scheme

deviceScaleFactornumber

Device pixel ratio (2 for Retina)

blockAdsboolean

Block ads, trackers, and chat widgets

blockResourceTypesstring[]

Resource types to block during page load

cssstring

CSS to inject into the page before capture

jsstring

JavaScript to execute on the page before capture

headersobject

Custom HTTP headers to send with the page request

userAgentstring

Custom User-Agent string

timeoutinteger

Navigation timeout in seconds

waitUntil'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2'

Page readiness condition before capture

waitForSelectorstring

CSS selector to wait for before capture

bestAttemptboolean

Return partial screenshot on timeout instead of failing

selectorstring

CSS selector of element to capture instead of full page

pdfFormat'A4' | 'Letter' | 'Legal' | 'Tabloid' | 'A3'

Paper size for PDF output (only applies when format is pdf)

pdfLandscapeboolean

Use landscape orientation for PDF output

pdfPrintBackgroundboolean

Include background colors and images in PDF output

pdfScalenumber

Scale factor for PDF rendering (0.1 to 2)

geostring

ISO 3166-1 alpha-2 country code for geo-targeted rendering (Pro/Enterprise)

geoCitystring

City for geo-targeted rendering (Pro/Enterprise)

geoStatestring

State or region for geo-targeted rendering (Pro/Enterprise)

asyncboolean

Process the capture asynchronously (returns a jobId to poll)

webhookUrlstring uri

URL to receive a webhook notification when the capture completes

cacheTtlinteger

Cache time-to-live in seconds (1 hour to 30 days)

device'desktop' | 'iphone_15' | 'iphone_se' | 'pixel_8' | 'ipad' | 'ipad_pro'

Device preset — sets viewport, device scale, and user agent in one parameter. Explicit width/height/userAgent still win.

hideSelectorsstring[]

CSS selectors to hide before capture (popups, sticky nav, chat bubbles). Never errors on a miss.

blockCookieBannersboolean

Hide common cookie/consent walls (OneTrust, Cookiebot, Quantcast, …) via a curated CSS list.

hostedboolean

Store the result in R2 and return {url, expiresAt} (a signed CDN-backed URL) instead of the image bytes. Drop the URL into an <img>/og:image.

extractboolean

Also return clean reader-mode content from the same render pass (use on /v1/screenshot/json; the binary endpoint rejects it). Shape set by extractFormat.

extractFormat'markdown' | 'json' | 'html' | 'text'

Shape of the extracted content when extract is true.

resizeWidthinteger

Downscale the output to this width (image formats only). Aspect ratio preserved when only one dimension is set. Never upscales.

resizeHeightinteger

Downscale the output to this height (image formats only).

Response

Screenshot captured successfully