SnapCap Docs

Authentication

All /v1/* endpoints require an API key passed in the X-API-Key header.

X-API-Key: sk_live_your_api_key_here

Get your API key by signing up at the pricing page.

GET /v1/screenshot

Capture a screenshot of any URL.

ParamTypeRequiredDefaultDescription
urlstringyes-URL to capture (http/https)
formatstringnopngpng, jpeg, or pdf
widthnumberno1280Viewport width (1-3840)
heightnumberno720Viewport height (1-2160)

Examples

cURL
JavaScript
Python
curl -H "X-API-Key: sk_live_..." \
  "https://snapcap.dev/v1/screenshot?url=https://example.com&format=png" \
  --output screenshot.png
const res = await fetch(
  "https://snapcap.dev/v1/screenshot?url=https://example.com",
  { headers: { "X-API-Key": "sk_live_..." } }
);
const blob = await res.blob();
// Use the PNG blob
import requests

res = requests.get(
    "https://snapcap.dev/v1/screenshot",
    params={"url": "https://example.com", "format": "png"},
    headers={"X-API-Key": "sk_live_..."}
)
with open("screenshot.png", "wb") as f:
    f.write(res.content)

POST /v1/og

Generate a dynamic OG image from a template.

Request Body (JSON)

FieldTypeRequiredDescription
templatestringyesTemplate name
dataobjectyesTemplate fields

Query Params

ParamTypeDefaultDescription
formatstringpngpng or jpeg
widthnumber1200Image width (1-3840)
heightnumber630Image height (1-2160)

Examples

cURL
JavaScript
Python
curl -X POST "https://snapcap.dev/v1/og" \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"template":"blog-post","data":{"title":"Hello World","author":"Jane"}}' \
  --output og.png
const res = await fetch("https://snapcap.dev/v1/og", {
  method: "POST",
  headers: {
    "X-API-Key": "sk_live_...",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    template: "blog-post",
    data: { title: "Hello World", author: "Jane" }
  })
});
const blob = await res.blob();
import requests

res = requests.post(
    "https://snapcap.dev/v1/og",
    headers={"X-API-Key": "sk_live_...", "Content-Type": "application/json"},
    json={"template": "blog-post", "data": {"title": "Hello World", "author": "Jane"}}
)
with open("og.png", "wb") as f:
    f.write(res.content)

Available Templates

blog-post

Required: title, author

Optional: date, readingTime, logo

product

Required: name, price

Optional: imageUrl, rating

social-profile

Required: name

Optional: bio, avatarUrl, followers, following

event

Required: title, date

Optional: location, speaker

generic

Required: title

Optional: subtitle, bgColor, bgImage, logo

GET /v1/og/templates

Returns a JSON list of available templates with their field schemas.

GET /v1/usage

Returns recent API usage entries.

ParamTypeDefaultDescription
limitnumber100Max entries to return

Billing

EndpointMethodDescription
/billing/checkoutPOSTCreate Stripe checkout session
/billing/webhookPOSTStripe webhook handler
/billing/portalGETRedirect to Stripe billing portal
/billing/statusGETCurrent plan + usage (requires API key)

Error Responses

All errors return JSON:

{ "error": "Description of what went wrong" }
StatusMeaning
400Invalid parameters or missing required fields
401Missing or invalid API key
429Rate limit or monthly render limit exceeded
500Internal server error

Rate Limits

PlanRequests/minRenders/month
Free10100
Starter ($9/mo)605,000
Pro ($29/mo)12050,000
Business ($79/mo)300200,000