Skip to content

Blog Post Template

Designed specifically for blog posts and articles with author attribution.

Template ID

template: "blog"

Preview

A content-focused layout featuring:

  • Prominent title
  • Author name and avatar
  • Reading time indicator
  • Professional gradient background

Parameters

ParameterTypeRequiredDescription
titlestringYesArticle headline
subtitlestringNoArticle excerpt or description
author_namestringNoAuthor's display name
author_avatar_urlstringNoAuthor's profile photo URL
reading_timestringNoEstimated reading time
themestringNodark (default) or light
logo_urlstringNoPublication/brand logo

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": "10 JavaScript Tips for Cleaner Code",
    "subtitle": "Write more readable and maintainable JavaScript",
    "author_name": "Sarah Chen",
    "author_avatar_url": "https://example.com/sarah.jpg",
    "reading_time": "5 min read",
    "template": "blog",
    "theme": "dark"
  }' \
  --output blog-og.png

Layout Structure

┌─────────────────────────────────────────┐
│                                         │
│   [Logo]                                │
│                                         │
│   ┌─────────────────────────────────┐   │
│   │     Title Goes Here             │   │
│   │     (Large, Bold)               │   │
│   └─────────────────────────────────┘   │
│                                         │
│   Subtitle text appears here...         │
│                                         │
│   ┌──────┐                              │
│   │Avatar│  Author Name · 5 min read    │
│   └──────┘                              │
│                                         │
└─────────────────────────────────────────┘

Theme Variations

Dark Theme

  • Rich, professional gradient
  • High-contrast white text
  • Avatar with subtle border
  • Perfect for tech and developer blogs

Light Theme

  • Clean white/gray background
  • Dark text for readability
  • Soft shadows and borders
  • Great for lifestyle and business content

Use Cases

Content TypeRecommended Setup
Tech tutorialsDark theme + avatar
News articlesLight theme + logo
Opinion piecesDark theme + author
How-to guidesEither theme
ListiclesDark theme

Best Practices

  1. Always include author — Builds trust and recognition
  2. Use real avatars — Stock photos feel impersonal
  3. Add reading time — Sets expectations for readers
  4. Keep titles scannable — Use numbers or power words

Integration Example

Next.js Blog

javascript
// pages/blog/[slug].js
export async function getStaticProps({ params }) {
  const post = await getPost(params.slug);
  
  // Generate OG image
  const ogResponse = 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: post.title,
      subtitle: post.excerpt,
      author_name: post.author.name,
      author_avatar_url: post.author.avatar,
      reading_time: `${post.readingTime} min read`,
      template: 'blog',
      theme: 'dark'
    })
  });
  
  // Save image to public folder
  const imageBuffer = await ogResponse.arrayBuffer();
  fs.writeFileSync(`./public/og/${params.slug}.png`, Buffer.from(imageBuffer));
  
  return { props: { post } };
}

WordPress Integration

php
function generate_og_image($post_id) {
    $post = get_post($post_id);
    $author = get_the_author_meta('display_name', $post->post_author);
    
    $response = wp_remote_post('https://ogimageapi.io/api/generate', [
        'headers' => [
            'Content-Type' => 'application/json',
            'X-API-Key' => get_option('og_image_api_key')
        ],
        'body' => json_encode([
            'title' => $post->post_title,
            'subtitle' => get_the_excerpt($post_id),
            'author_name' => $author,
            'template' => 'blog',
            'theme' => 'dark'
        ])
    ]);
    
    // Save and attach image to post
    // ...
}

Avatar Specifications

PropertyRecommendation
FormatPNG or JPG
Size200×200 px minimum
Aspect ratio1:1 (square)
File sizeUnder 500KB

The avatar will be automatically cropped to a circle.

Generate stunning Open Graph images programmatically.