API Documentation

API Reference

Everything you need to integrate Banner.codes into your applications. Simple REST API with predictable endpoints.

Overview

Fast & Global

Sub-50ms response times with global edge caching.

Secure

API key authentication with usage tracking and rate limiting.

Simple REST API

Standard HTTP methods with JSON responses and PNG images.

Base URL

https://api.banner.codes

All API requests should be made to this base URL.

Authentication

API Key Authentication

Include your API key as a query parameter in all requests:

?key=YOUR_API_KEY_HERE

Security Best Practices

  • Never commit API keys to version control
  • Use environment variables for API keys
  • Regenerate API keys regularly
  • Monitor usage in your dashboard

Endpoints

GET/api/render

Generate a banner image

POST/api/render

Generate a banner image (alternative)

POST/api/key/create

Create a new API key

Parameters

ParameterRequiredTypeDescription
keyRequiredstringYour API key
titleRequiredstringMain title text
subtitleOptionalstringSubtitle text
themeOptionalstringTheme: dark | light
templateOptionalstringTemplate ID
widthOptionalnumberImage width (default: 1200)
heightOptionalnumberImage height (default: 630)

Response

Success Response

200 OK

Returns a PNG image with the following headers:

Content-Type: image/png
Content-Length: <file-size>
Cache-Control: public, max-age=3600

Error Response

400

Bad Request - Missing parameters

401

Unauthorized - Missing API key

403

Forbidden - Invalid API key

429

Too Many Requests - Rate limit exceeded

500

Internal Server Error

Examples

cURL

curl -X GET \
  "https://api.banner.codes/render?key=YOUR_API_KEY&title=Hello%20World&subtitle=Welcome%20to%20Banner.codes&theme=dark" \
  --output banner.png

JavaScript (Browser)

fetch(`https://api.banner.codes/render?key=${process.env.API_KEY}&title=Hello%20World&subtitle=Welcome&theme=dark`)
  .then(response => response.blob())
  .then(blob => {
    // Use the image blob
    const url = URL.createObjectURL(blob);
    const img = document.createElement('img');
    img.src = url;
    document.body.appendChild(img);
  })
  .catch(error => console.error('Error:', error));

Node.js

const fetch = require('node-fetch');
const fs = require('fs');

async function generateBanner() {
  const params = new URLSearchParams({
    key: process.env.API_KEY,
    title: 'Product Launch',
    subtitle: 'Version 2.0 Released',
    theme: 'dark'
  });

  const response = await fetch(`https://api.banner.codes/render?${params}`);
  const buffer = await response.buffer();
  
  // Save to file
  fs.writeFileSync('banner.png', buffer);
  console.log('Banner saved as banner.png');
}

generateBanner();

Use Cases

For Bloggers

Generate featured images, social shares, and thumbnails automatically.

Learn More
For SaaS

Create dynamic dashboard previews and user-generated content.

Learn More
For Startups

Launch materials, investor decks, and marketing banners.

Learn More

Quick Start Guide

1

Get Your API Key

Sign up and get your API key from the dashboard. Free tier includes 100 requests per day.

Get API Key
2

Test the API

Use the playground to test different parameters and see real-time results.

Open Playground
3

Integrate

Copy the example code and integrate into your application. Use environment variables for your API key.

View Examples