Use Case

Website Thumbnails

Generate high-quality website thumbnails programmatically. A common building block for directory sites, URL shorteners, and link-preview services.

Quick summaryURL-to-thumbnail generation at scale. 1280×720 default, WebP/PNG, 7-day CDN cache. p50 ~1.8s, p99 ~4s. Used by directory sites, URL shorteners, and RSS readers.

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 (user just submitted a URL and is watching a spinner) and async (crawler queued a batch overnight). Design for both — a sync-optimized endpoint with a 6-second timeout plus a separate worker queue for batch with a 20-second timeout and retries.

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

Generate thumbnails on first display, cache thereafter
Works across any public URL
Graceful fallback for hostile sites (paywalls, anti-bot blocks)
WebP output is ~75% smaller than PNG

Results You Can Expect

1280×720
default output size
~1.8s
p50 capture latency
~93%
cache hit rate at steady state

How It Works

1

On URL submission, fire a capture request

2

Show a skeleton preview while capture is in flight

3

Cache the final image on a CDN with a 7-day TTL

4

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 Benchmarks

MetricValueContext
Default output1280×720WebP preferred; PNG fallback
p50 capture latency1.8sStandard URL, networkidle
p99 capture latency~4sIncludes slow SPAs
Cache hit rate~93%Steady-state on typical workloads
Cache TTL7 daysKeyed on Last-Modified / ETag

Frequently Asked Questions

How fast can the thumbnail pipeline run?

p50 ~1.8 seconds, p99 ~3–4 seconds for live captures. Cached hits return in under 100ms from your CDN.

What happens when a URL blocks headless browsers?

Fall back to the page's og:image meta tag if one is set; otherwise serve a branded placeholder. This pattern covers roughly 99% of the long tail.

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.

Related Use Cases