Website Thumbnails
Generate high-quality website thumbnails programmatically. A common building block for directory sites, URL shorteners, and link-preview services.
Overview
Any product that displays user-submitted or curated URLs benefits from a thumbnail preview — directory sites, URL shorteners, RSS readers, bookmarking apps. Without one, a list of URLs is just text.
A screenshot API is the canonical way to produce these at scale. Request a capture on first display, cache aggressively, and fall back to the page's `og:image` meta tag for URLs that fail to render cleanly.
Thumbnail workloads split into two modes: sync (a user is waiting) and asynchronous (a crawler queued a batch). Screenshotly exposes the synchronous capture primitive; run it from your own worker when you need batch retries or longer-lived orchestration.
Aggressive caching is non-negotiable. A URL like `https://example.com` rarely changes in a way that matters for a 1280×720 thumbnail, so a 7-day CDN cache keyed on the source page's ETag compresses a 10k-request month into fewer than 500 actual captures.
Key Benefits
Results You Can Expect
How It Works
On URL submission, fire a capture request
Show a skeleton preview while capture is in flight
Cache the final image on a CDN with a 7-day TTL
Regenerate when the source page Last-Modified changes
Code Example
// Generate a website thumbnail
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://example.com',
format: 'webp',
viewport: { width: 1280, height: 720 },
fullPage: false,
}),
});Thumbnail Pipeline Defaults
| Metric | Value | Context |
|---|---|---|
| Default output | 1280×720 | WebP preferred; PNG fallback |
| Execution mode | Your worker | Recommended for batch pipelines |
| Failure behavior | Explicit | Retry, then report failure |
| Latency target | Measure | Benchmark against your own URL set |
| Cache TTL | 7 days | Keyed on Last-Modified / ETag |
Frequently Asked Questions
How fast can the thumbnail pipeline run?
Capture time depends on the target page, network activity, and selected options. Use durable jobs for predictable queue handling and measure latency against your own URL set before setting an SLO.
What happens when a URL blocks headless browsers?
The capture returns an explicit failure after retry policy is exhausted. Your application can then use its own fallback, such as an existing og:image or a placeholder.
Should I use PNG or WebP?
WebP for in-page previews — smaller file, equivalent quality. PNG when you need wider client compatibility or lossless output.
When this isn't the right fit
Screenshotly is not ideal for every workflow. Consider a different approach if any of the following apply:
- Your URLs are gated behind logins (LinkedIn profiles, private Facebook posts). Logged-out renders will be blank.
- You need thumbnails of interactive content like video or game pages. A single still cannot represent dynamic content; you need a short MP4 capture.
- You need sub-1s p99 per thumbnail. Real-browser rendering cannot match that consistently.
Want a step-by-step walkthrough?
Read: Website Thumbnail Generation Guide →Ready to automate thumbnails?
Get started with 100 free screenshots. No credit card required.