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 a 1200×630 PNG (Facebook, X, LinkedIn and WhatsApp do not accept SVG). Design one visually in the OG Image Generator and copy its URL.

ParameterTypeDescription
titlestringMain title text (required)
subtitlestringSubtitle text
authorstringAuthor name
templatestringTemplate: default, blog, product, social, minimal, nature, sunset, ocean, aurora, paper, neon, royal
layoutstringleft (default), center, card
fontstringbitter (default), inter, grotesk (Space Grotesk), playfair (Playfair Display), mono (JetBrains Mono)
tagstringSmall pill label above the title, e.g. "New" (max 28 chars)
wnumberOptional smaller width (100–1199); height scales to keep 1.91:1
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

Returns application/zip containing a scalable favicon.svg built from your parameters, a site.webmanifest, browserconfig.xml and the HTML snippet. PNG and ICO rasterization happens in the browser — use the favicon generator page for the full ICO + PNG set.

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
Free5/day50/day3,000/day
Pro ($12/mo)Unlimited10K/moUnlimited
Agency ($29/mo)UnlimitedUnlimitedUnlimited

Response Codes

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