I Built a Free OG Image API - Here's How It Works

Published: (February 6, 2026 at 11:20 AM EST)
1 min read
Source: Dev.to

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

  • gradient
  • dark
  • sunset
  • ocean
  • forest
  • midnight
  • minimal
  • fire

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! 🚀

Back to Blog

Related posts

Read more »

REST API (Work In Progress)

markdown !Prasun Chakrabortyhttps://media2.dev.to/dynamic/image/width=50,height=50,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws....