API DOCUMENTATION

Banner Rendering API

Generate dynamic banner images using a simple HTTP API designed for SaaS platforms, automation workflows, ecommerce systems, and developer tooling.

Quick Start

Send a POST request with your banner payload and receive a generated PNG image response.

cURL Example
curl -X POST https://api.banner.codes/api/render \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
  "title": "Summer Sale",
  "subtitle": "Up to 50% OFF",
  "theme": "dark",
  "template": "promo"
}' --output banner.png

Authentication

Authenticate requests using thex-api-keyrequest header.

API Key Header
Required for all requests
x-api-key: YOUR_API_KEY

Render Endpoint

POST
/api/render

Generates a banner image using the provided request payload and rendering template.

Request Body

FieldTypeRequiredDescription
titlestringRequiredPrimary banner title
subtitlestringOptionalSecondary text content
themestringOptionalTheme variant (dark or light)
templatestringOptionalTemplate identifier
Example JSON Payload
{
  "title": "Summer Sale",
  "subtitle": "Up to 50% OFF",
  "theme": "dark",
  "template": "promo"
}

Response

Success Response
HTTP/1.1 200 OK
Content-Type: image/png
Rendering Notes
  • • Requests may be cached automatically
  • • Render duration depends on template complexity
  • • Unsupported assets may fallback automatically

Error Codes

400Invalid request payload
401Missing or invalid API key
429Rate limit exceeded
500Rendering service unavailable

Code Examples

JavaScript Fetch
const response = await fetch(
  "https://api.banner.codes/api/render",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": process.env.BANNER_API_KEY!
    },
    body: JSON.stringify({
      title: "Summer Sale",
      subtitle: "Up to 50% OFF",
      theme: "dark",
      template: "promo"
    })
  }
)

const imageBlob = await response.blob()
Node.js
import fs from "node:fs/promises"

const response = await fetch(
  "https://api.banner.codes/api/render",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": process.env.BANNER_API_KEY!
    },
    body: JSON.stringify({
      title: "Version 2.1 Released",
      subtitle: "Rendering Infrastructure",
      theme: "dark"
    })
  }
)

const arrayBuffer = await response.arrayBuffer()

await fs.writeFile(
  "banner.png",
  Buffer.from(arrayBuffer)
)

Production Ready

Banner.codes is designed for API integrations, automation systems, and scalable rendering workflows. Additional infrastructure capabilities may evolve over time as the platform matures.