API Documentation

SnapAPI is a developer media toolkit — screenshots, PDFs, OG images, QR codes, and URL metadata in one API.

Base URL: https://snap-apii.com
All 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.

TierDailyMonthlyPrice
Free1003,000$0
Starter50015,000$19/mo
Pro2,50075,000$49/mo
Business10,000300,000$99/mo
Scale50,0001,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

ParameterTypeDefaultDescription
urlstringrequiredURL to capture (must include https://)
widthint1280Viewport width (320-3840)
heightint800Viewport height (240-2160)
formatstringpngpng, jpeg, or webp
qualityint801-100 (jpeg/webp only)
full_pageboolfalseCapture full scrollable page
delayint0Wait ms after load (max 10000)
selectorstringCSS selector for element capture
dark_modeboolfalseEmulate 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

ParameterTypeDefaultDescription
urlstringURL to convert (url OR html required)
htmlstringRaw HTML to convert (POST only)
formatstringA4A4, Letter, A3, Legal
landscapeboolfalseLandscape orientation
marginstring20mmPage margin (CSS units)
print_backgroundbooltrueInclude background colors/images
scalefloat1Scale 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 }
}
ParameterTypeDescription
urlstringURL 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" />
ParameterTypeDefaultDescription
titlestringrequiredMain title text
subtitlestringSubtitle / description
domainstringDomain badge in bottom-left
themestringdarkdark, light, blue, green, purple, orange, gradient
widthint1200Image width
heightint630Image height
font_sizeintautoOverride 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" />
ParameterTypeDefaultDescription
datastringrequiredText or URL to encode (max 4296 chars)
sizeint256Image size in pixels
fg_colorstring#000000Foreground color (hex)
bg_colorstring#ffffffBackground color (hex)
ecstringMError correction: L, M, Q, H
marginint4Quiet 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.

Error Codes

StatusMeaningWhat to do
200SuccessImage/PDF/JSON returned
400Bad requestCheck parameters
401UnauthorizedCheck API key
429Rate limitedWait or upgrade
500Server errorRetry in a moment

Error responses are always JSON:

{ "success": false, "error": "Rate limit exceeded. Upgrade your plan for higher limits." }