Skip to content

Rich previews for any URL

Generate thumbnail screenshots for links in your app. Show users what they're clicking before they click. Metadata extraction included.

ThumbnailsMetadataBatch APICDN Cached
import { Stack0 } from '@stack0/sdk'
const stack0 = new Stack0({ apiKey: process.env.STACK0_API_KEY })
// Generate a link preview thumbnail
export async function getLinkPreview(url: string) {
const { imageUrl, metadata } = await stack0.screenshot.capture({
url,
viewport: { width: 1200, height: 630 },
// Thumbnail optimized settings
format: 'webp',
quality: 80,
// Extract page metadata too
extractMetadata: true,
})
return {
thumbnail: imageUrl,
title: metadata.title,
description: metadata.description,
favicon: metadata.favicon,
}
}
// Batch generate previews for multiple links
export async function batchLinkPreviews(urls: string[]) {
const results = await stack0.screenshot.batch({
urls,
config: {
viewport: { width: 1200, height: 630 },
format: 'webp',
extractMetadata: true,
},
})
return results.map(r => ({
url: r.url,
thumbnail: r.imageUrl,
...r.metadata,
}))
}

What's included

Screenshot Capture

Reliable page rendering with JavaScript execution.

Metadata Extraction

Title, description, favicon, OG tags. Everything for rich previews.

Optimized Output

WebP format, configurable quality. Small files, fast loads.

Global Cache

Thumbnails cached at CDN edge. Instant delivery worldwide.

Auto Refresh

Set cache TTL for fresh previews. Pages change, previews update.

Fast Generation

Screenshots generated in seconds. Async API for non-blocking workflows.

Built for production

Visual context

Show users what a link looks like before they click. Builds trust, increases engagement.

Metadata extraction

Get title, description, and favicon alongside the thumbnail. Complete link cards.

Optimized thumbnails

WebP format, proper sizing. Fast-loading previews that look great.

Batch processing

Generate previews for multiple links at once. Perfect for feeds and lists.

Cached results

Thumbnails cached and served from CDN. Fast delivery, reduced API calls.

Simple pricing

$1 per 1,000 screenshots. Cached results served free.

Common implementations

Link Sharing

Rich previews when users share links in chat or comments.

Bookmark Manager

Visual thumbnails for saved bookmarks and reading lists.

Content Aggregation

Preview cards for curated links in newsletters or feeds.

Social Cards

Generate previews for links shared on your platform.

Frequently asked questions

Ready to build?

Get started in minutes.

Get Started