← Back to blog
Guides·5 min read

Turn raw HTML into images with the HTML to screenshot API

Generate social cards, invoices, certificates and email previews by rendering your own HTML straight into a pixel perfect image.

Not every screenshot starts with a public URL. Sometimes you have a template: an Open Graph card, an invoice, a certificate, a chart. The HTML to screenshot endpoint renders any HTML you send it in a real browser and returns an image.

Send HTML instead of a URL

Switch the source from URL to HTML and post your markup directly:

curl -X POST "https://screenshotbee.com/api/capture-screenshot" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{ "html": "<html><body><h1>Hello!</h1></body></html>", "type": "png", "width": 1200, "height": 630 }'

What people build with it

  • Open Graph and Twitter card images generated per page
  • PDF style invoices and receipts rendered as images
  • Certificates and badges personalized per user
  • Email previews rendered exactly as a browser would

Full browser, full CSS

Because rendering happens in a real headless Chrome instance, you can use web fonts, flexbox, grid and any modern CSS. What renders in your browser is what you get back as an image.

Ready to try ScreenshotBee?

Start with free credits. No credit card, no subscription.

Get started free