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 with 1280×720 WebP/PNG output for directory sites, URL shorteners, and RSS readers. Your application owns queueing and cache policy.

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

Generate thumbnails on first display, cache thereafter
Works across any public URL
Works from your existing worker or queue
WebP output for bandwidth-conscious previews

Results You Can Expect

1280×720
default output size
WebP
bandwidth-friendly format
7 days
example cache policy

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 Defaults

MetricValueContext
Default output1280×720WebP preferred; PNG fallback
Execution modeYour workerRecommended for batch pipelines
Failure behaviorExplicitRetry, then report failure
Latency targetMeasureBenchmark against your own URL set
Cache TTL7 daysKeyed 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.

Related Use Cases