API Documentation

Everything you need to generate dynamic OG images programmatically.

On this page

📦
Postman CollectionDownload JSON and import into Postman to try every endpoint instantly.

Base URL

https://ogpeek.com

All API endpoints are under /api/v1/.

Authentication

The free tier (GET endpoint) requires no authentication. For the paid tier (POST endpoint), include your API key in the x-api-key header:

curl -H "x-api-key: ogp_your_key_here" ...

You can also pass it as a query parameter: ?api_key=ogp_your_key_here

Generate Image (Free Tier)

GET /api/v1/og No auth required

Generate a watermarked OG image via query parameters. Perfect for testing or low-volume usage.

curl "https://ogpeek.com/api/v1/og?title=Hello+World&template=gradient&theme=dark" \
  --output og.png

Or use directly in your HTML:

<meta property="og:image" content="https://ogpeek.com/api/v1/og?title=My+Post&theme=dark" />

Generate Image (Paid Tier)

POST /api/v1/og API key required

Generate a clean (no watermark) OG image with full parameter control.

curl -X POST "https://ogpeek.com/api/v1/og" \
  -H "x-api-key: ogp_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My Blog Post",
    "subtitle": "A deep dive into modern APIs",
    "template": "gradient",
    "theme": "dark",
    "brandColor": "#6366f1"
  }' \
  --output og.png

Get an API Key

POST /api/v1/keys No auth required

Create a free API key. You'll start on the free plan with 50 requests/day.

curl -X POST "https://ogpeek.com/api/v1/keys" \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'

Response:

{
  "apiKey": "ogp_abc123...",
  "plan": "free",
  "limit": "50 requests/day"
}

Check Usage

GET /api/v1/usage API key required
curl -H "x-api-key: ogp_your_key_here" "https://ogpeek.com/api/v1/usage"

Response:

{
  "plan": "starter",
  "requestsToday": 142,
  "requestsThisMonth": 3847
}

Parameters Reference

ParameterTypeDefaultDescription
titlestring"Hello World"Main heading text (required for useful output)
subtitlestring""Secondary text below the title
templatestring"basic"Layout template: basic, gradient, split, hero
themestring"dark"Color theme: dark, light, midnight, forest, sunset
brandColorstring"#6366f1"Hex color for accent elements
logostring""URL to a logo image (optional)

Templates & Themes

Templates

NameDescription
basicClean centered layout with title and subtitle
gradientBold gradient background with brand color accent
splitTwo-column layout with colored sidebar
heroLarge title with decorative background elements

Themes

NameDescription
darkDark background, light text (most popular)
lightWhite background, dark text
midnightDeep navy with blue accents
forestDark green tones
sunsetWarm gradient from orange to purple

Rate Limits

PlanPriceDailyMonthlyWatermark
Free$050500Yes
Starter$9/mo50010,000No
Pro$29/mo2,50050,000No

Rate limits reset daily at midnight UTC and monthly on the 1st. Additionally, all endpoints have a global rate limit of 60 requests/minute (10/min for free GET endpoint).

Error Codes

200Image generated successfully (returns PNG binary)
400Bad request — invalid parameters or missing required fields
401Unauthorized — missing or invalid API key
429Rate limit exceeded — upgrade your plan or wait
500Server error — try again or contact support

Error responses return JSON:

{
  "error": "Daily limit reached",
  "limit": 50,
  "plan": "free",
  "upgrade": "https://ogpeek.com/#pricing"
}