Use Case

Screenshot API for Social Media Previews

Generate OG images, Twitter cards, and social previews from any URL. One API call, pixel-perfect results.

The Problem

Social previews are broken by default

When someone shares your link on Slack, Twitter, or LinkedIn, the preview can look terrible — or show nothing at all. Building a custom OG image pipeline means running headless browsers, managing fonts, and handling edge cases across dozens of platforms.

  • Blank or broken previews when meta tags are missing
  • Running headless Chrome just to render a card
  • Different platforms crop and scale differently
  • Keeping previews up-to-date as content changes
The Solution

One API call to a perfect social card

Point the API at any URL and get a clean, correctly-sized screenshot optimized for social sharing. Set custom viewport sizes to match OG image dimensions.

Step 1

Set the viewport to 1200x630

The standard OG image size. Porto renders at exactly this resolution.

Step 2

Capture the page

A single GET request returns a PNG or WebP screenshot, ready to use as an og:image.

Step 3

Cache and serve

Built-in CDN caching means repeat requests are instant. Set a TTL to auto-refresh.

Code Example

Get started in minutes

A single API call is all you need.

curl
curl "https://api.porto.dev/v1/screenshot?url=https://your-site.com&width=1200&height=630&format=png" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --output og-image.png

Try it in the playground

See results instantly with pre-configured defaults for this use case.

Key Features

Built for this use case

Custom viewport sizes

Set exact dimensions for OG images (1200x630), Twitter cards (1200x600), or any custom size.

Format options

Output as PNG for quality or WebP for smaller file sizes. Perfect for social platforms.

CDN caching

Screenshots are cached at the edge. Repeat requests return instantly without re-rendering.

Block distractions

Remove cookie banners, ads, and popups so your social previews look clean.

Real-World Usage

How marketing teams use screenshot APIs for social previews

  • Auto-generate OG images for blog posts and landing pages
  • Create dynamic social cards for product pages at scale
  • Preview how URLs will look before sharing on social platforms
  • Build internal tools that generate branded social images
Pricing

Starts free. 100 API calls/month.

No credit card required. Scale up as you need with simple, predictable pricing.

Screenshot API for Social Media Previews | Porto