API Documentation
One HTTP GET, 18 templates, PNG or SVG. Free, cached at the edge, no key required.
Overview
The ogimagex API renders social share images on the edge from a single GET request. Pick a template, pass parameters as query strings, and drop the resulting URL straight into your og:image meta tag.
Quick start
<meta property="og:image"
content="https://ogimagex.xyz/api/public/og/simple?title=Hello+World&accent=%237c3aed" />
<meta name="twitter:card" content="summary_large_image" />URL-encode # in hex colors as %23 and spaces as +. Anything else is standard query-string escaping.
Endpoint
https://ogimagex.xyz/api/public/og/{template}Replace {template} with any name from the templates table.
Common parameters
Every template accepts these three. Template-specific parameters are listed per template below.
| Parameter | Type | Default | Description |
|---|---|---|---|
| w | number | 1200 | Width in px (200–2400). |
| h | number | 630 | Height in px (200–2400). |
| format | string | png | `png` or `svg`. |
Templates & parameters
18 templates. Each entry lists its use-case tags and full parameter set. Only required parameters must be present — everything else has a sensible default.
simpleMinimal all-purpose cover — great as a default share image.
Also known as: default cover, landing page cover, launch announcement
| Parameter | Type | Default | Description |
|---|---|---|---|
| title* | string | — | Primary headline. |
| description | string | — | Supporting one-liner under the title. |
| brand | string | — | Brand/product name shown as small caps. |
| accent | color | #7c3aed | Hex accent color (URL-encode `#` as `%23`). |
| titleFontSize | number | 110 | Title font size in px. |
| descriptionFontSize | number | 52 | Description font size in px. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/simple?title=example&description=example&brand=exampleblogCategory, headline, excerpt, author — full editorial layout.
Also known as: blog cover, article header, medium-style cover
| Parameter | Type | Default | Description |
|---|---|---|---|
| category | string | — | Kicker/category label (e.g. `Engineering`). |
| title* | string | — | Article title. |
| excerpt | string | — | Dek/summary shown under the title. |
| author | string | — | Author name. |
| meta | string | — | Date · read-time string (e.g. `Jun 5 · 5 min read`). |
| avatar | url | — | Author avatar (inlined server-side). |
| accent | color | #0a0a0a | Accent color. |
| titleFontSize | number | 68 | Title font size. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/blog?category=example&title=example&excerpt=examplequotePull quote with attribution and optional avatar.
Also known as: pull quote, founder quote, testimonial card
| Parameter | Type | Default | Description |
|---|---|---|---|
| quote* | string | — | Quote body. |
| author | string | — | Person quoted. |
| handle | string | — | Twitter/X handle or title. |
| avatar | url | — | Author avatar. |
| accent | color | #f472b6 | Accent color. |
| quoteFontSize | number | 64 | Quote font size. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/quote?quote=example&author=example&handle=examplestatBig metric with label, trend, and caption.
Also known as: milestone card, kpi card, growth number
| Parameter | Type | Default | Description |
|---|---|---|---|
| value* | string | — | The big number (e.g. `12,480`). |
| label | string | — | Label above the value. |
| trend | string | — | Small trend line (e.g. `+18% this month`). |
| caption | string | — | Bottom caption. |
| brand | string | — | Brand line. |
| accent | color | #22d3ee | Accent color. |
| valueFontSize | number | 150 | Value font size. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/stat?value=example&label=example&trend=examplelogoMonogram + tagline on a solid background.
Also known as: logo card, brand identity, monogram cover
| Parameter | Type | Default | Description |
|---|---|---|---|
| brand* | string | — | Brand name. |
| monogram | string | — | Single-letter monogram. |
| tagline | string | — | Tagline under the brand name. |
| background | color | #0a0a0a | Card background color. |
| accent | color | #7c3aed | Accent color. |
| brandFontSize | number | 66 | Brand font size. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/logo?brand=example&monogram=example&tagline=exampletestimonialGrid of up to four short customer quotes with names and roles.
Also known as: testimonial grid, customer quotes, launch social proof
| Parameter | Type | Default | Description |
|---|---|---|---|
| heading | string | — | Heading above the grid. |
| quotes | list | — | Quotes list. Separate quotes with `|`, fields within a quote with `||` — `quote||author||role`. Max 4. |
| brand | string | — | Brand line. |
| accent | color | #10b981 | Accent color. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/testimonial?heading=example"es=example&brand=examplegridCentered headline over a grid backdrop — SaaS launch look.
Also known as: launch announcement, saas hero, product launch
| Parameter | Type | Default | Description |
|---|---|---|---|
| title* | string | — | Headline. |
| description | string | — | Sub-headline. |
| brand | string | — | Brand line. |
| accent | color | #22d3ee | Accent color. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/grid?title=example&description=example&brand=examplechangelogVersioned release notes with clean bullet items.
Also known as: release notes, version update, feature roundup
| Parameter | Type | Default | Description |
|---|---|---|---|
| version* | string | — | Version string (e.g. `v2.0`). |
| date | string | — | Release date. |
| title | string | — | Release headline. |
| items | list | — | Bullet items separated with `|` (max 4 shown). |
| brand | string | — | Brand line. |
| accent | color | #34d399 | Accent color. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/changelog?version=example&date=example&title=examplephotoFull-bleed photo with elegant overlay text.
Also known as: photo cover, travel post, photo essay
| Parameter | Type | Default | Description |
|---|---|---|---|
| image* | url | — | Full-bleed photo URL. |
| label | string | — | Kicker label. |
| title | string | — | Overlay title. |
| brand | string | — | Brand line. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/photo?image=example&label=example&title=exampleproductProduct card with price tag and image.
Also known as: product card, pricing announcement, ecommerce drop
| Parameter | Type | Default | Description |
|---|---|---|---|
| brand | string | — | Brand line. |
| title* | string | — | Product name. |
| description | string | — | Short description. |
| price | string | — | Price string (e.g. `$49`). |
| image | url | — | Product image URL. |
| accent | color | #7c3aed | Accent color. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/product?brand=example&title=example&description=exampleprofilePersonal card with avatar, role and short bio.
Also known as: author card, team member, speaker highlight
| Parameter | Type | Default | Description |
|---|---|---|---|
| name* | string | — | Person name. |
| role | string | — | Role/title. |
| bio | string | — | Short bio. |
| website | string | — | Website URL string. |
| avatar | url | — | Avatar image URL. |
| accent | color | #7c3aed | Accent color. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/profile?name=example&role=example&bio=exampleeventDate + location front and center for time-based posts.
Also known as: webinar cover, meetup card, conference announcement
| Parameter | Type | Default | Description |
|---|---|---|---|
| label | string | — | Kicker label (e.g. `Live Event`). |
| brand | string | — | Brand line. |
| title* | string | — | Event title. |
| date | string | — | Date string (free-form). |
| location | string | — | Location string. |
| accent | color | #f59e0b | Accent color. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/event?label=example&brand=example&title=exampleterminalCode/CLI-styled card in mono type.
Also known as: cli card, developer post, tutorial cover
| Parameter | Type | Default | Description |
|---|---|---|---|
| title* | string | — | Command or code line. |
| caption | string | — | Caption below the command. |
| brand | string | — | Brand line. |
| accent | color | #34d399 | Accent color. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/terminal?title=example&caption=example&brand=exampleeditorialMagazine-style layout with kicker and ghost type.
Also known as: magazine cover, essay header, long-form article
| Parameter | Type | Default | Description |
|---|---|---|---|
| kicker | string | — | Kicker label. |
| title* | string | — | Essay title. |
| author | string | — | Author name. |
| meta | string | — | Issue/date meta. |
| ghost | string | — | Large ghost word behind title. |
| accent | color | #e11d48 | Accent color. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/editorial?kicker=example&title=example&author=exampleshowcaseBold centered title with URL for portfolios and case studies.
Also known as: portfolio card, case study cover, agency work
| Parameter | Type | Default | Description |
|---|---|---|---|
| title* | string | — | Project title. |
| subtitle | string | — | Subtitle line. |
| url | string | — | Small URL shown at the bottom. |
| accent | color | #7c3aed | Accent color. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/showcase?title=example&subtitle=example&url=examplepodcastEpisode card with show, host, and duration.
Also known as: podcast cover, episode card, audio post
| Parameter | Type | Default | Description |
|---|---|---|---|
| show | string | — | Show name. |
| episode | string | — | Episode number (e.g. `Ep. 28`). |
| title* | string | — | Episode title. |
| host | string | — | Host name. |
| duration | string | — | Duration (e.g. `42 min`). |
| cover | url | — | Cover art image URL. |
| accent | color | #a855f7 | Accent color. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/podcast?show=example&episode=example&title=examplecourseCourse card with instructor, lesson count, duration and level.
Also known as: course promo, tutorial cover, lesson card
| Parameter | Type | Default | Description |
|---|---|---|---|
| category | string | — | Course category. |
| title* | string | — | Course title. |
| instructor | string | — | Instructor name. |
| lessons | string | — | Lesson count. |
| duration | string | — | Total duration. |
| level | string | — | Difficulty level. |
| accent | color | #0ea5e9 | Accent color. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/course?category=example&title=example&instructor=examplesaas-proGradient-mesh SaaS card with feature pills, headline metric and CTA.
Also known as: saas launch card, product announcement, funding announcement
| Parameter | Type | Default | Description |
|---|---|---|---|
| badge | string | — | Small badge above the title (e.g. `New in v3`). |
| brand | string | — | Brand name in the header. |
| title* | string | — | Headline. |
| subtitle | string | — | Supporting line. |
| features | list | — | Feature pills separated with `|` (max 3). |
| metric | string | — | Headline metric (e.g. `38ms`). |
| metricLabel | string | — | Label under the metric. |
| cta | string | — | Footer CTA / URL. |
| accent | color | #6366f1 | Primary accent color. |
| accent2 | color | #ec4899 | Secondary gradient color. |
| titleFontSize | number | 72 | Title font size. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/saas-pro?badge=example&brand=example&title=examplecourse-proCourse card with numbered curriculum rail, level meter and price.
Also known as: cohort course card, bootcamp promo, paid tutorial cover
| Parameter | Type | Default | Description |
|---|---|---|---|
| category | string | — | Course category badge. |
| title* | string | — | Course title. |
| subtitle | string | — | Course subtitle. |
| modules | list | — | Curriculum items separated with `|` (max 4). |
| instructor | string | — | Instructor name. |
| avatar | url | — | Instructor avatar URL. |
| lessons | string | — | Lesson count. |
| hours | string | — | Total duration. |
| level | string | — | Level — drives the level meter (beginner/intermediate/advanced). |
| price | string | — | Price shown in the CTA bar. |
| accent | color | #0ea5e9 | Accent color. |
| titleFontSize | number | 62 | Title font size. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/course-pro?category=example&title=example&subtitle=examplepodcast-proEpisode card with cover art, waveform, guest credit and platforms.
Also known as: interview episode card, audio show cover, guest episode promo
| Parameter | Type | Default | Description |
|---|---|---|---|
| show | string | — | Show name. |
| episode | string | — | Episode label (e.g. `Ep. 42`). |
| title* | string | — | Episode title. |
| guest | string | — | Guest name. |
| guestRole | string | — | Guest role/company. |
| duration | string | — | Episode duration. |
| platforms | string | — | Platform row text. |
| cover | url | — | Cover art image URL. |
| accent | color | #a855f7 | Accent color. |
| titleFontSize | number | 56 | Title font size. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/podcast-pro?show=example&episode=example&title=examplehiring-proJob post card with role, location, compensation and perk pills.
Also known as: job post card, we're hiring image, careers page cover
| Parameter | Type | Default | Description |
|---|---|---|---|
| label | string | — | Badge text (e.g. `We're hiring`). |
| company | string | — | Company name. |
| role* | string | — | Role title. |
| team | string | — | Team · employment type. |
| location | string | — | Location string. |
| salary | string | — | Compensation range. |
| perks | list | — | Perk pills separated with `|` (max 3). |
| cta | string | — | Footer CTA / URL. |
| accent | color | #f97316 | Accent color. |
| roleFontSize | number | 66 | Role font size. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/hiring-pro?label=example&company=example&role=examplechangelog-proRelease notes with typed new / fix / improve entries on a version rail.
Also known as: typed release notes, product update card, version rail changelog
| Parameter | Type | Default | Description |
|---|---|---|---|
| version* | string | — | Version string. |
| date | string | — | Release date. |
| title | string | — | Release headline. |
| items | list | — | Entries separated with `|`; each entry is `kind||text` where kind is `new`, `fix` or `improve`. Max 4. |
| brand | string | — | Brand line. |
| cta | string | — | Footer CTA / URL. |
| accent | color | #22c55e | Accent color. |
| titleFontSize | number | 54 | Title font size. |
| w | number | 1200 | Output width in pixels (200–2400). |
| h | number | 630 | Output height in pixels (200–2400). |
| format | string | png | Output format: `png` or `svg`. |
Example URL
https://ogimagex.xyz/api/public/og/changelog-pro?version=example&date=example&title=exampleSDK snippets
No SDK required — it's just a URL. Use any HTTP client.
curl
curl -o cover.png \
"https://ogimagex.xyz/api/public/og/blog?title=Rendering+OG+images+at+the+edge&author=Ada+Lovelace&accent=%237c3aed"Node.js
import { writeFile } from "node:fs/promises";
function ogUrl(template, params) {
const qs = new URLSearchParams(params).toString();
return `https://ogimagex.xyz/api/public/og/${template}?${qs}`;
}
const res = await fetch(ogUrl("blog", {
title: "Rendering OG images at the edge",
author: "Ada Lovelace",
accent: "#7c3aed",
}));
if (!res.ok) throw new Error(`ogimagex ${res.status}`);
await writeFile("cover.png", Buffer.from(await res.arrayBuffer()));Python
import urllib.parse, urllib.request
def og_url(template, **params):
qs = urllib.parse.urlencode(params)
return f"https://ogimagex.xyz/api/public/og/{template}?{qs}"
url = og_url("blog",
title="Rendering OG images at the edge",
author="Ada Lovelace",
accent="#7c3aed")
with urllib.request.urlopen(url) as res:
with open("cover.png", "wb") as f:
f.write(res.read())Next.js / React (meta tags)
export const metadata = {
openGraph: {
images: [`https://ogimagex.xyz/api/public/og/simple?title=${encodeURIComponent(title)}`],
},
twitter: { card: "summary_large_image" },
};Output formats
- PNG (default): rasterised server-side, best for Open Graph and Twitter cards.
- SVG: request with
?format=svgfor vector output — ideal for design tools or further processing.
Caching
Responses are cacheable at every layer. The cache key is the full URL including query string, so changing any parameter invalidates the cache for that variant.
Cache-Control: public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400
Access-Control-Allow-Origin: *Rate limits
Public endpoint is limited to 60 requests per minute per IP using a sliding window. Every response returns the current bucket state — no key or auth required.
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 42
X-RateLimit-Reset: 1735689600
Retry-After: 17 # only sent on 429Because responses cache for an hour, most integrations never come close to the ceiling — production CDN traffic hits your cache, not this endpoint. Need higher throughput? Get in touch.
Error codes
| Status | Meaning | How to fix |
|---|---|---|
| 200 | OK | Image body in the response. |
| 400 | Invalid parameter | Check `format`, `w`/`h` bounds, or overly long string (>1000 chars). |
| 404 | Unknown template | Template name in the URL isn't one of the 18 supported names. |
| 429 | Rate limited | Wait `Retry-After` seconds, or cache responses on your side. |
| 500 | Render failure | Usually a malformed remote image URL. Retry without `image`/`avatar`/`cover`. |
On PNG render failure the endpoint transparently falls back to SVG and sets X-OG-Format-Fallback: svg. Callers receive a 200 in that case — inspect the header if you need to detect it.
License & ownership
Images you generate with ogimagex are yours to use for personal or commercial projects with no attribution required — see the FAQ for the full statement.