# Branded Image Generator API — Social & Product Cards (`chirpy_polygon/branded-image-template-api`) Actor

Generate branded social cards, product offers and quote images from JSON. PNG or JPEG, social or square, text/logo/product-image fields. Three fixed templates, no AI API bill.

- **URL**: https://apify.com/chirpy_polygon/branded-image-template-api.md
- **Developed by:** [Bhojraj Pilaniya](https://apify.com/chirpy_polygon) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 template images

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

### What does this Actor do?

Generate repeatable Open Graph cards, catalog offers and quote graphics from your CMS, spreadsheet or n8n workflow. Text is escaped, optional images are loaded from public URLs, and long headings are clamped to keep a consistent layout.

### How to use it

1. Enter your input in the form or JSON editor.
2. Set **Maximum cost per run** in the run options.
3. Start the Actor, then open **Files and errors** in Output.
4. Download each file from its fileUrl. The dataset can also be exported as JSON, CSV or Excel.

#### Example input

```json
{
  "items": [
    {
      "template": "product-offer",
      "title": "Your product launch",
      "brand": "Example Store",
      "price": "₹999",
      "subtitle": "Simple branded cards from JSON.",
      "accentColor": "#0d9488"
    }
  ],
  "size": "social"
}
```

See the Input tab for all options and validation limits.

### Pricing

Pay per successful output, with no Actor subscription. **Platform usage is included in event pricing.** Current configured prices are shown in the Pricing tab.

| Event | Price |
|---|---|
| Template image | $0.80 / 1,000 successful files |
| Actor start | $0.0005 per GB of allocated memory, minimum one event |

The start fee applies even if every item fails. There is no result fee for an invalid URL, HTTP error, missing element, timeout or failed render. Budget-skipped items have no result fee. Start fewer runs with larger batches to reduce startup overhead. For example, 100 items cost 100 × the applicable result price plus one memory-based start fee. An item is one output on one device/size, not one input domain with unlimited variants.

This purchase provides hosted Actor usage. Source-code ownership, resale rights, custom development, permanent file hosting and a service-level agreement are not included. Apify handles accounts and billing; you do not register on a separate website. Generated files live in the run storage and follow your Apify plan's retention and access rules. Download files you need to keep.

### Output

| Field | Meaning |
|---|---|
| status | success or failed |
| id / index | Match output to input |
| fileUrl / fileKey | Download location |
| contentType / bytes / sha256 | File type, size and integrity |
| width / height | Image dimensions; null for PDF |
| finalUrl / httpStatus | Website result; null for HTML/template input |
| truncated | Full page was cropped at maxHeight |
| durationMs / error | Render timing or failure reason |

SUMMARY contains requested, successful, failed, skipped and budgetStopped counts. When the spending limit is reached, remaining inputs are counted as skipped in SUMMARY rather than generating a row for each one. Rendering is sequential to keep budget enforcement predictable. Completed-item progress is saved; restarting a completed run is not a new free entitlement or an exactly-once guarantee across abrupt platform failures.

### API and n8n

Use your own Apify token on the server or in an n8n credential. Never embed a private token in a public webpage. No upstream paid API key is required. The API tab supplies account-specific examples.

```javascript
import axios from 'axios';
const { data: run } = await axios.post(
  'https://api.apify.com/v2/acts/chirpy_polygon~branded-image-template-api/runs',
  {"items":[{"template":"product-offer","title":"Your product launch","brand":"Example Store","price":"₹999","subtitle":"Simple branded cards from JSON.","accentColor":"#0d9488"}],"size":"social"},
  { headers: { Authorization: 'Bearer ' + process.env.APIFY_TOKEN },
    params: { maxTotalChargeUsd: 1 } }
);
// Poll GET /v2/actor-runs/{run.data.id} until terminal status.
// Then GET /v2/datasets/{run.data.defaultDatasetId}/items.
```

In n8n, use an HTTP Request node with POST, the same URL, a saved bearer credential and JSON body. Poll the run or use an Apify webhook, then fetch the dataset. Starting a run does not mean its files are ready.

### Limits and troubleshooting

Three fixed templates: social-card, product-offer and quote-card. Social 1200 × 630 or square 1080 × 1080, PNG/JPEG. Up to 500 images/run. Long text is clamped and can be omitted beyond the available lines; preview representative content before bulk production. Logo/asset URLs must load successfully; otherwise the item fails without a result fee. This is deterministic template composition: no AI image generation, custom font upload, full design editor, WebP output or arbitrary HTML input.

Only public HTTP(S) resources on ports 80/443 are supported. Localhost, private/reserved addresses and private-network redirects/resources are blocked by a DNS-pinned outbound proxy. No login, user cookies, user-supplied request headers or CAPTCHA solving. Use only content you are authorized to process, and follow the target site's terms. Files may contain information from the submitted page; choose appropriate storage access and retention.

If a file link asks for authentication, use the same Apify account or authorized API token; do not append tokens to publicly shared links. For a problem, open an issue with a non-sensitive sample input and run ID. Do not post passwords, tokens or confidential documents.

# Actor input Schema

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

Up to 500 jobs. Required title; optional template, brand, subtitle, price, footer, accentColor, logoUrl and imageUrl.

## `size` (type: `string`):

Social is 1200 × 630 px; square is 1080 × 1080 px.

## `format` (type: `string`):

PNG for lossless output or JPEG for smaller files.

## `quality` (type: `integer`):

JPEG compression quality; ignored for PNG.

## `timeoutSecs` (type: `integer`):

Hard deadline in seconds, including page loading and output rendering.

## Actor input object example

```json
{
  "items": [
    {
      "template": "social-card",
      "title": "Build once. Publish everywhere.",
      "brand": "Your brand",
      "subtitle": "Automated visuals from your content workflow.",
      "accentColor": "#2563eb"
    }
  ],
  "size": "social",
  "format": "png",
  "quality": 85,
  "timeoutSecs": 30
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

## `storage` (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 = {
    "items": [
        {
            "template": "social-card",
            "title": "Build once. Publish everywhere.",
            "brand": "Your brand",
            "subtitle": "Automated visuals from your content workflow.",
            "accentColor": "#2563eb"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("chirpy_polygon/branded-image-template-api").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": [{
            "template": "social-card",
            "title": "Build once. Publish everywhere.",
            "brand": "Your brand",
            "subtitle": "Automated visuals from your content workflow.",
            "accentColor": "#2563eb",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("chirpy_polygon/branded-image-template-api").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": [
    {
      "template": "social-card",
      "title": "Build once. Publish everywhere.",
      "brand": "Your brand",
      "subtitle": "Automated visuals from your content workflow.",
      "accentColor": "#2563eb"
    }
  ]
}' |
apify call chirpy_polygon/branded-image-template-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,chirpy_polygon/branded-image-template-api"
        }
    }
}
```

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/SKwHSGFLIKrRsV955/builds/EksRJMtN8zGOoCJAm/openapi.json
