Appearance
Title + Subtitle Template
The default, versatile template for general-purpose OG images.
Template ID
template: "default"Preview
A clean, professional layout with:
- Large, bold title
- Supporting subtitle text
- Gradient background with subtle pattern
- Accent bar decoration
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Main headline (max 200 chars) |
subtitle | string | No | Secondary text (max 300 chars) |
theme | string | No | dark (default) or light |
logo_url | string | No | Brand logo URL |
Example Request
bash
curl -X POST https://ogimageapi.io/api/generate \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"title": "Getting Started with TypeScript",
"subtitle": "A practical guide for JavaScript developers",
"template": "default",
"theme": "dark"
}' \
--output og-image.pngTheme Variations
Dark Theme
json
{
"title": "Your Title",
"subtitle": "Your subtitle",
"template": "default",
"theme": "dark"
}Features:
- Deep purple/indigo gradient background
- White text for maximum contrast
- Subtle dot pattern overlay
- Left accent bar in brand color
Light Theme
json
{
"title": "Your Title",
"subtitle": "Your subtitle",
"template": "default",
"theme": "light"
}Features:
- Soft gray/white gradient background
- Dark text for readability
- Clean, minimal aesthetic
- Left accent bar in brand color
Use Cases
| Use Case | Why This Template |
|---|---|
| Blog posts | Clean, readable, professional |
| Documentation | Neutral design, no distractions |
| Landing pages | Versatile, works with any brand |
| News articles | Clear hierarchy, easy to scan |
| Tutorials | Focus on the content title |
Best Practices
- Keep titles concise — Aim for 5-10 words
- Use subtitles for context — Add the "why" or "what"
- Dark theme for tech — Looks great in dev-focused feeds
- Light theme for lifestyle — Better for general audiences
Node.js Example
javascript
const response = await fetch('https://ogimageapi.io/api/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.OG_IMAGE_API_KEY
},
body: JSON.stringify({
title: 'Getting Started with TypeScript',
subtitle: 'A practical guide for JavaScript developers',
template: 'default',
theme: 'dark'
})
});
const imageBuffer = await response.arrayBuffer();Python Example
python
import requests
response = requests.post(
'https://ogimageapi.io/api/generate',
headers={
'Content-Type': 'application/json',
'X-API-Key': os.environ['OG_IMAGE_API_KEY']
},
json={
'title': 'Getting Started with TypeScript',
'subtitle': 'A practical guide for JavaScript developers',
'template': 'default',
'theme': 'dark'
}
)
with open('og-image.png', 'wb') as f:
f.write(response.content)Related Templates
- Blog Post — Better for author-attributed content
- Social Share — More engagement-focused design