Skip to content

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

ParameterTypeRequiredDescription
titlestringYesMain headline (max 200 chars)
subtitlestringNoSecondary text (max 300 chars)
themestringNodark (default) or light
logo_urlstringNoBrand 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.png

Theme 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 CaseWhy This Template
Blog postsClean, readable, professional
DocumentationNeutral design, no distractions
Landing pagesVersatile, works with any brand
News articlesClear hierarchy, easy to scan
TutorialsFocus on the content title

Best Practices

  1. Keep titles concise — Aim for 5-10 words
  2. Use subtitles for context — Add the "why" or "what"
  3. Dark theme for tech — Looks great in dev-focused feeds
  4. 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)

Generate stunning Open Graph images programmatically.