Open Graph images,
from a single URL.
Share-ready 1200×630 cards for your blog posts,
projects and sites. Set a title, pick a theme, and drop the
link in your
<head>.
GET /img?title=Hello+World&theme=dark
Design your image
The preview updates as you type.
A simple API. No key required.
Pass query parameters, get an image back. Use the URL directly in your Open Graph metadata.
/img
Recommended
Generates an image directly and returns SVG with a 1200×630 viewBox. Use this one in your HTML metadata.
/
Shows this page when no parameters are given. If
title is present, the root URL returns
an image instead.
Query parameters
All parameters are optional. Values should be
URL-encoded. embed and
refresh are flags and need no value.
Images are cached for 24 hours.
| Parameter | Description | Default |
|---|---|---|
title |
Main headline. Up to 160 characters; long titles wrap to three lines. | Hello World! |
description |
Supporting text. Up to 240 characters; wraps to two lines. | Default description |
brand |
Brand name shown in the header and footer. Up to 60 characters. | msar.me |
theme |
dark or
light image theme.
Any other value uses
dark.
|
dark |
font |
Any
Google Fonts
family name (e.g.
Playfair Display).
The font is subset to the text used
and embedded in the SVG. Unknown
names fall back to the default.
Letters, digits and spaces only, up
to 60 characters.
|
Inter |
bg |
random/<topic>
for a random Unsplash photo on that
topic (e.g.
random/nature; plain
random uses
technology), or an
HTTP(S) image URL for a custom
background.
|
gradient |
embed |
Flag. Inlines the
bg image into the SVG
so it still shows when the SVG is
loaded as an image or converted to
PNG/JPG.
|
off |
refresh |
Flag. Skips the cached image and replaces it with a fresh render (e.g. a new random background). | off |
Caching
Images ship with Cache-Control headers
for seven days. The Worker Cache API reuses
responses within the same Cloudflare data center,
and each distinct query string gets its own entry.
Good to know
- Image format. The Worker currently returns SVG. Some social platforms need PNG or JPEG for reliable previews.
- Custom backgrounds. The SVG renderer references remote images, which some crawlers won't load. Use server-side compositing when the background must always render.