Screenshot (HTML)
API key v1Render 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/.
https://api.zactonz.com/screen/html/
Parameters
| Name | Type | Description |
|---|---|---|
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 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.
| Field | Type | Description |
|---|---|---|
status |
string |
|
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 |
400 |
Bad request |
|
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.