Tutorial

How to Generate Link Previews with an API

Create rich link preview images for chat apps, social media cards, and CMS tools using automated screenshots.

Steps

  1. Capture a thumbnailUse width=320&height=240&format=webp&quality=70 for optimized link preview thumbnails.
  2. Get metadata tooAdd meta=true to get the page title and description alongside the thumbnail for a complete preview.
  3. Cache for performanceSnapAPI caches screenshots by default (cache=true). Repeated requests are instant.

Code Examples

curl "https://snapapi.tech/v1/screenshot?url=https://example.com&api_key=YOUR_KEY&width=320&height=240&format=webp&quality=70&meta=true"
import requests

response = requests.get("https://snapapi.tech/v1/screenshot", params={
    "url": "https://example.com",
    "api_key": "YOUR_KEY",
    "width": "320", "height": "240",
    "format": "webp", "quality": "70",
    "meta": "true"
}).json()

print(f"Title: {response['title']}")
print(f"Image: {response['screenshot'][:50]}...")
const res = await fetch(
  "https://snapapi.tech/v1/screenshot?" + new URLSearchParams({
    url: "https://example.com",
    api_key: "YOUR_KEY",
    width: "320", height: "240",
    format: "webp", quality: "70",
    meta: "true"
  })
);
const data = await res.json();
console.log(data.title, data.screenshot.slice(0, 50));
Get Free API KeyFull API Docs