Skip to Content
GuidesOG images

OG images

GET /og/{publicId} returns a 1200×630 PNG suitable for <meta property="og:image">. Every option below is a query parameter.

Minimum request

https://api.ogstack.dev/og/{publicId}?url=https://example.com/post

The url parameter is required and must be URL-encoded. Its origin must match one of the project’s registered domains.

Query parameters

ParameterTypeValues
urlstringRequired. URL-encoded target page.
templatestringTemplate slug (see Templates). Default: editorial.
accenthex#RRGGBB. URL-encode as %23RRGGBB.
darkbooleantrue or false. Default: true.
fontenuminter, plus-jakarta-sans, space-grotesk, jetbrains-mono, noto-sans, instrument-serif.
logoUrlstringURL to a logo (PNG/SVG). URL-encoded.
logoPositionenumtop-left, top-right, bottom-left, bottom-right.
aibooleantrue to enable an AI-generated background with default model.
aiModelenumstandard or pro (High fidelity — Pro plan only).
aiPromptstringUp to 500 characters. Blended with page-derived context unless override is used in API calls.

Response

  • Content-Type: image/png
  • Binary PNG body
  • Cache-Control: public, max-age=31536000, immutable (content-addressed — cached indefinitely)

Framework integration

Pick your stack. Each example wires the OG meta tag (and twitter:card) into the page’s <head>. Replace cLx8kZ9m with your project’s public ID.

<meta property="og:image" content="https://api.ogstack.dev/og/cLx8kZ9m?url=https://example.com/post&template=aurora&accent=%2310b981" /> <meta property="og:image:width" content="1200" /> <meta property="og:image:height" content="630" /> <meta name="twitter:card" content="summary_large_image" />

Rate limits

Public endpoints are rate-limited per public ID using the project owner’s plan. Common social crawlers (Twitterbot, LinkedInBot, Slackbot, Discordbot, FacebookBot) bypass the limit so your previews still render during traffic spikes. See Rate limits.