# Social Card Generator — Tweet, Quote & Poster PNGs (`abidchaudhry/social-card-generator`) Actor

Turn text into polished 1080px social media card images: X/tweet-style cards, bold pull-quotes, statement posters, myth-vs-truth panels, numbered insights and carousel slides.

- **URL**: https://apify.com/abidchaudhry/social-card-generator.md
- **Developed by:** [Abid Chaudhry](https://apify.com/abidchaudhry) (community)
- **Categories:** AI, Automation, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.001 / actor start

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Social Card Generator — Tweet, Quote & Poster PNGs

Turn plain text into polished, share-ready social media images in seconds. No design tool, no templates to fight with — send text, get a crisp PNG back.

Perfect for content automation: wire it into Zapier, Make, n8n, or your own scripts and generate branded post images for **Instagram, LinkedIn, X/Twitter threads, newsletters, and blogs** on autopilot.

### Templates

| Template | Look | Size |
|----------|------|------|
| `tweet` | X/Twitter-style post card (light or dark mode, verified badge) | 1080px wide |
| `quote` | Bold pull-quote on a colored panel with attribution | 1080px wide |
| `poster` | Big-type serif statement poster | 1080×1350 |
| `mythtruth` | "The myth / The truth" two-panel contrast card | 1080×1350 |
| `numbered` | Numbered single-insight card (listicle style) | 1080×1350 |
| `slide` | Carousel slide (cover / body / CTA variants) | 1080×1350 |

All templates render at retina (2×) resolution by default and support your own name, handle, avatar image, and brand colors.

### Example input

```json
{
  "template": "quote",
  "text": "Most people don't need more information. They need the courage to act on what they already know.",
  "name": "Jane Doe",
  "handle": "@janedoe",
  "avatarUrl": "https://example.com/avatar.jpg",
  "bg": "#0f1419",
  "accent": "#1d9bf0"
}
````

#### Batch mode

Render a whole week of content (or a full carousel) in one run — pass a `cards` array. Top-level fields act as defaults for every card:

```json
{
  "name": "Jane Doe",
  "handle": "@janedoe",
  "accent": "#c2410c",
  "cards": [
    { "template": "slide", "variant": "cover", "kicker": "PRODUCTIVITY", "title": "5 habits that compound", "index": 1, "total": 7 },
    { "template": "slide", "title": "Ship before you're ready", "body": "Perfect is a form of procrastination.", "index": 2, "total": 7 },
    { "template": "slide", "variant": "cta", "title": "Save this for later", "index": 7, "total": 7 }
  ]
}
```

### Output

Each rendered card is:

- saved as a **PNG in the run's key-value store**, and
- pushed as a **dataset item** with a direct `imageUrl` you can use immediately in downstream automation (Instagram's publish API, LinkedIn, email tools, etc.):

```json
{
  "index": 0,
  "template": "quote",
  "imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/card-000.png",
  "key": "card-000.png",
  "width": 2160,
  "height": null,
  "text": "Most people don't need more information..."
}
```

### Why this instead of a design tool?

- **Built for automation** — call it from any HTTP client or scheduler; batch a month of content in one run.
- **Consistent branding** — colors, avatar, and attribution are parameters, so every post looks on-brand.
- **No watermarks, no per-seat pricing** — pay only for what you render.

### FAQ

**Can I use my own fonts/colors?** Colors yes (any hex). The templates use Inter, Lora, and Plus Jakarta Sans for a clean editorial look.

**Does it support dark mode?** Yes — `"dark": true` on the tweet template renders X "lights out" style.

**What about line breaks?** `\n` in `text`/`body` becomes a line break on the card.

**How fast is it?** A single card renders in ~2–4 seconds; batches reuse the browser so per-card time drops.

# Actor input Schema

## `template` (type: `string`):

Card layout to render.

## `text` (type: `string`):

Main text of the card. Used by the tweet, quote and poster templates. Supports line breaks.

## `name` (type: `string`):

Author name shown on the card.

## `handle` (type: `string`):

Author handle, with or without the leading @.

## `avatarUrl` (type: `string`):

Optional https:// or data: URL of the author avatar. If omitted, a colored circle with the author's initials is used.

## `dark` (type: `boolean`):

Render the tweet card in X 'lights out' dark mode.

## `verified` (type: `boolean`):

Show the blue verified badge next to the name on the tweet template.

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

Accent color (hex) used for quote marks, bars, numbers and labels.

## `bg` (type: `string`):

Card background color (hex). Used by quote, poster, mythtruth and numbered templates.

## `fg` (type: `string`):

Card text color (hex). Used by quote, poster, mythtruth and numbered templates.

## `kicker` (type: `string`):

Small uppercase label above the content (poster, mythtruth, numbered, slide).

## `title` (type: `string`):

Headline for the numbered insight and slide templates.

## `body` (type: `string`):

Supporting body text for the numbered insight and slide templates.

## `myth` (type: `string`):

The 'myth' text for the myth-vs-truth template.

## `truth` (type: `string`):

The 'truth' text for the myth-vs-truth template.

## `number` (type: `string`):

The big number shown on the numbered insight template.

## `variant` (type: `string`):

Slide role within a carousel.

## `retina` (type: `boolean`):

Render at 2x device scale for crisp images (2160px wide output). Disable for smaller files.

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

Render many cards in one run. Each item is an object with the same fields as above (template, text, name, handle, ...). When set, the single-card fields above are used as defaults for every card.

## Actor input object example

```json
{
  "template": "tweet",
  "text": "Most people don't need more information.\n\nThey need the courage to act on what they already know.",
  "name": "Your Name",
  "handle": "@yourhandle",
  "dark": false,
  "verified": true,
  "accent": "#1d9bf0",
  "bg": "#0f1419",
  "fg": "#ffffff",
  "variant": "body",
  "retina": true
}
```

# 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 = {
    "text": `Most people don't need more information.

They need the courage to act on what they already know.`
};

// Run the Actor and wait for it to finish
const run = await client.actor("abidchaudhry/social-card-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 = { "text": """Most people don't need more information.

They need the courage to act on what they already know.""" }

# Run the Actor and wait for it to finish
run = client.actor("abidchaudhry/social-card-generator").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "text": "Most people don'\''t need more information.\\n\\nThey need the courage to act on what they already know."
}' |
apify call abidchaudhry/social-card-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=abidchaudhry/social-card-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Social Card Generator — Tweet, Quote & Poster PNGs",
        "description": "Turn text into polished 1080px social media card images: X/tweet-style cards, bold pull-quotes, statement posters, myth-vs-truth panels, numbered insights and carousel slides.",
        "version": "0.1",
        "x-build-id": "HFsSMzECb9uRZT81M"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/abidchaudhry~social-card-generator/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-abidchaudhry-social-card-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/abidchaudhry~social-card-generator/runs": {
            "post": {
                "operationId": "runs-sync-abidchaudhry-social-card-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/abidchaudhry~social-card-generator/run-sync": {
            "post": {
                "operationId": "run-sync-abidchaudhry-social-card-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "template": {
                        "title": "Template",
                        "enum": [
                            "tweet",
                            "quote",
                            "poster",
                            "mythtruth",
                            "numbered",
                            "slide"
                        ],
                        "type": "string",
                        "description": "Card layout to render.",
                        "default": "tweet"
                    },
                    "text": {
                        "title": "Text",
                        "type": "string",
                        "description": "Main text of the card. Used by the tweet, quote and poster templates. Supports line breaks."
                    },
                    "name": {
                        "title": "Display name",
                        "type": "string",
                        "description": "Author name shown on the card.",
                        "default": "Your Name"
                    },
                    "handle": {
                        "title": "Handle",
                        "type": "string",
                        "description": "Author handle, with or without the leading @.",
                        "default": "@yourhandle"
                    },
                    "avatarUrl": {
                        "title": "Avatar image URL",
                        "type": "string",
                        "description": "Optional https:// or data: URL of the author avatar. If omitted, a colored circle with the author's initials is used."
                    },
                    "dark": {
                        "title": "Dark mode (tweet template)",
                        "type": "boolean",
                        "description": "Render the tweet card in X 'lights out' dark mode.",
                        "default": false
                    },
                    "verified": {
                        "title": "Verified badge (tweet template)",
                        "type": "boolean",
                        "description": "Show the blue verified badge next to the name on the tweet template.",
                        "default": true
                    },
                    "accent": {
                        "title": "Accent color",
                        "type": "string",
                        "description": "Accent color (hex) used for quote marks, bars, numbers and labels.",
                        "default": "#1d9bf0"
                    },
                    "bg": {
                        "title": "Background color",
                        "type": "string",
                        "description": "Card background color (hex). Used by quote, poster, mythtruth and numbered templates.",
                        "default": "#0f1419"
                    },
                    "fg": {
                        "title": "Text color",
                        "type": "string",
                        "description": "Card text color (hex). Used by quote, poster, mythtruth and numbered templates.",
                        "default": "#ffffff"
                    },
                    "kicker": {
                        "title": "Kicker (label above the content)",
                        "type": "string",
                        "description": "Small uppercase label above the content (poster, mythtruth, numbered, slide)."
                    },
                    "title": {
                        "title": "Title (numbered / slide templates)",
                        "type": "string",
                        "description": "Headline for the numbered insight and slide templates."
                    },
                    "body": {
                        "title": "Body (numbered / slide templates)",
                        "type": "string",
                        "description": "Supporting body text for the numbered insight and slide templates."
                    },
                    "myth": {
                        "title": "Myth (mythtruth template)",
                        "type": "string",
                        "description": "The 'myth' text for the myth-vs-truth template."
                    },
                    "truth": {
                        "title": "Truth (mythtruth template)",
                        "type": "string",
                        "description": "The 'truth' text for the myth-vs-truth template."
                    },
                    "number": {
                        "title": "Number (numbered template)",
                        "type": "string",
                        "description": "The big number shown on the numbered insight template."
                    },
                    "variant": {
                        "title": "Slide variant (slide template)",
                        "enum": [
                            "cover",
                            "body",
                            "cta"
                        ],
                        "type": "string",
                        "description": "Slide role within a carousel.",
                        "default": "body"
                    },
                    "retina": {
                        "title": "Retina (2x) resolution",
                        "type": "boolean",
                        "description": "Render at 2x device scale for crisp images (2160px wide output). Disable for smaller files.",
                        "default": true
                    },
                    "cards": {
                        "title": "Batch: cards array (advanced)",
                        "type": "array",
                        "description": "Render many cards in one run. Each item is an object with the same fields as above (template, text, name, handle, ...). When set, the single-card fields above are used as defaults for every card."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
