API Reference
Everything you need to integrate Banner.codes into your applications. Simple REST API with predictable endpoints.
Overview
Sub-50ms response times with global edge caching.
API key authentication with usage tracking and rate limiting.
Standard HTTP methods with JSON responses and PNG images.
Base URL
https://api.banner.codesAll 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_HERESecurity 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
/api/renderGenerate a banner image
/api/renderGenerate a banner image (alternative)
/api/key/createCreate a new API key
Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
key | Required | string | Your API key |
title | Required | string | Main title text |
subtitle | Optional | string | Subtitle text |
theme | Optional | string | Theme: dark | light |
template | Optional | string | Template ID |
width | Optional | number | Image width (default: 1200) |
height | Optional | number | Image height (default: 630) |
Response
Success Response
Returns a PNG image with the following headers:
Content-Type: image/png Content-Length: <file-size> Cache-Control: public, max-age=3600
Error Response
400Bad Request - Missing parameters
401Unauthorized - Missing API key
403Forbidden - Invalid API key
429Too Many Requests - Rate limit exceeded
500Internal 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
Generate featured images, social shares, and thumbnails automatically.
Learn MoreCreate dynamic dashboard previews and user-generated content.
Learn MoreLaunch materials, investor decks, and marketing banners.
Learn MoreQuick Start Guide
Get Your API Key
Sign up and get your API key from the dashboard. Free tier includes 100 requests per day.
Get API KeyTest the API
Use the playground to test different parameters and see real-time results.
Open PlaygroundIntegrate
Copy the example code and integrate into your application. Use environment variables for your API key.
View Examples