Built for Real-World Applications
From link previews to PDF generation — see how developers use CaptureAPI to power their applications with code examples.
Link Previews
Generate rich link previews for chat applications, social platforms, and content management systems. Show users a visual snapshot of any URL before they click.
- ✓Automatically capture thumbnails when users share links
- ✓Cache previews for faster subsequent loads
- ✓Support for custom viewport sizes to match your UI
- ✓Works with SPAs, dynamic content, and authenticated pages
// Generate a link preview thumbnail
const preview = await fetch(
"https://captureapi.dev/api/v1/screenshot?" +
new URLSearchParams({
url: "https://github.com/vercel/next.js",
width: "600",
height: "400",
format: "webp"
}),
{ headers: { "X-API-Key": "cap_your_key" } }
);Website Monitoring
Track visual changes on any website. Detect layout shifts, broken pages, and unauthorized content updates by comparing periodic screenshots.
- ✓Schedule periodic captures via cron jobs or webhooks
- ✓Compare screenshots pixel-by-pixel to detect changes
- ✓Alert on visual regressions before users report them
- ✓Full-page captures for comprehensive coverage
# Capture a full-page screenshot for monitoring
curl "https://captureapi.dev/api/v1/screenshot?\
url=https://your-site.com&\
fullPage=true&\
format=png&\
width=1280" \
-H "X-API-Key: cap_your_key" \
-o "snapshot-$(date +%Y%m%d).png"PDF Reports
Convert HTML dashboards, invoices, and reports into professionally formatted PDF documents. Perfect for automated report generation and document workflows.
- ✓Convert any URL or HTML content to PDF
- ✓Control page size, margins, headers, and footers
- ✓Support for A4, Letter, Legal, and custom page sizes
- ✓Ideal for invoices, receipts, and financial reports
import requests
# Generate a PDF invoice
response = requests.get(
"https://captureapi.dev/api/v1/pdf",
params={
"url": "https://your-app.com/invoice/123",
"format": "A4",
"margin": "20mm"
},
headers={"X-API-Key": "cap_your_key"}
)
with open("invoice-123.pdf", "wb") as f:
f.write(response.content)Dynamic OG Images
Generate unique Open Graph images for every page on your site. No more generic social previews — each link gets a custom-designed card with your content.
- ✓Template-based generation with custom variables
- ✓Supports custom fonts, logos, and background images
- ✓Instant generation — no pre-rendering needed
- ✓Perfect for blogs, e-commerce, and SaaS platforms
// Next.js: dynamic OG image in metadata
export async function generateMetadata({ params }) {
const ogUrl = new URL(
"https://captureapi.dev/api/v1/og"
);
ogUrl.searchParams.set("title", params.title);
ogUrl.searchParams.set("theme", "gradient");
return {
openGraph: {
images: [{ url: ogUrl.toString() }]
}
};
}Website Thumbnails
Generate thumbnails for website directories, portfolios, bookmark managers, and search results. Give users a visual preview of any URL.
- ✓Fast thumbnail generation at any resolution
- ✓WebP format for optimal file size
- ✓Custom viewport sizes for consistent layouts
- ✓Batch processing for large directories
// Generate thumbnails for a website directory
const urls = [
"https://github.com",
"https://vercel.com",
"https://nextjs.org"
];
const thumbnails = await Promise.all(
urls.map(url =>
fetch(
`https://captureapi.dev/api/v1/screenshot?` +
`url=${encodeURIComponent(url)}` +
`&width=400&height=300&format=webp`,
{ headers: { "X-API-Key": "cap_key" } }
)
)
);Ready to build?
Start capturing screenshots, generating PDFs, and creating OG images today. Free tier includes 200 screenshots/month.
Social Media Cards
Create dynamic Open Graph images for blog posts, product pages, and marketing campaigns. Every shared link gets a beautiful, branded preview card.