Skip to content

Use Case

Automate social preview and Open Graph images

Automate social preview image generation with the screenshot API. Capture styled templates or live pages as Open Graph images, Twitter cards, and LinkedIn preview cards — every link your team shares looks polished and on-brand.

Social image use cases

🖼️

Open Graph image generation

Generate OG images by screenshotting styled HTML templates at the exact dimensions social platforms expect (1200x630). Every blog post, product page, or landing page gets a unique, on-brand preview image.

  • Screenshot a styled HTML template with dynamic title and branding
  • Generate unique OG images for every blog post at publish time
  • Update preview images automatically when page content changes
🐦

Twitter card images

Capture pages at Twitter summary card dimensions (1200x600) for consistent, branded sharing. Use custom CSS or a dedicated template URL to control exactly how your content appears.

  • Generate summary_large_image cards for every article
  • Create custom Twitter card designs with dynamic content
  • Batch-generate cards for an entire blog or content library
💼

LinkedIn post previews

Create professional-looking link preview images for LinkedIn shares. Capture your pages or custom templates at the right aspect ratio so posts stand out in the feed.

  • Generate preview images for company blog posts and announcements
  • Create branded link previews for product launches
  • Automate preview images for job listings and event pages
💬

Slack and messaging unfurls

When someone pastes a URL in Slack, Teams, or Discord, the unfurl preview image matters. Generate crisp, branded preview images so your links look polished in every chat.

  • Ensure internal tools and dashboards unfurl with clear preview images
  • Generate preview images for documentation and wiki pages
  • Create branded unfurl images for SaaS product links

Dynamic on-demand generation

Call the screenshot API from your backend to generate preview images on-demand when pages are created or updated. Serve the images from S3 or your CDN with proper cache headers.

  • Generate OG images in a post-publish webhook or CI pipeline
  • Serve dynamically generated images via a CDN edge function
  • Regenerate preview images when page titles or content change
📦

Batch generation for existing content

Have a content library with missing or generic OG images? Submit all your URLs to the batch endpoint and get branded preview images for every page in one job.

  • Retroactively generate OG images for an entire blog archive
  • Create preview images for a product catalog or directory
  • Generate social images for all pages in a sitemap

API features you can leverage

Go beyond basic screenshots — inject branding, extract metadata, and deliver images to your CDN automatically.

Inject JavaScript for dynamic overlays

Use script_inline to add watermarks, branding, or dynamic text overlays before the screenshot is captured.

script_inline=(function() {
  var badge = document.createElement("div");
  badge.style = "position:fixed;bottom:16px;right:16px;
    background:#146aea;color:#fff;font-size:14px;
    padding:8px 16px;border-radius:8px;z-index:999999;
    font-family:sans-serif;font-weight:bold";
  badge.textContent = "Read on yourblog.com";
  document.body.append(badge);
})()

Adds a branded call-to-action badge to every social preview image — no image editor needed.

Extract Open Graph metadata with trackers

Use trackers to verify that your og:title, og:description, and og:image tags are rendering correctly before sharing.

GET /api/screenshot/create
  ?url=https://blog.example.com/post-slug
  &screen_width=1200&screen_height=630
  &trackers[0][name]=og_title
  &trackers[0][selector]=meta[property="og:title"]
  &trackers[0][type]=attribute
  &trackers[0][attribute]=content
  &trackers[1][name]=og_image
  &trackers[1][selector]=meta[property="og:image"]
  &trackers[1][type]=attribute
  &trackers[1][attribute]=content

Screenshot + og:title + og:image URL returned as structured JSON — verify before publishing.

Auto-deliver to your CDN with date paths

Use the apps parameter with date placeholders to deliver generated images straight to your S3 bucket or CDN storage.

apps[s3]=og-images/{yyyy}/{mm}/{url_path}.png
apps[google-drive]=Social/{yyyy}-{mm}/{domain}.png

Images land at og-images/2026/03/post-slug.png — reference the URL in your og:image meta tag.

Pixel-perfect viewport control

Set screen_width and screen_height to exact social platform dimensions — 1200x630 for OG, 1200x600 for Twitter, 1080x1080 for Instagram.

GET /api/screenshot/create
  ?url=https://template.example.com/card?title=My+Post
  &screen_width=1200
  &screen_height=630
  &device_scale=2    # 2x for retina quality
  &delay=2           # Wait for fonts to load

Outputs a 2400x1260 retina image that looks crisp on every social platform.

How it works

1

Design a template

Create an HTML page with your brand styling that accepts dynamic data via query params or path.

2

Call the API

Pass the template URL with parameters. Set viewport to 1200x630 for OG images.

3

Deliver to storage

Send the image to S3, Google Drive, or any CDN-backed storage via app integrations.

4

Reference in meta tags

Set the image URL as your og:image and twitter:image meta tags.

Frequently asked questions

What dimensions should I use for social preview images?

The most common is 1200x630 pixels for Open Graph (Facebook, LinkedIn). Twitter summary_large_image uses 1200x600. Set the viewport width and height in the API request to match the platform.

Can I screenshot a custom HTML template instead of a live URL?

Yes. Host a lightweight HTML template that accepts parameters (title, author, image) via query string, then screenshot that URL. The API renders the full page including CSS, fonts, and images.

How do I serve the generated images?

Use an app integration to deliver images directly to S3, Google Drive, or any CDN-backed storage. Reference the image URL in your og:image meta tag.

Can I generate images for thousands of pages?

Yes. Use the batch endpoint to submit all your URLs at once. Each page gets its own screenshot, and results are delivered as they complete.

Do the images support custom fonts and CSS?

Yes. ScreenshotCenter renders in real Chrome, Brave, or Firefox browsers with full CSS, web font, and JavaScript support. Your images look exactly like the rendered page.