Generate beautiful Open Graph images via a simple HTTP API. No headless browser needed — uses Satori + Resvg for fast SVG-to-PNG rendering.
npm install
npm run build
npm start| Parameter | Type | Default | Description |
|---|---|---|---|
title |
string | required | Main heading text |
subtitle |
string | — | Secondary text |
template |
string | default | default, gradient, or minimal |
theme |
string | dark | dark or light |
fontSize |
number | 64 | Title font size (16-128) |
width |
number | 1200 | Image width (200-2400) |
height |
number | 630 | Image height (200-1260) |
bg |
string | — | Custom background color (hex) |
color |
string | — | Custom text color (hex) |
accent |
string | — | Custom accent color (hex) |
# Default dark template
curl "http://localhost:3001/api/og?title=My+Blog+Post" -o og.png
# Light gradient template
curl "http://localhost:3001/api/og?title=Launch+Day&subtitle=v2.0+is+here&template=gradient&theme=light" -o og.png
# Custom colors
curl "http://localhost:3001/api/og?title=Custom&bg=%23000&color=%23fff&accent=%23ff6b6b" -o og.png<meta property="og:image" content="https://your-domain.com/api/og?title=My+Page" />- Fork this repo
- Go to render.com → New Web Service → Connect repo → Docker → Deploy
docker build -t ogsnap .
docker run -p 3001:3001 ogsnap- No headless browser — pure SVG rendering via Satori
- ~50ms per image generation
- Responses cached for 24 hours via Cache-Control headers
- Rate limited: 50 requests/hour (free), unlimited with API key
MIT