OG Images for Your Express.js App

Add dynamic social card images to your Express routes with a single URL construction.

Start Integrating

Native URL API

Use Node.js's built-in URL class. No external libraries required.

Template Agnostic

Works with EJS, Pug, Handlebars, or any other template engine.

Middleware Ready

Share your OG URL generation logic across routes using middleware.

Example Integration

// routes/blog.js
const express = require('express');
const router = express.Router();

router.get('/blog/:slug', async (req, res) => {
  const post = await Post.findOne({ slug: req.params.slug });
  if (!post) return res.status(404).send('Not found');

  const ogUrl = new URL('https://imagoapi.com/api/og/generate');
  ogUrl.searchParams.set('title',    post.title);
  ogUrl.searchParams.set('template', 'modern');
  ogUrl.searchParams.set('api_key',  process.env.IMAGO_API_KEY);

  res.render('post', { post, ogUrl: ogUrl.toString() });
});
// In EJS: <meta property="og:image" content="<%= ogUrl %>">

Generate OG Images in Seconds

Start using Imago API today and add beautiful social cards to your Express app.

Try Imago API Free