Screenshot (URL)
API key v1Render any web page to JPEG, PNG or PDF at a chosen viewport.
Loads the page in a headless Chromium instance, waits for delay seconds so late-loading content settles, and saves a capture. The reply carries the URL of the saved file under /screen/url/s/.
https://api.zactonz.com/screen/url/
Parameters
| Name | Type | Description |
|---|---|---|
urlrequired |
string |
Absolute URL of the page to capture. |
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 |
delay |
integer |
Seconds to wait after the page loads before capturing. Default
5 |
download |
string |
Any value. Stream the file instead of returning JSON. |
orientation |
enum |
PDF only. portraitlandscape |
paperWidth |
number |
PDF only. Paper width in inches. Default
6 |
paperHeight |
number |
PDF only. Paper height in inches. Default
6 |
marginTop |
number |
PDF only. Also Default
0.4 |
scale |
number |
PDF only. Render scale. Default
1 |
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
Rendering a page takes a few seconds; allow a client timeout of at least 60 seconds. Pass download=1 to receive the file bytes directly (with Content-Disposition: attachment) instead of a JSON reply.
The PDF options (orientation, margins, paper size and scale) only apply when format=pdf. Margins and paper dimensions are in inches.