Open Graph Images

Auto-generate open graph images for every page.

Stop using static open graph images. Render a custom branded 1200×630 PNG for every blog post, product, or landing page, dynamically, via API.

Open graph image API

An open graph image API generates 1200×630 social preview images on demand from branded HTML templates. Instead of designing static images manually or running a self-hosted Puppeteer cluster, you POST a template and get a CDN-cached PNG back instantly, ready to serve as your og:image meta tag on every page, blog post, or product listing.

How the OG image API works

Three steps from HTML template to live og:image tag.

01

Build an HTML template

Create a branded 1200×630 HTML template with your title, description, and logo. Use any CSS you like.

02

POST the HTML + dynamic data

Send the rendered HTML to our API with format=png and image_width=1200, image_height=630.

03

Cache and serve the URL

Use response_type=url to get a CDN-backed URL back. Set it as your og:image meta tag and you're done.

Always on-brand

Your HTML template controls every pixel: logo, fonts, colors, layout. No compromise on design quality.

CDN-cached & fast

Set cache_ttl=86400 and the CDN serves the same image for 24 hours. Zero latency for repeat crawls.

Works with any framework

Next.js, Nuxt, Astro, SvelteKit: point your og:image route at our API and you're done.

No canvas, no Puppeteer

No complicated canvas rendering or self-hosted Puppeteer cluster. Send HTML, get PNG. That's it.

Dynamic og:image in one route.

// Next.js API route — /api/og
import { render } from './og-template'; // your HTML template

export default async function handler(req, res) {
  const { title, description } = req.query;

  const html = render({ title, description });

  const response = await fetch('https://screenshotcore.com/api/v1/screenshot', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.SCREENSHOT_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      source: 'html',
      html,
      format: 'png',
      image_width: 1200,
      image_height: 630,
      response_type: 'url',   // returns a CDN URL
      cache_ttl: 86400,        // cache for 24 hours
    }),
  });

  const { url } = await response.json();
  res.redirect(url); // og:image points here
}

Open graph image API: FAQ

What is an open graph image API?

An open graph image API generates 1200×630 social preview images automatically from an HTML template. Instead of designing static OG images manually, you send branded HTML to the API and get a PNG back, ready to serve as your og:image meta tag on any page.

How do I generate dynamic OG images automatically?

Build an HTML template with your title, description, and logo. POST the rendered HTML to the screenshot API with format=png, image_width=1200, and image_height=630. Use response_type=url to receive a CDN-backed URL and set it as your og:image tag. The image is cached and served instantly on every subsequent crawl.

What size should open graph images be?

The standard OG image size is 1200×630 pixels at a 1.91:1 aspect ratio. This works across Facebook, Twitter/X, LinkedIn, and Slack link previews. Pass image_width=1200 and image_height=630 to get the exact dimensions.

Can I cache generated open graph images?

Yes. Use response_type=url and set cache_ttl to your desired TTL in seconds (e.g. 86400 for 24 hours). The API returns a CDN-backed URL that serves the cached image for all repeat requests, with zero latency for social crawlers.

Dynamic OG images, starting free.

7-day free trial — 300 screenshots + 50 videos. No credit card required.

Get your free API key →