betterimage.io

v1.3.0
io.betterimage/betterimage Checked 3 days ago Published 8 hours ago

Social cards and OG images from designed templates: card from a URL, presets, meta tags, link checks

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

card_from_url Card from a page URL

Make a social card for a page that already exists, in one call: fetches the page like a crawler, takes its title, description, author, domain and site icon, picks the starter design that fits the page (a Jev decision over every preset, about 100 ms) and returns the image (shown inline, watermarked, free). Use this first when the user gives a URL: "make an OG image for my latest post". Any field you pass overrides what the page says. Pass preset (see list_presets) to choose the design yourself, or a size. No API key needed; one page fetch plus one render per call.

ParameterTypeDescription
url *stringThe page URL, e.g. https://example.com/blog/my-post.
fieldsobjectWhat to put on the card. Text fields replace the template's text; the *_url fields replace its pictures, fetched server-side. Omit a field to keep what the template has. Design - colours, fonts, layou…
presetstringPreset key from list_presets. Omit it to let Jev pick the design that fits the page (the result names the pick and its runners-up). Fallback when no pick is possible: og-essay-light.
sizestringOutput canvas: og (1200x630), youtube (1280x720), square (1080x1080), portrait (1080x1350), story (1080x1920), pinterest (1000x1500). Defaults to the template's own size, usually og (1200x630, the lin…

list_presets List starter designs

Browse the ready-made designs (presets) a card can start from: key, name, template kind, native size, use-case categories, a one-line look description and a preview image URL. Start here when the user wants a social card and has no saved template. Then call preview_card with the chosen key. No API key needed.

ParameterTypeDescription
categorystringOnly presets in this use-case or format category.
kindstringOnly this template kind. basic: headline + photo cards. profile: photo, name, role. testimonial: quote with reviewer and rating. minimal: headline-only. product: framed screenshot with a rating and a…
querystringCase-insensitive match against the preset's name, key and look description, e.g. "dark", "serif", "pastel".

preview_card Preview a card from a preset

Render a preset with the user's text and return the image (shown inline). Free, no API key; the preview carries a small betterimage.io watermark and does not touch any quota. Use it to show the user what their card will look like before they commit. For a clean image: save_template + render_card on a paid API plan, or the one-off clean download in the editor.

ParameterTypeDescription
preset *stringPreset key from list_presets, e.g. "loud-pastel".
fieldsobjectWhat to put on the card. Text fields replace the template's text; the *_url fields replace its pictures, fetched server-side. Omit a field to keep what the template has. Design - colours, fonts, layou…
sizestringOutput canvas: og (1200x630), youtube (1280x720), square (1080x1080), portrait (1080x1350), story (1080x1920), pinterest (1000x1500). Defaults to the template's own size, usually og (1200x630, the lin…

generate_meta_tags Generate meta tags

Build the complete <head> block for a page: <title>, meta description, canonical, Open Graph and Twitter card tags, with og:image width/height. Returns HTML to paste plus notes on anything worth fixing (title too long, image over http). Use after check_link_preview, or whenever a user needs the tags for a new page. No API key needed; nothing is fetched.

ParameterTypeDescription
title *stringPage title (aim for 60 characters or fewer).
descriptionstringOne or two sentences (aim for 160 characters or fewer).
image_altstringAlt text for the image.
image_heightintegerPixel height of the image file. Default 630.
image_urlstringAbsolute https URL of the share image. A signed URL from og_image_url, or a PNG from render_card that you host.
image_widthintegerPixel width of the image file. Default 1200.
site_namestringSite or brand name for og:site_name.
twitter_cardstringTwitter card layout. summary_large_image (default) shows the big image.
typestringog:type. Default website.
urlstringCanonical page URL.

list_templates List saved templates

The user's saved templates (their own designs, made in the editor or with save_template): slug, name, kind, the fields render_card and og_image_url can override, and when it was last edited. Needs an API key. Call this before render_card or og_image_url when you do not know the slug.

save_template Save a preset as a template

Copy a preset (optionally with the user's text as its new defaults) into the user's account as a saved template, so render_card and og_image_url can use it. Needs an API key. Do this once per design, not per image: afterwards every render only passes the text that changes. Returns the slug to use next and a link to fine-tune the design in the editor.

ParameterTypeDescription
preset *stringPreset key from list_presets.
fieldsobjectWhat to put on the card. Text fields replace the template's text; the *_url fields replace its pictures, fetched server-side. Omit a field to keep what the template has. Design - colours, fonts, layou…
namestringTemplate name (up to 80 characters); its slug is derived from it. Defaults to the preset's name.
sizestringOutput canvas: og (1200x630), youtube (1280x720), square (1080x1080), portrait (1080x1350), story (1080x1920), pinterest (1000x1500). Defaults to the template's own size, usually og (1200x630, the lin…

render_card Render a saved template

Render one of the user's saved templates with the given text and return the PNG (shown inline, at 1x). Needs an API key. On a paid plan the image is clean (no watermark); on the free tier it is watermarked. Each call spends one image of the monthly quota. Use it when the user wants the actual file, e.g. to host it themselves. For an og:image tag that needs no hosting, or for a 2x retina file, prefer og_image_url.

ParameterTypeDescription
template *stringTemplate slug from list_templates or save_template.
fieldsobjectWhat to put on the card. Text fields replace the template's text; the *_url fields replace its pictures, fetched server-side. Omit a field to keep what the template has. Design - colours, fonts, layou…
sizestringOutput canvas: og (1200x630), youtube (1280x720), square (1080x1080), portrait (1080x1350), story (1080x1920), pinterest (1000x1500). Defaults to the template's own size, usually og (1200x630, the lin…

og_image_url Signed og:image URL

Build a signed image URL for a saved template with the given text, ready to put in a page's <meta property="og:image"> tag. Nothing is rendered now: the image is generated when a crawler fetches the URL, cached at the edge for a day, and each uncached fetch spends one image of the monthly quota. Needs an API key. This is the zero-infrastructure way to give every page its own card; use it in page templates, CMS hooks and static site generators. Returns the URL and the ready meta tag.

ParameterTypeDescription
template *stringTemplate slug from list_templates or save_template.
fieldsobjectWhat to put on the card. Text fields replace the template's text; the *_url fields replace its pictures, fetched server-side. Omit a field to keep what the template has. Design - colours, fonts, layou…
scaleinteger2 renders at twice the pixel size for high-DPI screens (a 1200x630 card becomes 2400x1260). Default 1.
sizestringOutput canvas: og (1200x630), youtube (1280x720), square (1080x1080), portrait (1080x1350), story (1080x1920), pinterest (1000x1500). Defaults to the template's own size, usually og (1200x630, the lin…

get_usage Quota and plan

The API key's plan, whether renders are watermarked, and this month's image quota: used, remaining, and the reset date. Needs an API key. Check it before batch renders, or when a render came back watermarked unexpectedly.