HTML to Image
Renders markup you pass in - not a URL - using the same browser engine, so grid, flexbox, gradients and web fonts all behave normally. The markup is rendered with no base URL, so images must use absolute https addresses or data URIs. Useful for turning email templates, invoices and social cards into pictures without deploying them.
Identical work to a URL capture: one headless Chromium instance per call.
Any HTTP client works. Replace the key with one from your dashboard.
curl -X POST https://toolkitbackend-j69m.onrender.com/api/v1/tools/html-to-image \
-H "Authorization: Bearer tb_live_<your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"html": "<div style=\"font:700 64px system-ui;padding:80px\">Launch day</div>",
"width": 1200,
"height": 630,
"fullPage": false,
"deviceScaleFactor": 1,
"format": "png",
"quality": 85
}'Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
html | string | required | - | A full document or a bare fragment. Fragments are wrapped for you. |
width | integer | optional | 1440 | Canvas width in CSS pixels; this is the viewport your CSS lays out against. |
height | integer | optional | 900 | Canvas height in CSS pixels. Ignored when fullPage is true. |
fullPage | boolean | optional | false | Capture the whole document rather than one canvas-sized frame. |
deviceScaleFactor | integer | optional | 1 | 1 for standard density, 2 for a Retina render. |
format | string | optional | png | png or jpeg. Defaults to png. |
quality | integer | optional | 85 | JPEG quality, 40-100. Ignored for png. |
Output
| Field | Type | Description |
|---|---|---|
fileBase64 | string | Rendered image, base64-encoded, without a data URI prefix. |
mimeType | string | image/png or image/jpeg. |
width | integer | Pixel width of the returned image. |
height | integer | Pixel height of the returned image. |
truncated | boolean | True when a very tall document was clipped to the height ceiling. |
Try it
Sends a real POST /api/v1/tools/html-to-image from your browser and charges 25 credits to your account.
Sign in to run this endpoint. New accounts start with free credits.