API Documentation

Generate favicons and OG images programmatically. Free tier: 5 requests/day. Pro: unlimited.

Base URL

https://og.hjlabs.in

OG Image Generation

GET /api/og

Generate an OG image via URL parameters. Returns SVG image.

ParameterTypeDescription
titlestringMain title text (required)
subtitlestringSubtitle text
authorstringAuthor name
templatestringTemplate: default, blog, product, social, minimal, nature
brandstringBrand text (top-left)
bghex colorCustom background color
colorhex colorCustom text color
accenthex colorCustom accent color

Example:

https://og.hjlabs.in/api/og?title=My+Blog+Post&template=blog&brand=mysite.com

POST /api/og

Generate via JSON body. Same parameters as GET.

{
  "title": "My Blog Post",
  "subtitle": "A deep dive into...",
  "template": "blog",
  "brand": "mysite.com"
}

Favicon Generation

POST /api/generate-favicon

Generate a favicon ZIP with all sizes. Returns application/zip.

FieldTypeDescription
typestringletter, text, emoji, gradient, or upload
letterstringSingle character (for letter/gradient type)
textstring1-3 characters (for text type)
emojistringEmoji character (for emoji type)
bgColorhexBackground color
textColorhexText/letter color
color1hexGradient start color
color2hexGradient end color
shapestringrounded or circle (gradient type)
siteNamestringFor manifest file generation
imageDatabase64Data URL of uploaded image

Example (curl):

curl -X POST https://og.hjlabs.in/api/generate-favicon \
  -H "Content-Type: application/json" \
  -d '{"type":"letter","letter":"H","bgColor":"#3b82f6","textColor":"#fff"}' \
  -o favicons.zip

GET /api/favicon-preview

Generate a single favicon preview as SVG. Useful for live previews.

ParameterTypeDescription
typestringletter, text, emoji, gradient
letterstringCharacter to display
bghexBackground color
colorhexText color
sizenumberOutput size in pixels (default: 256)

Rate Limits

PlanFavicon ZIPOG ImagesPreview SVG
Free10/day50/day100/day
Pro ($12/mo)Unlimited10K/moUnlimited
Agency ($29/mo)UnlimitedUnlimitedUnlimited

Response Codes

CodeDescription
200Success
400Bad request (missing/invalid parameters)
429Rate limit exceeded
500Server error