# OG Image Generator — Social Cards 1200×630 (`hipersoft/og-image-generator`) Actor

Generate 1200×630 Open Graph / Twitter social share PNG images from a title, subtitle and theme, in bulk. Fast and lightweight — perfect for blogs, social previews and n8n/Make/Zapier automations.

- **URL**: https://apify.com/hipersoft/og-image-generator.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Categories:** Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.002 / image generated

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## OG Image Generator — Social Cards 1200×630

**Turn a title and a theme into a polished 1200×630 social share image — in bulk, in seconds.**

Generate Open Graph and Twitter/X card PNGs for every blog post, landing page or product without opening a design tool. No browser, low memory, no templates to wrangle — just pass text and get share-ready images back.

### What it does

- Renders clean **1200×630 PNG** cards (the standard Open Graph / Twitter card size).
- Large **auto-wrapping title**, optional **subtitle**, and a colored **accent** bar.
- Seven built-in **themes** with tasteful background gradients: dark, light, ocean, sunset, forest, grape, mono.
- Optional **logo** in the top-left corner.
- Processes an **array of items** in one run — one image per row, saved to the key-value store.

### Use cases

- **Blogs & CMS** — auto-generate a matching OG image for every article so links look great when shared.
- **Social preview cards** — consistent, on-brand link previews across X/Twitter, LinkedIn, Slack and Discord.
- **Landing pages & product launches** — spin up dozens of variants for A/B testing headlines.
- **Automation (n8n / Make / Zapier)** — wire it into a workflow to *auto-generate an OG image per post*: publish an article, trigger this Actor with the title, and drop the returned image URL straight into your `og:image` meta tag.

### Input

```json
{
  "items": [
    { "title": "Ship faster with automation", "subtitle": "The complete guide to no-code workflows", "theme": "ocean" },
    { "title": "10 tips for better OG images", "subtitle": "Boost your click-through rate", "theme": "sunset", "accent": "#f97316" }
  ]
}
```

A single object is also accepted, e.g. `{ "items": { "title": "Hello World" } }`.

| Field | Type | Description |
|---|---|---|
| `items` | array | Cards to render. Each item needs a `title`; the rest are optional. |
| `items[].title` | string | Main heading (wraps automatically, auto-sized). Required. |
| `items[].subtitle` | string | Optional secondary line under the title. |
| `items[].theme` | string | One of `dark`, `light`, `ocean`, `sunset`, `forest`, `grape`, `mono`. |
| `items[].accent` | string | Optional hex color for the accent bar (e.g. `#22d3ee`). |
| `items[].logoUrl` | string | Optional https URL of a small logo shown top-left. |
| `theme` | string | Default theme for items that don't set their own. |
| `accent` | string | Default accent color for items that don't set their own. |

### Output

Each generated image is saved as a PNG in the run's key-value store, and one row per item is pushed to the dataset:

```json
{
  "title": "Ship faster with automation",
  "theme": "ocean",
  "bytes": 154660,
  "width": 1200,
  "height": 630,
  "resultUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/og-0001.png",
  "ok": true
}
```

#### Output schema

| Field | Type | Description |
|---|---|---|
| `title` | string | The title rendered on the card. |
| `theme` | string | The theme used for this card. |
| `bytes` | integer | Size of the generated PNG in bytes. |
| `width` | integer | Image width (always 1200). |
| `height` | integer | Image height (always 630). |
| `resultUrl` | string | Direct URL to the PNG in the key-value store. |
| `ok` | boolean | Whether the image was generated successfully. |

### FAQ

**What size are the images?** Exactly 1200×630 pixels — the recommended size for Open Graph (`og:image`) and Twitter/X summary large image cards.

**Do I need to supply a font or a browser?** No. Everything is rendered server-side without a headless browser, so runs are fast and light on memory.

**Can I automate it?** Yes — connect it to your stack via [integrations on the Apify platform](https://apify.com/integrations) and the [Apify API](https://docs.apify.com/api/v2). A typical n8n / Make / Zapier flow triggers this Actor on publish and writes the returned `resultUrl` into your page's `og:image`.

**What happens if one item fails?** The run keeps going. That item gets a row with `ok: false` and an `error` message, so a single bad input never breaks the batch.

### Notes

Original clean-room implementation.

# Actor input Schema

## `items` (type: `array`):

Array of card objects to render. Each item: { "title": string (required), "subtitle": string (optional), "theme": string (optional: dark, light, ocean, sunset, forest, grape, mono), "accent": string (optional hex color for the accent bar/subtitle, e.g. "#22d3ee"), "logoUrl": string (optional https URL of a small logo shown top-left). A single object is also accepted.

## `theme` (type: `string`):

Fallback theme used for any item that does not set its own `theme`.

## `accent` (type: `string`):

Fallback accent color (hex, e.g. "#22d3ee") used for any item that does not set its own `accent`.

## Actor input object example

```json
{
  "items": [
    {
      "title": "Ship faster with automation",
      "subtitle": "The complete guide to no-code workflows",
      "theme": "ocean"
    },
    {
      "title": "10 tips for better OG images",
      "subtitle": "Boost your click-through rate",
      "theme": "sunset"
    }
  ],
  "theme": "dark",
  "accent": "#38bdf8"
}
```

# Actor output Schema

## `results` (type: `string`):

The results as dataset items.

# 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 = {
    "items": [
        {
            "title": "Ship faster with automation",
            "subtitle": "The complete guide to no-code workflows",
            "theme": "ocean"
        },
        {
            "title": "10 tips for better OG images",
            "subtitle": "Boost your click-through rate",
            "theme": "sunset"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/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 = { "items": [
        {
            "title": "Ship faster with automation",
            "subtitle": "The complete guide to no-code workflows",
            "theme": "ocean",
        },
        {
            "title": "10 tips for better OG images",
            "subtitle": "Boost your click-through rate",
            "theme": "sunset",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/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 '{
  "items": [
    {
      "title": "Ship faster with automation",
      "subtitle": "The complete guide to no-code workflows",
      "theme": "ocean"
    },
    {
      "title": "10 tips for better OG images",
      "subtitle": "Boost your click-through rate",
      "theme": "sunset"
    }
  ]
}' |
apify call hipersoft/og-image-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hipersoft/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/pFsIZ92aWEZ19zUjd/builds/sp5CV9Qo5MFxtIEvg/openapi.json
