Dynamic OG image generation API

Render per-page Open Graph and social preview images from an HTML template — one API call, no headless browser to host.

Great link previews need a unique Open Graph image per page — blog post, product, profile. Generating those dynamically usually means running headless Chromium at build or request time and keeping it alive.

Rendershot turns an HTML/CSS card template into a 1200×630 PNG with one request. Design the card in HTML, pass the per-page data, and capture it via the screenshot API — then cache the result on your own CDN and point your og:image tag at it.

Render your card template at OG dimensions:

curl -X POST https://api.rendershot.io/v1/screenshot \
  -H 'X-API-Key: sk_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"html":"<div>…your OG card template…</div>","format":"png","viewport":{"width":1200,"height":630}}' \
  --output og.png

From your HTML template

Use the same HTML/CSS you already know — gradients, web fonts, logos — instead of a constrained image DSL.

Per-page social cards

Fill the template per post/product and render a unique card for every URL.

Correct dimensions

Capture at 1200×630 (or any size) so cards look right on X, LinkedIn, Slack, and Facebook.

Cache on your side

Render once, store the PNG on your CDN, and serve it from your own og:image URL.

No browser to run

No Puppeteer/Playwright fleet at build or request time — just an HTTPS call.

Real Chromium fidelity

What renders in Chrome is what ships in the card — fonts and CSS included.

FAQ

How do I generate dynamic OG images?

Build an HTML/CSS template for your social card, fill it with per-page data server-side, then POST the HTML to Rendershot's /v1/screenshot endpoint at 1200×630 to get a PNG. Cache it and reference it from your page's og:image meta tag.

What size should an OG image be?

1200×630 is the widely-supported standard for Open Graph and Twitter/X summary-large-image cards. Set the viewport to those dimensions in the request.

Do I need to run a headless browser?

No. Rendershot renders on its own Chromium fleet, so you don't install or scale Puppeteer/Playwright — you make one API call and cache the resulting image.

Is there a free tier?

Yes — 200 renders per month free, no credit card, enough to generate cards for a small site or prototype the pipeline.

Start rendering in minutes

Free plan includes 200 renders/month. No credit card required.

Start for free →