API Reference
Generate OG images by making a GET request with URL parameters.
Base URL
GET https://snapog.vercel.app/api/ogParameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| title | string | Yes | — | Main heading text |
| subtitle | string | No | — | Secondary text below the title |
| template | string | No | gradient | Template style: gradient, minimal, blog, product, dark |
| theme | string | No | dark | Color theme: dark or light (affects minimal template) |
| accent | hex string | No | 6366f1 | Accent color without #. Example: ec4899 for pink |
| fontSize | string | No | lg | Text size: sm (48px), md (56px), lg (64px), xl (80px) |
| logo | URL | No | — | URL 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.
minimal
Clean centered layout with thin accent lines top and bottom. Respects light/dark theme. Best for: documentation, corporate pages, portfolios.
blog
Article card with left accent border, category pill, and reading time indicator. Best for: blog posts, articles, tutorials.
product
Launch-style with centered glow effect, 'Now Available' badge, and bold typography. Best for: product launches, announcements, changelogs.
dark
Moody dark background with subtle accent glows and bottom-aligned text. Best for: developer tools, open source projects, technical content.
Examples
Basic
/api/og?title=Hello+WorldFull Parameters
/api/og?title=Ship+Faster&subtitle=Build+beautiful+products&template=product&accent=ec4899&fontSize=xl&theme=darkHTML 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)