OG IMAGE API
Generate branded 1200×630 social preview cards on demand — from structured data, not templates you have to design. One endpoint, and every blog post, product page and profile gets a card.
POST https://api.ottersnap.com/v1/og
Every card comes out exactly 1200×630 — the size Facebook, X, LinkedIn and Slack all expect.
Send a title, subtitle and site name. No Figma, no template engine, no font licensing on your side.
Emerald, dark, light and paper themes match your brand without a single line of CSS.
Render a unique card per blog post, product or user profile on the fly — it's one HTTP call each.
Cards render in seconds, so you can generate them during build or on first request.
PNG served with the right headers means link previews stop failing on platforms that cache aggressively.
JSON in, rendered file out. Works with anything that can make an HTTP request.
curl -X POST https://api.ottersnap.com/v1/og \
-H "Authorization: Bearer otter_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Shipping v2.0", "subtitle": "Everything new this quarter", "theme": "emerald"}' \
--output og.pngconst res = await fetch("https://api.ottersnap.com/v1/og", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OTTERSNAP_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
title: `Blog: ${post.title}`,
subtitle: post.excerpt,
siteName: "yourblog.com",
}),
});
fs.writeFileSync("og.png", Buffer.from(await res.arrayBuffer()));import os, requests
res = requests.post(
"https://api.ottersnap.com/v1/og",
headers={"Authorization": f"Bearer {os.environ['OTTERSNAP_KEY']}"},
json={"title": "Shipping v2.0", "subtitle": "Everything new this quarter"},
)
open("og.png", "wb").write(res.content)| Name | Type | Description |
|---|---|---|
| title | string · required | Main headline. Longer titles wrap automatically. |
| subtitle | string · optional | Supporting line under the headline. |
| siteName | string · default ottersnap.com | Footer label on the card — usually your domain. |
| theme | string · default emerald | Visual theme: emerald, dark, light or paper. |
Custom template uploads are on the roadmap. Today the four built-in themes cover most brands — pick the closest and your title and colors do the branding.
Both work. Build-time generation keeps deploys self-contained; on-request generation suits user-generated pages where the set of titles is unbounded.
Those platforms cache aggressively. After changing an image, run the URL through the Facebook Debugger or a cache-busting query string once, and the new card picks up.