Screenshot (HTML)

API key v1

Render HTML you send to a JPEG, PNG or PDF.

Stages the markup you post on the API host, renders it in headless Chromium at the requested viewport and saves the capture. The staged page is deleted as soon as the capture is done; the capture itself stays at the returned URL under /screen/html/s/.

POST https://api.zactonz.com/screen/html/

Parameters

NameTypeDescription
htmlrequired string

The HTML document to render.

width integer

Viewport width in pixels.

Default 1280
height integer

Viewport height in pixels.

Default 1024
format enum

Output format.

jpegpngpdf
quality integer

JPEG quality from 1 to 100. Ignored for other formats.

Default 100

Send parameters as application/x-www-form-urlencoded form fields in the request body.

Response

Metadata and the URL of the saved capture.

FieldTypeDescription
status string

"200" on success (a string). See status codes below.

width integer

Viewport width that was used.

height integer

Viewport height that was used.

data string

Absolute URL of the saved image or PDF, or an error message.

Status codes

The outcome is reported in the JSON status field. See Errors & status codes for the general rules.

200 OK

The capture was saved. Note that this endpoint returns status as a string.

400 Bad request

html was missing, or quality was 0 for JPEG output.

Notes

Send a complete document (<html>…</html>). Relative URLs inside it will not resolve, so use absolute URLs for images, fonts and stylesheets. PDF output uses Chromium's default page size and prints without backgrounds.