The most reliable way to generate dynamic images is to design them as HTML and CSS — the layout tools you already know — and render them in a real browser. Screenshotty accepts raw HTML in the html field, applies your CSS (inline, embedded, or injected via css_code), executes JavaScript, and returns the rendered image.
This is the engine behind Open Graph image pipelines, personalized social cards, email banners, and certificate generators.
const html = `<div style="width:1200px;height:630px;display:flex;align-items:center;justify-content:center;background:#0f172a;color:white;font-family:sans-serif;font-size:64px;">Hello, ${user.name}!</div>`;const response = await fetch("https://api.screenshotty.link/api/v1/screenshot", {method: "POST",headers: {"X-Api-Key": process.env.SCREENSHOTTY_API_KEY,"Content-Type": "application/json",},body: JSON.stringify({html,format: "image/png",viewport_width: 1200,viewport_height: 630,}),});
Web fonts, flexbox, grid, gradients, and emoji render exactly as in Chrome — no half-supported CSS subset.
Inject javascript_code or css_code to tweak templates per request without rebuilding the HTML.
Render components or badges on transparent backgrounds for compositing into other designs.
Set the viewport to your target size (e.g. 1200×630 for OG images) and capture precisely that box.
POST your markup in the html field to https://api.screenshotty.link/api/v1/screenshot with the format you want (image/png, image/jpeg, image/webp). The HTML is rendered in headless Chrome and returned as an image. Get a free API key at screenshotty.link — 100 screenshots per month, no credit card required.
Yes. External stylesheets, Google Fonts, and image assets referenced in your HTML are fetched and rendered just like in a normal browser tab. Use wait_ms or ready_event to ensure fonts finish loading before capture.
Yes. Screenshotty includes 100 screenshots per month for free with no credit card required. Paid plans start at $9/month for 2,500 screenshots, with pay-as-you-go overage at $0.004 per screenshot.
Yes. Every capture runs in a real headless Chrome browser, so single-page apps, lazy-loaded images, and dynamic content render exactly as they do for a real visitor. You can also wait for a specific ready event or add a custom delay with wait_ms.