Use Case

Screenshot API for Link Previews

Generate rich link previews for any URL. Thumbnails for chat apps, bookmarks, directories, and content feeds.

The Problem

Most URLs don't have good previews

Building a link preview feature means handling missing OG tags, broken images, slow-loading pages, and inconsistent metadata. Every URL is different, and fallbacks are never clean enough.

  • Many sites have missing or broken Open Graph metadata
  • OG images are often low-quality or incorrectly sized
  • Rendering link previews in real-time is slow
  • Edge cases with SPAs, auth walls, and redirects
The Solution

A real screenshot beats any OG tag

Instead of relying on metadata, capture a real screenshot of the page. It's always accurate, always up-to-date, and always looks good.

Step 1

User pastes a URL

In your app, detect when a user shares or bookmarks a URL.

Step 2

Capture a thumbnail

Call the API with a small viewport (e.g., 1200x630) for a compact preview image.

Step 3

Display inline

Show the screenshot as a rich link preview in your UI. Cache for fast loading.

Code Example

Get started in minutes

A single API call is all you need.

curl
curl "https://api.porto.dev/v1/screenshot?url=https://news.ycombinator.com&width=1200&height=630&format=webp" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --output preview.webp

Try it in the playground

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

Key Features

Built for this use case

WebP output

Compressed WebP format for fast-loading thumbnails in web apps.

Custom dimensions

Set exact width and height for perfectly-sized preview cards.

CDN caching

Repeat requests are served from cache for instant link previews.

Block distractions

Clean previews without cookie banners or ad overlays.

Real-World Usage

How product teams use screenshot APIs for link previews

  • Rich link previews in chat and messaging apps
  • Bookmark managers with visual website thumbnails
  • Content aggregators and news readers with preview images
  • Internal tools that display URL references with context
Pricing

Starts free. 100 API calls/month.

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

Screenshot API for Link Previews | Porto