HTML to Image API

The same renderer, a different output format. Generate social cards, email-safe previews, and thumbnails from the HTML you already have.

HTML PDF PNG JPEG URL
No credit card required · 500 free renders/month

One payload, image out

Set an explicit viewport and a device scale factor and you get crisp output at any density — 2x for retina, 1x for email clients that will only downscale it anyway.

curl
curl -X POST https://api.filecook.com/render/image \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/pricing",
    "options": { "format": "png", "width": 1200, "height": 630, "scale": 2 }
  }' -o og-image.png

Built for social previews

Open Graph images are the highest-leverage use of this endpoint. Design the card once in HTML and CSS, interpolate the title and author at request time, and cache the result against your content ID. No design tool round-trip, no manual export.

  • PNG for sharp text and transparency, JPEG with a quality setting where bytes matter
  • Full-page capture or a fixed 1200×630 crop
  • Transparent backgrounds for compositing
  • Element-scoped capture with a CSS selector

Same guarantees as PDF

Image renders run on the identical worker pool: queue-backed, retried on transient failure, and discarded from memory the moment the response is written. Both formats draw from the same quota, so you do not have to forecast the split in advance.

Frequently asked questions

What image formats do you support?
PNG and JPEG. PNG keeps text sharp and supports transparency; JPEG accepts a quality parameter when file size matters more than fidelity.
Can I capture just one element instead of the whole page?
Yes. Pass a CSS selector and the renderer crops to that element’s bounding box.
Can I use Google Fonts or my own web fonts?
Yes. Load them the normal way — an @import in your stylesheet, a <link> tag, or a self-hosted @font-face rule. The renderer waits for fonts to load before it captures the page.
Am I charged for failed renders?
No. Only successful 200 OK responses count against your quota. Malformed HTML, timeouts, and upstream errors are not billed.
Is there a free tier?
Yes — 500 renders a month, free forever, with no credit card required. That covers the playground, the full API, and both PDF and image output.

Keep reading

Ready to start cooking?

500 renders a month, free forever. No credit card, no sales call.