I Built a Free OG Image API - Here's How It Works
Source: Dev.to
The Problem: Manual OG Images Are a Pain
You’ve probably been there. You just finished writing an amazing blog post, you’re ready to share it on Twitter, and then… the preview looks like garbage. No image. Or worse—a stretched, pixelated mess.
So what do you do? Fire up Figma. Spend 15 minutes tweaking. Export. Upload. Repeat for every. single. post.
I got tired of this workflow.
Solution: ogimage.art – a Free OG Image API
I built ogimage.art – a free API that generates beautiful OG images on‑the‑fly. The image is the URL:
https://ogimage.art/api/og?title=Your%20Title&template=gradient
Paste this URL into your og:image meta tag, and social platforms fetch a freshly generated image every time.
Available Templates
gradientdarksunsetoceanforestmidnightminimalfire
Usage Examples
Next.js
export async function generateMetadata({ params }) {
const post = await getPost(params.slug);
return {
openGraph: {
images: [
`https://ogimage.art/api/og?title=${encodeURIComponent(post.title)}`
],
},
};
}
Jekyll
(Add your Jekyll integration code here.)
Pricing
- Free: Unlimited images with a small watermark
- Pro ($9/mo): No watermark + API access
🌐 ogimage.art – Live demo & docs
Got questions? Drop a comment below!
Happy shipping! 🚀