Appearance
Quick Start
Get your first OG image generated in under 5 minutes.
Step 1: Get Your API Key
- Choose a plan on our pricing page
- Complete checkout via Stripe
- Receive your API key via email
Your API key looks like: og_aBcDeFgHiJkLmNoPqRsTuVwXyZ123456
Keep it secret!
Your API key grants access to your account. Never expose it in client-side code.
Step 2: Make Your First Request
Use cURL to generate a test image:
bash
curl -X POST https://ogimageapi.io/api/generate \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"title": "Hello, World!",
"subtitle": "My first OG image",
"theme": "dark"
}' \
--output hello.pngOpen hello.png - you should see your generated image!
Step 3: Customize Your Image
The API accepts these parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Main headline (max 200 chars) |
subtitle | string | No | Secondary text (max 300 chars) |
author_name | string | No | Author/creator name |
author_avatar_url | string | No | URL to avatar image |
theme | string | No | dark or light (default: dark) |
template | string | No | default, minimal, or vibrant |
Step 4: Integrate
Static Site Generators
Generate images during your build process:
javascript
// generate-og-images.js
const fs = require('fs');
async function generateOGImage(post) {
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: post.title,
subtitle: post.excerpt,
author_name: post.author,
theme: 'dark'
})
});
const buffer = await response.arrayBuffer();
fs.writeFileSync(`./public/og/${post.slug}.png`, Buffer.from(buffer));
}Dynamic Generation
For dynamic content, generate on-demand:
html
<meta property="og:image" content="https://your-server.com/api/og?title=Your+Title" />Next Steps
- API Reference - Full endpoint documentation
- Templates - Explore available designs
- Code Examples - Integration examples for your stack