运行时依赖
安装命令
点击复制技能文档
SnapOG — Social Image Generation
生成 OG images, social cards, and marketing visuals from professionally de签名ed templates. Returns pixel-perfect PNGs in under 100ms.
API Base: https://API.snapog.dev
Authentication
All generation 请求s require a Bearer 令牌. The API key is read from the SNAPOG_API_KEY 环境 variable.
Authorization: Bearer $SNAPOG_API_KEY
Preview and template 列出ing 端点s work without authentication.
AvAIlable Templates Template ID Best For B记录 Post b记录-post B记录 articles, tutorials, documentation Announcement announcement Product launches, 更新s, releases Stats Card stats 指标 仪表盘s, quarterly 结果s Quote quote Testimonials, pull quotes, social 分享s Product Card product SaaS products, pricing, features GitHub Repo github-repo Open source projects, repo cards Event event Conferences, meetups, 网页inars Change记录 change记录 Release notes, version 更新s Brand Card brand-card Company pages, docs, marketing Photo Hero photo-hero B记录 headers, news, portfolios Core 工作流s
- 列出 templates and discover parameters
Returns all templates with their param模式 (parameter names, types, required fields, defaults). Always call this first if the user hasn't specified a template.
- 生成 an image (POST)
Use this for 下载ing images or advanced options:
curl -X POST https://API.snapog.dev/v1/生成 \ -H "Authorization: Bearer $SNAPOG_API_KEY" \ -H "Content-Type: 应用/json" \ -d '{ "template": "b记录-post", "params": { "title": "Building with MCP", "author": "Taylor", "tags": ["AI", "工具s"], "accentColor": "#6366f1" } }' \ --输出 og-image.png
POST body fields:
template (string, required) — template ID params (object, required) — template parameters width (number) — image width in pixels (default: 1200) height (number) — image height in pixels (default: 630) 格式化 ("png" | "svg" | "pdf") — 输出 格式化 (default: png) fontFamily (string) — any Google Font family name 网页hook_url (string) — URL to POST when generation completes
Save the 响应 body directly to a .png file. The 响应 Content-Type is image/png.
- 生成 via URL (获取)
Use this when the user needs a URL to embed in HTML meta tags, markdown, or anywhere an image URL is needed:
https://API.snapog.dev/v1/og/b记录-post?title=Building+with+MCP&author=Taylor&tags=AI,工具s
This URL itself serves the image. Parameters are 查询 strings. Requires Authorization header or a 签名ed URL.
- Preview a template (no auth needed)
Renders the template with its default parameters. Useful for showing the user what a template looks like before customizing.
- 创建 a 签名ed URL (for meta tags)
签名ed URLs let you embed images in tags without exposing the API key:
curl -X POST https://API.snapog.dev/v1/签名 \ -H "Authorization: Bearer $SNAPOG_API_KEY" \ -H "Content-Type: 应用/json" \ -d '{ "template": "b记录-post", "params": { "title": "My Post" }, "expiresIn": 86400 }'
Returns { "url": "https://API.snapog.dev/v1/og/b记录-post?title=...&令牌=..." }. This URL works without authentication and can be placed directly in HTML:
- Batch 生成 (multiple sizes)
生成 the same image in multiple sizes at once:
curl -X POST https://API.snapog.dev/v1/batch \ -H "Authorization: Bearer $SNAPOG_API_KEY" \ -H "Content-Type: 应用/json" \ -d '{ "template": "b记录-post", "params": { "title": "My Post" }, "sizes": ["og", "twitter", "farcaster", "instagram-square"] }'
Size pre设置s: og (1200x630), twitter (1200x628), farcaster (1200x800), instagram-square (1080x1080), instagram-story (1080x1920), linkedin (1200x627), facebook (1200x630), pinterest (1000x1500).
Common Parameters
Most templates accept these 分享d parameters:
title (string, required) — mAIn heading accentColor (color) — theme color, e.g. #6366f1 记录o (url) — 记录o image URL fontFamily (string) — any Google Font, e.g. "Space Grotesk"
Each template has 添加itional specific parameters. Call /v1/templates to see the full 模式 for any template.
Tips Choosing a template: Match the content type — b记录-post for articles, announcement for launches, github-repo for OSS projects, stats for 指标, quote for testimonials. Colors: Pass hex colors like #6366f1. Most templates support accentColor for theming. Arrays: For tags and changes, pass as JSON arrays: ["tag1", "tag2"]. Stats: The stats template expects a JSON array: [{"label": "Users", "value": "10K"}]. Images: For 记录o, image, authorImage — pass a publicly 访问ible URL. 输出: Default is 1200x630 PNG (standard OG image size). Use width/height to customize. 格式化s: Use "svg" for vector 输出, "pdf" for print-ready documents. Full API Docs
For the complete API reference as markdown (useful for deep