Skip to content

HTTP Endpoints

Render HTML to an image.

{
"html": "<div class=\"flex w-full h-full bg-blue-500\">Hello</div>",
"width": 1200,
"height": 630,
"format": "svg",
"fonts": []
}
FieldTypeRequiredDefaultDescription
htmlstringyesHTML to render
widthintno1200Canvas width
heightintno630Canvas height
formatstringno"svg""svg", "png", or "jpeg"
qualityintno90JPEG compression quality (1-100). Ignored for SVG/PNG.
fontsarrayno[]Custom fonts
{
"name": "Inter",
"weight": 400,
"style": "normal",
"url": "https://example.com/Inter.ttf"
}

Or with base64 data:

{
"name": "Inter",
"weight": 400,
"style": "normal",
"data": "base64-encoded-font-data"
}

Image bytes with headers:

HeaderValue
Content-Typeimage/svg+xml, image/png, or image/jpeg
ETagSHA-256 hash of the input
X-CacheHIT or MISS
Cache-Controlpublic, max-age=86400 (hit) or public, max-age=3600 (miss)

Render a Go html/template with data substitution.

{
"template": "<div class=\"text-4xl text-white\">{{.Title}}</div>",
"data": { "Title": "Hello World" },
"width": 1200,
"height": 630,
"format": "svg"
}
FieldTypeRequiredDefault
templatestringyes
dataobjectno{}
widthintno1200
heightintno630
formatstringno"svg"
qualityintno90

Same as /render.

{"status": "ok"}
{
"render_total": 150,
"render_errors": 2,
"cache_hits": 98,
"cache_misses": 52,
"total_duration_ms": 4200
}

All errors return JSON:

{
"error": "description of what went wrong"
}
StatusMeaning
400Bad request (missing fields, invalid template, invalid font)
429Rate limit exceeded
500Render failed
504Render timeout

All endpoints return Access-Control-Allow-Origin: *.

LimitValue
Max request body10 MB
Max fonts per request5
Max font size5 MB
Default cache size64 MB
Default render timeout10 seconds
Default max elements1000