API Reference
SnapCard provides a simple REST API to capture screenshots, generate PDFs, and create dynamic OG social cards. All responses are binary (images/PDFs) or JSON.
https://api.snapcard.dev
Authentication
Pass your API key in the Authorization header or as X-Api-Key.
# Bearer token (recommended) curl -H "Authorization: Bearer sk_your_key" ... # Header alternative curl -H "X-Api-Key: sk_your_key" ...
/v1/auth/registerCreate account and get first API key
Creates a new account for the given email address and returns an API key. If the account already exists, a new key is issued.
Request body (JSON)
emailstringrequiredYour email addressResponse
{
"userId": "clx...",
"apiKey": "sk_...",
"plan": "FREE",
"message": "Account created — save your API key, it will not be shown again"
}/v1/screenshotrequires authCapture a webpage screenshot
Renders a URL in a headless browser and returns it as a PNG or JPEG image.
Query parameters
urlstringrequiredFully-qualified URL to captureformat"png" | "jpeg"optionalImage format (default: png)fullPagebooleanoptionalCapture full scrollable page (default: false)widthnumberoptionalViewport width in px (default: 1280)heightnumberoptionalViewport height in px (default: 720)qualitynumberoptionalJPEG quality 0–100 (jpeg only)Response
# Returns image/png or image/jpeg binary # Response headers: X-Usage: 42/1000
Example
curl "https://api.snapcard.dev/v1/screenshot?url=https://example.com&fullPage=true" \ -H "Authorization: Bearer sk_your_key" \ --output screenshot.png
/v1/pdfrequires authConvert a webpage to PDF
Renders a URL in a headless browser and returns a PDF document.
Query parameters
urlstringrequiredFully-qualified URL to convertpageFormat"A4" | "Letter" | "Legal"optionalPage format (default: A4)Response
# Returns application/pdf binary # Response headers: X-Usage: 5/1000
Example
curl "https://api.snapcard.dev/v1/pdf?url=https://example.com&pageFormat=Letter" \ -H "Authorization: Bearer sk_your_key" \ --output document.pdf
/v1/cardrequires authGenerate a dynamic OG social card
Renders a branded social card image at 1200×630px, suitable for Open Graph / Twitter Card metadata.
Query parameters
templatestringoptionalCard template name (default: "default")titlestringrequiredMain heading text (max 200 chars)descriptionstringoptionalSubheading text (max 300 chars)brandstringoptionalBrand label shown above title (max 100 chars)Response
# Returns image/png (1200×630) # Response headers: Cache-Control: public, max-age=3600 X-Usage: 12/1000
Example
curl "https://api.snapcard.dev/v1/card?title=Hello+World&description=My+subtitle&brand=SnapCard" \ -H "Authorization: Bearer sk_your_key" \ --output card.png
/v1/usagerequires authRetrieve monthly usage
Returns the current month's request counts per endpoint along with your plan limits.
Response
{
"usage": [
{ "endpoint": "screenshot", "month": "2026-03", "count": 42 },
{ "endpoint": "pdf", "month": "2026-03", "count": 5 },
{ "endpoint": "card", "month": "2026-03", "count": 12 }
],
"plan": "STARTER",
"limits": {
"FREE": 100,
"STARTER": 1000,
"GROWTH": 10000,
"SCALE": 100000
}
}Example
curl "https://api.snapcard.dev/v1/usage" \ -H "Authorization: Bearer sk_your_key"
/v1/keysrequires authList active API keys
Returns all active (non-revoked) API keys for the authenticated user's account.
Response
{
"keys": [
{
"id": "clx...",
"name": "Default",
"lastUsed": "2026-03-28T12:00:00.000Z",
"createdAt": "2026-03-01T00:00:00.000Z"
}
]
}/v1/keysrequires authCreate a new API key
Creates a new API key. Maximum 10 active keys per account. The full key is returned only once.
Request body (JSON)
namestringoptionalHuman-readable label (default: "My Key")Response
{
"id": "clx...",
"name": "Production",
"key": "sk_...",
"createdAt": "2026-03-29T00:00:00.000Z",
"message": "Save this key — it will not be shown again"
}/v1/keys/:idrequires authRevoke an API key
Permanently revokes an API key by ID. Revoked keys are rejected immediately.
Path parameters
idstringrequiredAPI key ID from /v1/keysResponse
{ "message": "API key revoked" }Error codes
All errors return JSON with error and code fields.
{ "error": "Monthly limit reached: 100/100 requests used", "code": "QUOTA_EXCEEDED" }UNAUTHORIZED401Missing or invalid API keyQUOTA_EXCEEDED429Monthly plan limit reachedVALIDATION_ERROR400Invalid query or body parametersNOT_FOUND404Requested resource does not existKEY_LIMIT_REACHED400Maximum of 10 active API keysBILLING_UNAVAILABLE503Stripe billing not yet configuredINVALID_SIGNATURE400Stripe webhook signature mismatch