API Documentation
SnapAPI is a developer media toolkit — screenshots, PDFs, OG images, QR codes, and URL metadata in one API.
https://snap-apii.comAll endpoints are under
/v1/. All responses include CORS headers.
Quickstart
Try any endpoint instantly — no API key needed for the free tier:
# Screenshot
curl "https://snap-apii.com/v1/screenshot?url=https://example.com" -o shot.png
# PDF
curl "https://snap-apii.com/v1/pdf?url=https://example.com" -o page.pdf
# URL metadata
curl "https://snap-apii.com/v1/unfurl?url=https://github.com"
# OG image
curl "https://snap-apii.com/v1/og-image?title=Hello+World&theme=dark" -o og.svg
# QR code
curl "https://snap-apii.com/v1/qr?data=https://example.com" -o qr.svg
Authentication
Pass your API key via header (recommended) or query parameter:
# Header (recommended)
Authorization: Bearer snap_abc123...
# Query parameter
?api_key=snap_abc123...
Without a key, the free tier applies (100 operations/day per IP).
Rate Limits
All tools share one rate limit. Cached responses don't count.
| Tier | Daily | Monthly | Price |
|---|---|---|---|
| Free | 100 | 3,000 | $0 |
| Starter | 500 | 15,000 | $19/mo |
| Pro | 2,500 | 75,000 | $49/mo |
| Business | 10,000 | 300,000 | $99/mo |
| Scale | 50,000 | 1,500,000 | $199/mo |
Rate limit headers on every response:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 2026-03-28T00:00:00.000Z
Screenshot
GET /v1/screenshot
Capture a webpage as PNG, JPEG, or WebP using a full Chromium browser.
GET /v1/screenshot?url=https://stripe.com&width=1280&format=png&full_page=true
Returns: Binary image with Content-Type: image/png
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | required | URL to capture (must include https://) |
width | int | 1280 | Viewport width (320-3840) |
height | int | 800 | Viewport height (240-2160) |
format | string | png | png, jpeg, or webp |
quality | int | 80 | 1-100 (jpeg/webp only) |
full_page | bool | false | Capture full scrollable page |
delay | int | 0 | Wait ms after load (max 10000) |
selector | string | — | CSS selector for element capture |
dark_mode | bool | false | Emulate dark color scheme |
PDF Generation
GET /v1/pdf?url=<url>
POST /v1/pdf with JSON body
Generate a PDF from a URL or raw HTML.
From URL
GET /v1/pdf?url=https://example.com&format=A4&landscape=true
From HTML
POST /v1/pdf
Content-Type: application/json
{
"html": "<h1>Invoice #123</h1><p>Amount: $49.00</p>",
"format": "A4",
"margin": "20mm"
}
Returns: PDF binary with Content-Type: application/pdf
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | — | URL to convert (url OR html required) |
html | string | — | Raw HTML to convert (POST only) |
format | string | A4 | A4, Letter, A3, Legal |
landscape | bool | false | Landscape orientation |
margin | string | 20mm | Page margin (CSS units) |
print_background | bool | true | Include background colors/images |
scale | float | 1 | Scale factor 0.1-2 |
URL Unfurling
GET /v1/unfurl
Extract metadata from any URL — title, description, OG image, favicon, author, and more.
GET /v1/unfurl?url=https://github.com
Returns:
{
"success": true,
"data": {
"url": "https://github.com",
"title": "GitHub · Build and ship software on a single platform",
"description": "Millions of developers and companies build...",
"image": "https://github.githubassets.com/assets/social-...",
"favicon": "https://github.com/favicon.ico",
"site_name": "GitHub",
"type": "website",
"author": null,
"published": null,
"domain": "github.com",
"canonical": "https://github.com",
"theme_color": "#1e2327",
"twitter_card": "summary_large_image",
"twitter_site": "@github",
"locale": "en_US"
},
"meta": { "cached": false, "response_time_ms": 280 }
}
| Parameter | Type | Description |
|---|---|---|
url | string | URL to extract metadata from (required) |
OG Image Generator
GET /v1/og-image
Generate dynamic social sharing images. Use the URL directly as your og:image.
<meta property="og:image"
content="https://snap-apii.com/v1/og-image?title=My+Blog+Post&subtitle=By+Tom&theme=gradient&domain=myblog.com" />
| Parameter | Type | Default | Description |
|---|---|---|---|
title | string | required | Main title text |
subtitle | string | — | Subtitle / description |
domain | string | — | Domain badge in bottom-left |
theme | string | dark | dark, light, blue, green, purple, orange, gradient |
width | int | 1200 | Image width |
height | int | 630 | Image height |
font_size | int | auto | Override auto-calculated font size |
Returns: SVG image with Content-Type: image/svg+xml. Cached 7 days.
QR Code Generator
GET /v1/qr
Generate QR codes as SVG. Supports custom colors, sizes, and error correction.
<img src="https://snap-apii.com/v1/qr?data=https://myapp.com&size=256&fg_color=%231e293b" />
| Parameter | Type | Default | Description |
|---|---|---|---|
data | string | required | Text or URL to encode (max 4296 chars) |
size | int | 256 | Image size in pixels |
fg_color | string | #000000 | Foreground color (hex) |
bg_color | string | #ffffff | Background color (hex) |
ec | string | M | Error correction: L, M, Q, H |
margin | int | 4 | Quiet zone (modules) |
Returns: SVG image. Cached 7 days. Same input = same image forever.
Signup
POST /v1/signup
curl -X POST https://snap-apii.com/v1/signup \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com"}'
// Response:
{
"success": true,
"data": {
"api_key": "snap_a1b2c3d4e5f6...",
"tier": "free",
"daily_limit": 100,
"message": "Welcome to SnapAPI!"
}
}
Usage
GET /v1/usage
Check your current usage across all endpoints. Requires API key.
curl https://snap-apii.com/v1/usage -H "Authorization: Bearer YOUR_KEY"
Billing
POST /v1/billing/checkout — Create Stripe checkout session
POST /v1/billing/portal — Access Stripe customer portal
// Upgrade to a paid plan
curl -X POST https://snap-apii.com/v1/billing/checkout \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "tier": "starter"}'
// Manage subscription
curl -X POST https://snap-apii.com/v1/billing/portal \
-H "Content-Type: application/json" \
-d '{"api_key": "snap_..."}'
Caching
All responses are cached at Cloudflare's 300+ edge locations.
- Screenshots & PDFs: 24 hour cache
- Unfurl: 1 hour cache (metadata changes)
- OG Images & QR Codes: 7 day cache (deterministic output)
- Cache hits don't count against your daily limit
X-Cache: HITorMISSin response headers- Add
&_bust=timestampto force a fresh result
Error Codes
| Status | Meaning | What to do |
|---|---|---|
| 200 | Success | Image/PDF/JSON returned |
| 400 | Bad request | Check parameters |
| 401 | Unauthorized | Check API key |
| 429 | Rate limited | Wait or upgrade |
| 500 | Server error | Retry in a moment |
Error responses are always JSON:
{ "success": false, "error": "Rate limit exceeded. Upgrade your plan for higher limits." }