OG Image Generator avatar
OG Image Generator

Pricing

Pay per usage

Go to Store
OG Image Generator

OG Image Generator

Developed by

Daniil Poletaev

Maintained by Community

OG Image Generator is a tool that lets you dynamically create OG images from your HTML templates via an API. The tool is flexible, allowing you to use the default template or create fully custom templates.

5.0 (1)

Pricing

Pay per usage

2

Monthly users

5

Runs succeeded

>99%

Last modified

2 months ago

You can access the OG Image Generator programmatically from your own applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.

1echo '{
2  "html": "<!DOCTYPE html>\\n<html lang=\\"en\\">\\n<head>\\n  <meta charset=\\"UTF-8\\">\\n  <meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\">\\n  <script src=\\"https://cdn.tailwindcss.com\\"></script>\\n</head>\\n<body class=\\"bg-gray-100 text-gray-900 flex items-center justify-center h-screen\\">\\n\\n  <!-- OG Image Container -->\\n  <div class=\\"relative bg-white w-[1200px] h-[630px] rounded-lg shadow-xl border border-gray-200 overflow-hidden\\">\\n    \\n    <!-- Background Accent -->\\n    <div class=\\"absolute inset-0 bg-gradient-to-r from-indigo-100 via-pink-100 to-yellow-100 opacity-50\\"></div>\\n\\n    <!-- Logo -->\\n    <div class=\\"absolute bottom-6 left-6\\">\\n      <img src=\\"{{logoUrl}}\\" alt=\\"Blog Logo\\" class=\\"h-10\\">\\n    </div>\\n\\n    <!-- Content Wrapper -->\\n    <div class=\\"relative flex flex-col h-full p-16\\">\\n      \\n      <!-- Blog Category -->\\n      <div class=\\"text-base uppercase tracking-wider text-indigo-500 font-semibold mb-6\\">{{category}}</div>\\n      \\n      <!-- Blog Title -->\\n      <h1 class=\\"text-6xl font-bold leading-tight text-gray-800 mb-8\\">{{title}}</h1>\\n      \\n      <!-- Author and Date -->\\n      <div class=\\"flex items-center space-x-6 text-gray-600 text-xl\\">\\n        <div class=\\"flex items-center space-x-3\\">\\n          <img class=\\"w-12 h-12 rounded-full\\" src=\\"{{authorImage}}\\" alt=\\"{{author}}\\">\\n          <span>{{author}}</span>\\n        </div>\\n        <span>&bull;</span>\\n        <span>{{date}}</span>\\n      </div>\\n    </div>\\n  </div>\\n\\n</body>\\n</html>\\n",
3  "templateData": {
4    "category": "Technology",
5    "title": "How to create dynamic OG title for your web",
6    "logoUrl": "https://w7.pngwing.com/pngs/243/698/png-transparent-apify-logo-tech-companies.png",
7    "date": "January 3, 2025",
8    "author": "Daniil Poletaev",
9    "authorImage": "https://images.apifyusercontent.com/rO00zibE4A243KKKW3pwsdT-IXjgOFWuA2s4RJV_7VM/rs:fill:70:70/aHR0cHM6Ly9saDMuZ29vZ2xldXNlcmNvbnRlbnQuY29tL2EvQUNnOG9jSWRPZ1QxMHAxblVSbGhKZUswSlZUdXpLZzJmVWN6MkEtNGZka1hwVWRSX1NtOVFSZw"
10  }
11}' |
12apify call daniil.poletaev/og-image-generator --silent --output-dataset

OG Image Generator API through CLI

The Apify CLI is the official tool that allows you to use OG Image Generator locally, providing convenience functions and automatic retries on errors.

Install the Apify CLI

1npm i -g apify-cli
2apify login

Other API clients include:

Pricing

Pricing model

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage.