Select one source
POST /v1/documents accepts exactly one of html, url or templateId. Structured templates use Typst for PDFs. Chromium prints HTML and URL snapshots and produces PNG, JPEG and WebP images.
HTML input is limited to 512 KiB. For a public URL, the fetcher validates the destination and each redirect before passing HTML to the isolated renderer. Use inline CSS and embedded data images. Remote stylesheets, web fonts, frames and scripts are blocked. A client-rendered page that needs JavaScript should be turned into self-contained HTML on your server first.
Set paper and margins
PDF request body
A4, Letter, Legal and Label (A6). Margins are whole millimetres from 8 to 35. Chromium headers and footers accept the page-number placeholders above. Structured templates interpolate JSON fields and add their own page counter. Lossless compression keeps the smaller of the original PDF and the rewritten file.
Capture a social image
WebP request body
og for 1200 × 630, square for 1080 × 1080 or story for 1080 × 1920. Use width and height to override the viewport. A published Social card template can supply the source in place of HTML.
Control readiness
Invalid options return 422 before admission. A missing selector can instead produce a failed job after admission. Read the job’s
error field. All output formats share a 16 MiB render limit.