# OG Image Generator — 1200x630 social share cards in bulk (`keith-apis/og-image-generator`) Actor

Generate 1200×630 Open Graph (og:image) PNG share images in bulk from a list of titles. Three themes, optional badge and footer, public image URLs. No headless browser. Pay per image: $0.002.

- **URL**: https://apify.com/keith-apis/og-image-generator.md
- **Developed by:** [Lai Keith](https://apify.com/keith-apis) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 image rendereds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## OG Image Generator: 1200×630 Open Graph images in bulk

**OG Image Generator is an Apify Actor that turns a list of titles into 1200×630 PNG Open Graph (og:image) share images, one per title, each with a public URL.** It renders the images directly, with no headless browser, and you pay only for the images it makes ($0.002 each, or $2 per 1,000).

![Example OG image: dark theme card](https://og-image-api.fly.dev/example.png)

### What does OG Image Generator do?

You give it a JSON list of cards (a title, plus an optional subtitle, theme, badge and footer). It returns:

- one **1200×630 PNG** per card, stored in the run's key-value store, and
- a **dataset** row per card with its `key`, `title`, `theme` and public image `url`, ready to export as CSV, JSON or Excel.

1200×630 is the size X (Twitter), LinkedIn, Facebook, Slack and Discord use for link previews.

### When should I use it?

- **Backfill a whole blog:** make a share image for every existing post in one run.
- **E-commerce and directories:** a card per product, listing or profile.
- **Docs, changelogs and newsletters:** a consistent branded card for each page or issue.
- **Automations:** call it from Make, Zapier, n8n or the Apify API whenever new content is published.

If you need one image at a time on request (for example, an `og:image` URL that renders when a crawler asks), use the [OG Image API](https://og-image-api.fly.dev/) instead. It's the same renderer behind a single GET request.

### Input

```json
{
  "cards": [
    { "title": "How we cut build times by 60%", "subtitle": "A case study", "theme": "dark", "badge": "GUIDE", "footer": "example.com", "key": "build-times" },
    { "title": "Release notes: October", "theme": "light", "footer": "example.com" }
  ]
}
```

| Field | Required | Description |
|---|---|---|
| `title` | yes | Headline, up to 300 characters; wraps to 3 lines |
| `subtitle` | no | Second line, up to 300 characters; wraps to 2 lines |
| `theme` | no | `dark` (default), `light` or `mint` |
| `badge` | no | Small label above the title, e.g. NEW or GUIDE (24 characters) |
| `footer` | no | Bottom-left text, usually your domain (80 characters) |
| `key` | no | File name for the PNG; defaults to `card-1`, `card-2`, … |

You can send up to 500 cards per run.

### Output

```json
{ "key": "build-times", "title": "How we cut build times by 60%", "theme": "dark", "url": "https://api.apify.com/v2/key-value-stores/<store-id>/records/build-times" }
```

### How much does it cost?

It's **pay per result: $0.002 per image** ($2 per 1,000 images), plus a little Apify platform usage. Cards with an empty title are skipped and **not charged**. If you set a maximum spend on the run, it stops when that limit is reached.

### FAQ

**How do I generate Open Graph images for all my blog posts at once?**
Export your post titles (from your CMS, a sitemap or a CSV), paste them as `cards`, and run the Actor. Download the PNGs or use their URLs in each page's `og:image` tag.

**Can I make OG images without Puppeteer or headless Chrome?**
Yes. This Actor draws the text and theme straight onto the image, so there is no browser to install or run, and runs are fast and cheap.

**What's the difference from Bannerbear or Placid?**
Those are template editors that handle photos and complex layouts, with monthly plans. This Actor makes clean, text-based title cards and charges per image, which is cheaper for bulk backfills and occasional runs.

**Can I use my own fonts or logo?**
Not yet. There are three built-in themes, plus a badge and a footer for your brand or domain.

**Is my data stored?**
The images and dataset stay in your own Apify storage, under your account's retention settings. Nothing is sent to any other service.

### Related

- [OG Image API](https://og-image-api.fly.dev/): one image per GET request, for on-request `og:image` URLs.

# Actor input Schema

## `cards` (type: `array`):

One object per image: title (required), subtitle, theme (dark | light | mint), badge, footer, key (file name). Up to 500 per run; charged per image rendered.

## Actor input object example

```json
{
  "cards": [
    {
      "title": "Ship branded share cards in one request",
      "subtitle": "No headless Chrome",
      "theme": "dark",
      "badge": "New",
      "footer": "example.com"
    },
    {
      "title": "Light theme for blogs",
      "theme": "light",
      "footer": "example.com"
    }
  ]
}
```

# Actor output Schema

## `images` (type: `string`):

No description

## `files` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "cards": [
        {
            "title": "Ship branded share cards in one request",
            "subtitle": "No headless Chrome",
            "theme": "dark",
            "badge": "New",
            "footer": "example.com"
        },
        {
            "title": "Light theme for blogs",
            "theme": "light",
            "footer": "example.com"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("keith-apis/og-image-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "cards": [
        {
            "title": "Ship branded share cards in one request",
            "subtitle": "No headless Chrome",
            "theme": "dark",
            "badge": "New",
            "footer": "example.com",
        },
        {
            "title": "Light theme for blogs",
            "theme": "light",
            "footer": "example.com",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("keith-apis/og-image-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "cards": [
    {
      "title": "Ship branded share cards in one request",
      "subtitle": "No headless Chrome",
      "theme": "dark",
      "badge": "New",
      "footer": "example.com"
    },
    {
      "title": "Light theme for blogs",
      "theme": "light",
      "footer": "example.com"
    }
  ]
}' |
apify call keith-apis/og-image-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,keith-apis/og-image-generator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/wK5eBRhlP2K3mrhHR/builds/DTS7a5ph4zC7dnNft/openapi.json
