Generate images from HTML templates
Create invoices, certificates, social cards, and more using HTML/CSS โ and generate thousands of images automatically.
Canvas API is a pain.
Design tools
can't scale.
Generating images programmatically has always been harder than it should be. You shouldn't need to learn a graphics API to put text on a coloured background.
Send HTML.
Get an image URL
back.
POST your HTML and CSS to the API. PeekShot renders it in a full browser environment with complete CSS support, then returns a hosted CDN URL you can use immediately. No storage setup. One request.
- Full HTML5 and CSS3 support โ any valid markup renders correctly
- Inject external CSS frameworks like Tailwind or Bootstrap
- Dynamic content via template variables โ personalise every image
- Set exact pixel dimensions for any output size โ OG, Twitter, LinkedIn
- Retina output option for crisp 2x images on high-DPI displays
- Returns a permanent hosted CDN URL โ embed directly in your app
// Generate a dynamic OG image from HTML const html = `<html> <head> <link rel="stylesheet" href="https://fonts.googleapis.com/ css2?family=Inter:wght@400;700"> <style> body { margin:0; font-family:'Inter',sans-serif; } .card { width:1200px; height:630px; background:linear-gradient(135deg,#1e3a5f,#7c22d9); display:flex; flex-direction:column; justify-content:flex-end; padding:80px; color:white; } h1 { font-size:64px; line-height:1.1; margin:0; } </style> </head> <body> <div class="card"> <h1>${pageTitle}</h1> <p style="opacity:.6">peekshot.com ยท ${date}</p> </div> </body> </html>`; const { url } = await fetch( 'https://api.peekshot.com/v1/html-screenshots', { method: 'POST', headers: { 'x-api-key': process.env.PEEKSHOT_KEY }, body: JSON.stringify({ html, width:1200, height:630 }) } ).then(r => r.json()); // โ https://cdn.peekshot.com/img_og_k8x2.png
Every image your app
needs to
generate.
How developers use
HTML to
Image.
Need to capture a live URL instead?
HTML to Image renders your own markup. If you need to screenshot a live webpage โ a competitor's site, a client page, a public URL โ that's the URL to Image API on a separate page.
Design once.
Generate infinitely.
Build your HTML template, call the API, get back a hosted image URL. 100 free renders to start. No credit card, no canvas API, no headaches.