HTML and CSS rendering
Send raw markup and CSS to the HTML endpoint. We render it in real Chrome and return a PNG URL.
html parameter docsEverything the HTML to Image API can do. Names, limits, and links to the docs.
Send raw markup and CSS to the HTML endpoint. We render it in real Chrome and return a PNG URL.
html parameter docsCapture any public page with the Screenshot endpoint. Inject CSS to remove cookie banners or sticky headers before render.
url parameter docsRun JavaScript on the HTML endpoint up to a 30 second budget per render. Animations, third-party scripts and dynamic content all work.
JavaScript supportPOST a JSON body, get a JSON response with a CDN URL for the PNG. Authenticate with a single header. Works from any language.
Getting startedGoogle Fonts, Adobe Fonts and self-hosted @font-face all load server-side. Fonts resolve before paint, so glyphs never fall back to system defaults.
Loading fonts in HTMLGenerated images are served from i.html2img.com on the same CDN that fronts this marketing site. Hot files cache at the edge.
Response formatRender at 1x, 2x or 3x DPI. The 2x setting doubles memory and time, but produces files sized for retina displays without manual scaling.
dpi parameter docsPass a CSS selector to capture only the element you want from a URL screenshot. Useful for chart widgets, pricing tables and embeds.
selector parameter docsSet width and height between 1 and 5000 pixels. Render at desktop, tablet, mobile or any custom size. Default is 1440x900.
dimensions parameter docsGrid, flexbox, custom properties, transforms and animations all render exactly as Chrome does. No second compatibility model to learn.
css parameter docsSkip the 30 second sync timeout for slow renders. We POST the finished URL to your webhook when the image is ready.
webhook_url parameter docsWait for a specific element to appear in the DOM before capture. Pairs with ms_delay for lazy-loaded widgets and iframes.
wait_for_selector parameter docsBest for: full design control. Send raw markup, run inline JavaScript, get back a PNG.
Limit: 30 second sync timeout per render.
html parameter docsBest for: capturing pages you already host. We load the URL in Chrome, render, return a PNG.
Limit: no JavaScript injection on the user side; the page runs its own scripts only.
url parameter docsBest for: skipping the design step. Send JSON, get a tested image. We host the design.
Limit: only the inputs the template defines.
Browse templatesA few features matter most when you ship the API into a real product. Here are the three that come up first.
Hand off slow renders. POST a webhook_url and we deliver the finished PNG without holding your request open past the 30 second sync timeout.
webhook_url docsRender at 1x, 2x or 3x for retina displays. 2x doubles memory and time, so use webhooks for high-DPI renders to avoid timeouts.
dpi docsFiles land on i.html2img.com, the same CDN that fronts this marketing site. Hot files cache at the edge after the first request.
Response formatCustom fonts work three ways: Google Fonts loaded server-side, Adobe Fonts via the embed code you paste in your HTML, and self-hosted via an @font-face rule pointing at a public URL. Modern CSS works as it does in Chrome, including grid, flexbox, transforms, animations and custom properties. JavaScript executes on the HTML endpoint up to the 30 second render budget, but does not execute on the Screenshot endpoint, where the page runs its own scripts only. See the JavaScript support docs for the full breakdown.