API Reference

Generate OG images by making a GET request with URL parameters.

Base URL

GET https://snapog.vercel.app/api/og

Parameters

ParameterTypeRequiredDefaultDescription
titlestringYesMain heading text
subtitlestringNoSecondary text below the title
templatestringNogradientTemplate style: gradient, minimal, blog, product, dark
themestringNodarkColor theme: dark or light (affects minimal template)
accenthex stringNo6366f1Accent color without #. Example: ec4899 for pink
fontSizestringNolgText size: sm (48px), md (56px), lg (64px), xl (80px)
logoURLNoURL to a logo image (coming soon)

Templates

gradient

Bold gradient background flowing from the accent color to darker shades. Radial light overlays for depth. Best for: hero pages, product pages, landing pages.

gradient template

minimal

Clean centered layout with thin accent lines top and bottom. Respects light/dark theme. Best for: documentation, corporate pages, portfolios.

minimal template

blog

Article card with left accent border, category pill, and reading time indicator. Best for: blog posts, articles, tutorials.

blog template

product

Launch-style with centered glow effect, 'Now Available' badge, and bold typography. Best for: product launches, announcements, changelogs.

product template

dark

Moody dark background with subtle accent glows and bottom-aligned text. Best for: developer tools, open source projects, technical content.

dark template

Examples

Basic

/api/og?title=Hello+World

Full Parameters

/api/og?title=Ship+Faster&subtitle=Build+beautiful+products&template=product&accent=ec4899&fontSize=xl&theme=dark

HTML Meta Tag

<meta property="og:image" 
  content="https://snapog.vercel.app/api/og?title=My+Page&template=gradient" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />

Response

Content-Type: image/png

Size: 1200 × 630 pixels

Caching: CDN-cached for 1 year (s-maxage=31536000), stale-while-revalidate for 24 hours

CORS: Allowed from any origin

Errors: Returns a styled error image (never a 500 page)