Skip to main content

Endpoint Reference

GET /{url}/...

Captures a screenshot of the given URL and returns the image bytes. All path segments after the URL are optional and may appear in any order.

GET /{url}/{size}/{aspectRatio}/{zoom}/_modifiers
SegmentTypeDescription
urlrequiredThe target URL, URL-encoded. Must begin with http or https.
sizeoptionalViewport width preset. One of small, medium, large, opengraph. Default: small.
aspectRatiooptionalViewport height ratio. One of 1:1, 9:16. Default: 1:1.
zoomoptionalDevice scale factor. One of bigger (1.4×), smaller (0.71×). Default: 1.0×.
_modifiersoptionalA path segment starting with _ containing one or more modifier tokens separated by _.

Query Parameters

ParameterValuesDefaultDescription
formatjpegOutput format. Omit for PNG.

Modifier Tokens

Modifier tokens are combined into a single path segment prefixed with _. Multiple tokens are separated by _:

/_wait:2_timeout:8_width:800
TokenValuesDefaultDescription
wait:N0, 1, 21Playwright wait strategy: 0 = DOMContentLoaded, 1 = Load, 2 = NetworkIdle.
timeout:N396Navigation timeout in seconds. Values outside the range are clamped.
width:Nany positive integerResize the output image to this width in pixels, preserving aspect ratio.

Viewport Sizes

The viewport dimensions used for the browser context are determined by the size and aspectRatio combination:

Size1:19:16
small375 × 375375 × 667
medium650 × 650650 × 1156
large1024 × 10241024 × 1024
opengraph1200 × 6301200 × 630

Responses

StatusDescription
200 OKScreenshot image bytes (image/png or image/jpeg).
400 Bad RequestMissing or invalid URL.
401 UnauthorizedMissing or invalid X-Api-Key header.
504 Gateway TimeoutPlaywright navigation timed out.

Examples

Capture https://example.com as a default small PNG (375 × 375):

GET /https%3A%2F%2Fexample.com

Large square PNG (1024 × 1024):

GET /https%3A%2F%2Fexample.com/large

Open Graph JPEG (1200 × 630):

GET /https%3A%2F%2Fexample.com/opengraph?format=jpeg

Medium portrait PNG (650 × 1156) with NetworkIdle wait and an 8-second timeout:

GET /https%3A%2F%2Fexample.com/medium/9:16/_wait:2_timeout:8

Small PNG resized to 400 px wide:

GET /https%3A%2F%2Fexample.com/small/_width:400