Skip to content
SCREENSHOT · USE CASE

Open Graph Image Generation API

Render social preview cards from a real HTML page instead of hand-drawing them in a canvas library. Design the card in the framework you already use, capture it at 1200×630, cache it on the edge.

Render social preview cards from a real HTML page instead of hand-drawing them in a canvas library. Design the card in the framework you already use, capture it at 1200×630, cache it on the edge.

Why render from HTML at all

Most OG-image tooling asks you to rebuild your design in an imperative drawing API — position rectangles, measure text, discover that your webfont never loaded. Rendering a normal HTML route is the shortcut: build /og/post-slug as a page, style it with the CSS you already have, and capture it at Open Graph dimensions. The card and the site cannot drift apart, because the card *is* the site.

The request

POSTscreenshot.sh
curl https://api.renderkit.tech/v1/screenshot \
  -H "x-api-key: $RENDERKIT_API_KEY" \
  -H "content-type: application/json" \
  -d '{ "url": "https://example.com", "full_page": true, "block_ads": true }'

Options that matter here

  • Fixed 1200×630 viewport with device_scale: 2 for crisp cards on retina displays
  • Webfonts, gradients, and CSS masks all work — it is a real browser, not a canvas shim
  • Edge-cached by request, so repeat crawls of the same post cost one render
  • wait_for_selector holds the capture until fonts and images have settled

More

Full screenshot API reference · API docs · compare RenderKit vs ScreenshotOne.

Common questions

Build an HTML route that renders the card, then POST that route to /v1/screenshot with a 1200×630 viewport. Point og:image at the returned signed URL, or at your own cached copy of it.

1200×630 is the safe default: Facebook, LinkedIn, and Slack all accept it, and X crops it predictably for summary_large_image. Render at device_scale 2 so it stays sharp on high-DPI displays.

Per image, a canvas library is faster because no browser starts. In practice that difference disappears behind an edge cache, and you trade it for using your real design system instead of reimplementing it.

RenderKit starts at $9/mo with 500 free renders, and screenshots, PDFs, and markdown extraction all draw from the same meter — there is no separate per-primitive plan.

Ship your first render in 60 seconds.

500 free renders to start. No card. Cancel by ignoring it.

Get your free key$npm i renderkit-sdk