Render HTML to an image
screenshot_htmlRender an HTML document to an image for social cards, charts, or email previews. Returns a hosted image URL and the image when 2 MB or smaller.
Instructions
Render an HTML document (inline CSS/JS allowed, public http(s) assets only) to an image — e.g. social cards, charts, email previews. Returns the hosted image URL and the image itself when it is 2 MB or smaller.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | Complete HTML document or fragment to render | |
| format | No | Image format. Default png | |
| adblock | No | Block ads | |
| wait_ms | No | Extra wait before capturing, in ms | |
| selector | No | CSS selector of a single element to capture | |
| full_page | No | Capture the whole scrollable page. Default true | |
| light_mode | No | Force light or dark color scheme | |
| viewport_width | No | Viewport width in pixels. Default 1920 | |
| viewport_height | No | Viewport height in pixels. Default 1080 | |
| block_cookie_banner | No | Hide cookie consent banners | |
| device_scale_factor | No | 1 = standard, 2 = retina, 3 = high-dpi | |
| transparent_background | No | Transparent background (PNG/WebP only) |