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.
import { Stack0 } from '@stack0/sdk'const stack0 = new Stack0({ apiKey: process.env.STACK0_API_KEY })// Generate a link preview thumbnailexport async function getLinkPreview(url: string) {const { imageUrl, metadata } = await stack0.screenshot.capture({url,viewport: { width: 1200, height: 630 },// Thumbnail optimized settingsformat: 'webp',quality: 80,// Extract page metadata tooextractMetadata: true,})return {thumbnail: imageUrl,title: metadata.title,description: metadata.description,favicon: metadata.favicon,}}// Batch generate previews for multiple linksexport 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,}))}
Features
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.
Why Stack0
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.
Applications
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.
FAQ
Frequently asked questions
We extract the page title, description (from meta description or og:description), favicon URL, and og:image if available. This gives you everything needed to build rich link cards.
Generated thumbnails are cached on our CDN with a configurable TTL (default 24 hours). Subsequent requests for the same URL return the cached image instantly. You can force refresh by setting cache: false.
We wait up to 30 seconds for pages to load by default. You can configure waitForTimeout or waitForSelector to handle slow-loading content. Failed captures return an error without charging your quota.
Yes. Pass cookies or headers in your request to authenticate. This is useful for generating previews of content behind login walls for authorized users.
We recommend 1200x630 for full-size previews (og:image standard) or 400x300 for thumbnails. The best size depends on how you display previews in your UI.
Ready to build?
Plans start at $5/month.