HTML to image
html_to_imageRender an HTML snippet to a PNG, JPEG or WEBP image at any width, with retina scaling and transparent background. Cost: 3 credits per call. Output: a file (image/png | image/jpeg | image/webp) returned inline, at most 1 MiB. The rendered image
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | The HTML document or fragment (UTF-8, up to 2 MB). JavaScript is not executed. | |
| width | No | Viewport width in CSS px | |
| format | No | png | |
| height | No | Viewport height in CSS px; omit for a full-page image that fits the content | |
| quality | No | jpeg / webp quality | |
| transparent | No | Transparent page background (png / webp only) | |
| device_scale_factor | No | Pixel density (2 = retina) |