API Documentation

Everything you need to integrate SnapForge into your application.

Authentication

Authenticate by passing your API key as a Bearer token in the Authorization header, or as a key query parameter.

bash
# Via header (recommended)
curl https://api.snapforgehq.com/v1/og?template=blog-post&title=Hello \
  -H "Authorization: Bearer sf_live_your_key_here"

# Via query parameter (useful for meta tags)
<meta property="og:image"
  content="https://api.snapforgehq.com/v1/og?template=blog-post&title=Hello&key=sf_live_your_key_here" />

Endpoints

Base URL: https://api.snapforgehq.com

GET/v1/og

Generate an OG image via query parameters. Ideal for use directly in HTML meta tags.

Parameters

NameTypeRequiredDescription
templatestringYesTemplate ID: blog-post, social, or minimal
titlestringYesMain title text
subtitlestringNoSubtitle text (blog-post template)
authorstringNoAuthor name (blog-post template)
descriptionstringNoDescription text (social template)
brandstringNoBrand name (social template)
colorstringNoBackground color hex (minimal template)
text_colorstringNoText color hex (minimal template)
widthnumberNoImage width in pixels (default: 1200)
heightnumberNoImage height in pixels (default: 630)
formatstringNoOutput format: png (default), jpeg, webp
keystringYesYour API key (alternative to Authorization header)
POST/v1/og

Generate an OG image via JSON body.

Request Body

json
{
  "template": "blog-post",
  "params": {
    "title": "My Blog Post",
    "subtitle": "A deep dive into...",
    "author": "Jane Doe"
  },
  "width": 1200,
  "height": 630,
  "format": "png"
}
POST/v1/screenshot

Capture a screenshot of a URL or raw HTML. Requires Starter plan or higher.

Request Body

json
{
  "url": "https://example.com",
  "width": 1280,
  "height": 720,
  "full_page": false,
  "selector": "#main",
  "format": "png",
  "delay": 0
}
GET/v1/usage

Get your current usage stats for the billing period.

Response

json
{
  "used": 450,
  "limit": 5000,
  "month": "2026-03",
  "planId": "starter"
}
GET/v1/templates

List all available templates with their parameter definitions.

Code Examples

JavaScript (fetch)

javascript
const response = await fetch(
  "https://api.snapforgehq.com/v1/og",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer sf_live_your_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      template: "blog-post",
      params: {
        title: "My Blog Post",
        subtitle: "Written with love",
        author: "Jane Doe",
      },
    }),
  }
);

const imageBlob = await response.blob();
// Use the blob as needed (save, display, upload, etc.)

Python

python
import requests

response = requests.post(
    "https://api.snapforgehq.com/v1/og",
    headers={"Authorization": "Bearer sf_live_your_key_here"},
    json={
        "template": "blog-post",
        "params": {
            "title": "My Blog Post",
            "subtitle": "Written with love",
            "author": "Jane Doe",
        },
    },
)

with open("og-image.png", "wb") as f:
    f.write(response.content)

cURL

bash
curl -X POST "https://api.snapforgehq.com/v1/og" \
  -H "Authorization: Bearer sf_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"template":"blog-post","params":{"title":"Hello World"}}' \
  -o og-image.png

Error Codes

StatusErrorDescription
400bad_requestInvalid parameters. Check the error message for details.
401unauthorizedMissing or invalid API key.
429rate_limit_exceededMonthly generation limit reached. Upgrade your plan.
500generation_failedImage generation failed. Contact support if this persists.

Rate Limits

Rate limits are based on your plan's monthly generation quota. Cache hits do not count against your quota. Check the X-RateLimit-Remaining and X-RateLimit-Limit response headers.

PlanMonthly LimitOverage
Free100Hard cutoff
Starter5,000$0.005/image
Pro25,000$0.003/image
Business100,000$0.002/image