Quickstart

Build a URL, get a PNG. That's the entire API.

https://api.opengraphapi.com/v1/card?template=blog-og&title=Hello+World&subtitle=My+first+card&bg=sunset

Open it in a browser — that's your image. Use it anywhere an image URL works:

<meta property="og:image" content="https://api.opengraphapi.com/v1/card?template=blog-og&title=${encodeURIComponent(post.title)}">

Parameters

ParameterDescriptionExample
templateOne of the 15 templates (see below). Default blog-og.template=certificate
titleMain text (required for most templates)title=Jane+Doe
subtitleSecondary line (meaning varies per template)subtitle=SEO+Masterclass
metaTertiary field: date / episode / handle / starsmeta=Sep+2026
brandBrand or issuer name shown in the headerbrand=Acme
price / badgeUsed by product / announcementprice=$49
bgTheme: midnight, sunset, forest, royal, slate, ocean, mono, rose, amber, paperbg=royal
api_keyRemoves watermark, raises quotaapi_key=og_xxx

Templates

Machine-readable list: GET /v1/templates

TemplateBest for
blog-ogArticle / blog share cards
quoteSocial quotes, testimonials
announcementProduct launches, release notes
productE-commerce listings with price tag
certificateCourse completion, awards (per-user URLs)
eventMeetups, webinars, conferences
podcastEpisode art with guest + episode no.
statBig-number marketing stats
changelogVersion releases
youtubeVideo thumbnails / tutorials
tweetTweet-style quote cards
articleMinimal editorial (light theme)
newsletterIssue covers
jobHiring cards
githubRepo share cards

API keys & limits

Without a key you get 50 images/day per IP with a small watermark. Paid plans remove the watermark and raise limits (Starter 500/day · Growth 3,000/day). Need a key? Email hello@opengraphapi.com with your use case — self-serve checkout is coming with our payment integration.

Responses include an x-ratelimit-remaining header. When the daily quota is exhausted the API returns HTTP 429 until the next UTC day.

Recipes

# cURL — save a certificate
curl -o cert.png "https://api.opengraphapi.com/v1/card?template=certificate&title=Jane+Doe&subtitle=SEO+Course&api_key=YOUR_KEY"

# JavaScript — dynamic OG image in Next.js / Astro
export function ogImageUrl(title: string) {
  const u = new URL("https://api.opengraphapi.com/v1/card");
  u.searchParams.set("template", "blog-og");
  u.searchParams.set("title", title);
  u.searchParams.set("api_key", process.env.OG_API_KEY!);
  return u.toString();
}

# Python — batch product images
import requests, urllib.parse
for name, price in products:
    url = "https://api.opengraphapi.com/v1/card?" + urllib.parse.urlencode(
        {"template": "product", "title": name, "price": price, "api_key": KEY})
    open(f"{name}.png", "wb").write(requests.get(url).content)