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)}">
| Parameter | Description | Example |
|---|---|---|
template | One of the 15 templates (see below). Default blog-og. | template=certificate |
title | Main text (required for most templates) | title=Jane+Doe |
subtitle | Secondary line (meaning varies per template) | subtitle=SEO+Masterclass |
meta | Tertiary field: date / episode / handle / stars | meta=Sep+2026 |
brand | Brand or issuer name shown in the header | brand=Acme |
price / badge | Used by product / announcement | price=$49 |
bg | Theme: midnight, sunset, forest, royal, slate, ocean, mono, rose, amber, paper | bg=royal |
api_key | Removes watermark, raises quota | api_key=og_xxx |
Machine-readable list: GET /v1/templates
| Template | Best for |
|---|---|
blog-og | Article / blog share cards |
quote | Social quotes, testimonials |
announcement | Product launches, release notes |
product | E-commerce listings with price tag |
certificate | Course completion, awards (per-user URLs) |
event | Meetups, webinars, conferences |
podcast | Episode art with guest + episode no. |
stat | Big-number marketing stats |
changelog | Version releases |
youtube | Video thumbnails / tutorials |
tweet | Tweet-style quote cards |
article | Minimal editorial (light theme) |
newsletter | Issue covers |
job | Hiring cards |
github | Repo share cards |
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.
# 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)