Use Case

Social Media Previews

Generate beautiful link previews and social media cards. Create eye-catching thumbnails that drive clicks and engagement.

Overview

When someone shares your link on Twitter, LinkedIn, Slack, or Discord, the preview image is often the difference between a click and a scroll. Generic or broken previews kill engagement. Professional, eye-catching previews drive traffic.

Screenshotly lets you generate dynamic Open Graph images programmatically. Instead of manually creating static og:image files for every page, you can capture live screenshots of your content and serve them as social previews. This is especially powerful for blogs, product pages, and user-generated content where each page is unique.

Our device mockup feature takes this further. Wrap your screenshots in beautiful browser frames, iPhone mockups, or MacBook frames to create premium-looking social cards that stand out in busy feeds. Combined with our AI cleanup that removes distracting elements, your shares look polished and professional every time.

Key Benefits

Generate OG images automatically
Create Twitter card previews
Ensure consistent branding
Boost social media engagement

Results You Can Expect

2.3x
higher click-through rate
40%
more social shares
< 2s
generation time with caching

How It Works

1

Identify pages that need dynamic social previews

2

Set up an API endpoint that generates previews on demand

3

Call Screenshotly with the page URL and mockup preferences

4

Cache the generated images with appropriate TTL

5

Serve the cached images via your og:image meta tags

Code Example

// Generate social media preview
const response = await fetch('https://api.screenshotly.app/screenshot', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://your-blog.com/article',
    device: 'desktop',
    format: 'png',
    fullPage: false,
    mockup: 'browser-light',
  }),
});

Frequently Asked Questions

How do I generate dynamic Open Graph images for social media?

Use Screenshotly to capture live screenshots of your pages and serve them as og:image meta tags. This creates unique, up-to-date previews for each page that reflect your current content and branding.

What's the optimal image size for social media previews?

For maximum compatibility, use 1200x630 pixels (1.91:1 aspect ratio). This works perfectly for Facebook, Twitter, LinkedIn, and most other social platforms. Our API can automatically resize to this dimension.

Can I add device mockups to social media previews?

Yes! Our browser, iPhone, and MacBook mockups make your social previews stand out in feeds. Device mockups create a premium look that increases click-through rates by up to 2.3x compared to plain screenshots.

How do I handle caching for social media images?

Cache generated images for at least 24 hours to reduce API costs and improve performance. Use URL parameters or timestamps to bust cache when content changes. Most social platforms cache images for several days.

Want a step-by-step walkthrough?

Read: Dynamic OG Image Generation Guide

Ready to automate social media?

Get started with 100 free screenshots. No credit card required.

Related Use Cases