apyhub
Back
▣ MARKETING · SMART GENERATION

Dynamic OG Image API

What it does

Dynamic OG Image Generator creates Open Graph images from a single request. Send a title and optional styling fields, and you get back a binary image you can use for social previews, link cards, and blog sharing.

Use the body object to set the main title and, if needed, tag, subtitle, author, domain, and reading_time. You can also control the look with template, background, bg_color, text_color, and accent_color. The service supports blog, minimal, bold, and card layouts, plus solid, gradient, horizontal gradient, vertical gradient, pattern, and mesh backgrounds.

This is a good fit when you need consistent preview images without generating them in your app or hand-designing each one. For example, you can create share images for new articles, product pages, or docs pages from the same endpoint and keep the styling aligned across your site.

Dynamic OG Image Generator returns the image as a binary response, so you can store it, serve it directly, or feed it into your publishing pipeline.

POST
Dynamic OG Image Generation
https://api.eu.apyhub.com/chisleroff/dynamic-og-image-generation

QUICKSTART

GUIDE

Quickstart

Generate an OG image by sending the required title field in a JSON body.

curl -X POST "https://api.eu.apyhub.com/chisleroff/dynamic-og-image-generation" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "How to Build APIs with FastAPI",
  "subtitle": "A complete guide to building production-ready APIs",
  "bg_color": "#4f46e5",
  "template": "blog",
  "background": "gradient",
  "author": "Jane Doe",
  "domain": "blog.example.com",
  "reading_time": "8 min read",
  "tag": "Tutorial"
}'

What you'll get back

Returns a binary file containing the generated image.

TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Main headline for the OG image.
Tag/label pill text.
Domain name to display.

About this endpoint

What it does

Generates a dynamic Open Graph image from the provided body fields and returns the image as binary data.

Request Body

ParameterTypeDescription
titleStringMain headline for the OG image. Max length 200.
tagStringTag/label pill text. Max length 50.
authorStringMax length 100.
domainStringDomain name to display. Max length 100.
bg_colorStringHex background color. Default: #1a202c.
subtitleStringSubtitle text. Max length 300.
templateENUMAllowed values: blog, minimal, bold, card. Default: blog.
backgroundENUMAllowed values: solid, gradient, gradient_horizontal, gradient_vertical, pattern, mesh. Default: solid.
text_colorStringHex text color. Default: #ffffff.
accent_colorStringHex accent color. Auto-derived if omitted.
reading_timeStringReading time label. Max length 50.

Response

Returns a binary string containing the generated image.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.