
How to generate dynamic Open Graph images with an API (no Puppeteer, no Vercel Edge)
How to Generate Dynamic Open Graph Images with an API Every link you share on Twitter, Slack, or LinkedIn pulls an OG image. If that image is a static fallback — or worse, missing — you're leaving clicks on the table. Dynamic OG images (unique per page, showing the actual title/author/stats) consistently outperform generic logos. The problem is generating them at scale without spinning up a Puppeteer instance or a Vercel Edge Function. Here's the straightforward approach: an API call that returns a PNG. The API call const response = await fetch ( ' https://api.pagebolt.dev/v1/og-image ' , { method : ' POST ' , headers : { ' x-api-key ' : ' YOUR_API_KEY ' , ' Content-Type ' : ' application/json ' }, body : JSON . stringify ({ title : ' How to deploy a Node.js app to Fly.io in 5 minutes ' , subtitle : ' Marcus Chen · 8 min read ' , template : ' gradient ' , accentColor : ' #6366f1 ' }) }); // Returns a PNG — save it or stream it directly const buffer = Buffer . from ( await response . ar
Continue reading on Dev.to Webdev
Opens in a new tab



