Take a screenshot
screenshotRender HTML or a public URL to a PNG or JPEG image at a set viewport size, returning the file directly or saving it to a local path without storing anything.
Instructions
Render HTML or a public URL to a PNG or JPEG image. Send exactly one of html or url. Returns the image (or writes it to save_to). Nothing is stored by pagenull.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| html | No | ||
| test | No | Test render: watermarked, free, not counted against the quota. | |
| type | No | ||
| width | No | Viewport width in CSS px (100–4000). Default 1280. | |
| height | No | Viewport height in CSS px (100–4000). Default 800. | |
| options | No | Any other option from https://pagenull.dev/docs/api (e.g. waitFor, timeoutMs, scale, headerHtml). Checked by the API. | |
| quality | No | JPEG quality, 1–100. | |
| save_to | No | Write the file to this path on this machine instead of returning it as base64. The folder must exist. Use it for large files. | |
| fullPage | No | Capture the whole scrollable page. | |
| overwrite | No | Replace the file at save_to if it already exists. Default false. | |
| deviceScaleFactor | No | 1–3. Use 2 for sharp images. |