API Documentation
Generate OG images, check URL meta tags, and list templates with our free REST API. No API key required. CORS-enabled for browser use.
GET /api/og
Generate an OG image as PNG. Returns image/png with Cache-Control headers.
Parameters
| Param | Type | Required | Description |
|---|---|---|---|
| template | string | No | Template ID (default: blog-minimal-dark) |
| title | string | Yes | Main title text |
| description | string | No | Subtitle or description |
| author | string | No | Author name |
| bgColor | string | No | Background color (hex, e.g. #0a0a0a) |
| accentColor | string | No | Accent color (hex) |
| width | number | No | Image width (200-2400, default: 1200) |
| height | number | No | Image height (200-2400, default: 630) |
Examples
curl
curl "https://og.codercops.com/api/og?title=Hello+World&template=blog-minimal-dark" \
--output og-image.png JavaScript
const params = new URLSearchParams({
template: 'blog-minimal-dark',
title: 'Hello World',
author: 'OGCOPS',
});
const imageUrl = `https://og.codercops.com/api/og?${params}`;
// Use as meta tag:
// <meta property="og:image" content={`${imageUrl}`} /> Python
import requests
response = requests.get("https://og.codercops.com/api/og", params={
"template": "blog-minimal-dark",
"title": "Hello World",
"author": "OGCOPS",
})
with open("og-image.png", "wb") as f:
f.write(response.content) GET /api/preview
Fetch and analyze meta tags from a URL. Returns JSON with meta tags, analysis score, and per-platform preview data for 8 platforms.
Parameters
| Param | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | URL to check (must be a valid URL) |
Response
JSON Response
{
"url": "https://example.com",
"meta": {
"title": "Example",
"ogTitle": "Example - Site",
"ogImage": "https://example.com/og.png",
...
},
"analysis": {
"score": 85,
"grade": "B",
"issues": [...],
"summary": "Good setup with minor improvements possible."
},
"platforms": [
{
"platform": "twitter",
"name": "Twitter / X",
"imageUrl": "...",
"title": "...",
"description": "...",
...
},
...
]
} GET /api/templates
List all available templates with their fields, defaults, and thumbnail URLs.
curl
curl "https://og.codercops.com/api/templates" GET /api/templates/{id}/thumbnail.png
Get a 600x315 thumbnail preview of a template with its default values. Cached for 7 days.
Example
https://og.codercops.com/api/templates/blog-minimal-dark/thumbnail.png