Website Thumbnail API: Generate URL Preview Images

Generate website thumbnail images from any URL via API. Viewport or full-page captures, custom dimensions, JPEG or PNG. Cache in Redis, serve from S3. No browser required.

Start Free — 200 captures/moView Docs

Website Thumbnail Generation via API

Website thumbnails are used everywhere: link preview cards in productivity tools, bookmark managers, site galleries, browser extension new tab pages, and competitive research dashboards. Generating them requires a real browser render — static HTTP fetches only retrieve server-rendered HTML without loading CSS, fonts, or JavaScript-driven content. SnapAPI provides a single API endpoint that returns a ready-to-use thumbnail image for any URL.

Generate a Thumbnail

# Viewport-only thumbnail (fast, no scroll)
curl "https://api.snapapi.pics/v1/screenshot?url=https://example.com&width=1280&height=800&format=jpeg&quality=80" \
  -H "X-Api-Key: YOUR_API_KEY" \
  --output thumbnail.jpg

# Full-page thumbnail
curl "https://api.snapapi.pics/v1/screenshot?url=https://example.com&full_page=true&format=jpeg&quality=75" \
  -H "X-Api-Key: YOUR_API_KEY" \
  --output full-page.jpg

For bookmark managers and link cards, the viewport-only capture at 1280x800 is the right choice: it shows exactly what the page looks like on a typical laptop screen and loads fast because it does not scroll the full page length. JPEG at quality 75-80 keeps file sizes under 150 KB for most sites, acceptable for thumbnail use.

Thumbnail Service in Node.js

// Express route: GET /thumbnail?url=https://example.com
app.get("/thumbnail", async (req, res) => {
  const { url } = req.query;
  const cacheKey = `thumb:${url}`;

  // Check Redis cache
  const cached = await redis.getBuffer(cacheKey);
  if (cached) {
    res.setHeader("Content-Type", "image/jpeg");
    res.setHeader("X-Cache", "HIT");
    return res.send(cached);
  }

  // Generate via SnapAPI
  const params = new URLSearchParams({ url, width: "1280", height: "800", format: "jpeg", quality: "80" });
  const snap = await fetch(`https://api.snapapi.pics/v1/screenshot?${params}`,
    { headers: { "X-Api-Key": process.env.SNAPAPI_KEY } });
  const buf = Buffer.from(await snap.arrayBuffer());

  await redis.setEx(cacheKey, 86400, buf); // 24h TTL
  res.setHeader("Content-Type", "image/jpeg");
  res.setHeader("X-Cache", "MISS");
  res.send(buf);
});

The Redis cache prevents duplicate API calls for the same URL within 24 hours. On a bookmark manager with 10,000 saved links, a cache hit rate above 90% means only 1,000 SnapAPI calls needed per day for all thumbnail renders.

Thumbnail Size and Format Recommendations

Different thumbnail use cases call for different dimensions. For new tab page browser extensions: 1280x800 JPEG at quality 80. For link cards in productivity tools: 640x400 JPEG at quality 80. For social media OG images: 1200x630 JPEG at quality 85. For site gallery grids: 320x200 JPEG at quality 75. For retina displays, double the dimensions and use quality 70 — the smaller file size from lower quality compensates for the larger pixel count.

Start with 200 free thumbnail captures at snapapi.pics. No credit card required. All size and format parameters are available on the free tier.

Thumbnail API Use Cases

Website thumbnail generation solves real problems across many product categories. Bookmark managers (Raindrop, Pocket, Pinboard) use thumbnails to make saved links visually scannable. Developer tools and dashboards embed site previews next to monitoring alerts so on-call engineers see context at a glance. Browser extension new tab pages display thumbnails of recently visited or frequently opened sites. Content aggregators and RSS readers show article thumbnails to increase click-through. Competitive intelligence tools visualize competitor websites at a glance rather than requiring manual visits.

Each of these use cases benefits from SnapAPI's JavaScript rendering: thumbnails show the actual rendered state of each page rather than blank screens from sites that load content via JavaScript. Stealth mode ensures even sites with bot detection return useful renders rather than CAPTCHA challenges.

Thumbnail Batch Generation

# Python — generate thumbnails for a list of URLs
import requests, concurrent.futures, os

def thumbnail(url, api_key):
    resp = requests.get(
        "https://api.snapapi.pics/v1/screenshot",
        params={"url": url, "width": "1280", "height": "800", "format": "jpeg", "quality": "80"},
        headers={"X-Api-Key": api_key},
        timeout=30
    )
    return resp.content if resp.ok else None

urls = [
    "https://github.com",
    "https://vercel.com",
    "https://stripe.com",
]

api_key = os.environ["SNAPAPI_KEY"]
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as ex:
    results = list(ex.map(lambda u: thumbnail(u, api_key), urls))

for url, data in zip(urls, results):
    if data:
        fname = url.replace("https://", "").replace("/", "_") + ".jpg"
        open(fname, "wb").write(data)
        print(f"Saved {fname}: {len(data)} bytes")

The ThreadPoolExecutor with max_workers=5 keeps concurrent requests within plan limits while processing the URL list much faster than sequential requests.

Thumbnail API vs Self-Hosted Solutions

Several open-source projects exist for self-hosted website thumbnails: Browsershot (PHP/Laravel), node-webshot, and plain Puppeteer or Playwright scripts. All require maintaining a Chromium installation on your servers, configuring system dependencies, managing memory usage from concurrent browser processes, and handling the operational concerns of a long-running headless browser service. For teams that want thumbnails without this overhead, a managed API is the faster and more reliable choice.

SnapAPI handles Chromium updates automatically, rotates through multiple browser instances under load, and applies stealth mode to retrieve accurate renders from sites that block obvious headless browsers. For sites behind Cloudflare or DataDome, self-hosted Playwright frequently returns blank pages or CAPTCHA screens. SnapAPI stealth mode produces real renders on the vast majority of such sites.

Integrating Thumbnails in Your Product

For a SaaS product adding URL preview thumbnails to a feed or dashboard, the minimal integration is: add a backend endpoint that accepts a URL parameter, calls SnapAPI with your chosen dimensions, caches the result with Redis, and returns the image. The frontend simply renders an <img> tag pointing at this proxy endpoint. Total engineering time from zero to production-ready thumbnail service: two to four hours.

Sign up at snapapi.pics for 200 free thumbnail captures per month. No billing information required. All size and format parameters available on the free tier. Scale to 500,000 captures per month on the Business plan as your product grows.

Mobile Thumbnails and Device Emulation

For applications that need to show both desktop and mobile previews of a URL, SnapAPI device emulation eliminates the need to maintain separate browser instances for each profile. Pass device=iPhone_15 for a mobile thumbnail alongside your standard desktop capture:

// Generate both desktop and mobile thumbnails in parallel
const [desktop, mobile] = await Promise.all([
  fetch(`https://api.snapapi.pics/v1/screenshot?url=${url}&width=1280&height=800&format=jpeg`, opts),
  fetch(`https://api.snapapi.pics/v1/screenshot?url=${url}&device=iPhone_15&format=jpeg`, opts),
]).then(([d, m]) => Promise.all([d.arrayBuffer(), m.arrayBuffer()]));

Both requests fire concurrently and resolve together with Promise.all. The mobile thumbnail uses iPhone 15 dimensions and user agent automatically — no viewport configuration needed in your code.

Storing Thumbnails in S3

For applications that serve thumbnails at scale, store them in S3 and serve via CloudFront. On the first request for a URL, generate the thumbnail with SnapAPI, upload to S3 with a key based on a hash of the URL and parameters, and store the S3 URL in your database. Subsequent renders skip SnapAPI entirely and use the stored S3 URL.

Set an S3 object lifecycle rule to expire thumbnails after 30 days. When a thumbnail is requested after expiry, regenerate it and update the stored URL. This keeps your thumbnail storage fresh without manual cache invalidation.

Start building your thumbnail service at snapapi.pics. Free tier: 200 captures per month, no credit card. The Business plan at $299/month covers 500,000 captures — sufficient for a large bookmark manager or link feed product.

Thumbnail API Pricing

All SnapAPI plans include full access to the screenshot endpoint for thumbnail generation. Free: 200 captures per month — enough to prototype a thumbnail feature and test it against real URLs in development. Starter at $19/month: 5,000 captures — suitable for a small productivity tool with a few hundred active users each saving a handful of URLs per day. Pro at $79/month: 50,000 captures — right for a mid-size bookmark manager or link aggregator with thousands of daily active users. Business at $299/month: 500,000 captures — for large-scale URL preview services, browser extension backends, or competitive research platforms processing thousands of new URLs per day.

With aggressive Redis caching (24-hour TTL on thumbnail results), your actual monthly API call count is much lower than your total thumbnail render count. A product with 50,000 unique URLs in its database may only need 2,000-5,000 SnapAPI calls per month to serve all thumbnail requests if cache hit rates are high.

Start at snapapi.pics with 200 free captures. No credit card required. Full parameter documentation at snapapi.pics/docs.html.

Website Thumbnail API Summary

SnapAPI gives any web application the ability to generate accurate website thumbnails without running headless browsers. The same API key covers all endpoints — screenshot, scrape, extract, PDF, video, and AI analysis — so your thumbnail service can expand into a full web capture platform as your product needs grow. Register at snapapi.pics and generate your first thumbnail in under five minutes.

website thumbnail api url thumbnail generator link preview image website screenshot thumbnail service api
thumbnail api url preview image generator service
url thumbnail image api site preview capture
link thumbnail image website preview api
website thumbnail generator url preview image service api
website thumbnail url preview image
website thumbnail api url preview image generation link