Skip to content
jsontoimg
Start free
← All use cases

OG Image API: Signed Open Graph Images from JSON

Mint a signed GET URL per page for og:image. First fetch renders; repeats are free. No webhook required to ship the meta tag.

Every public URL that people paste into Slack or LinkedIn needs an Open Graph image, and an OG image API means you never export one by hand. jsontoimg’s path is a signed GET: mint the URL when the page is saved, drop it in og:image, and let the crawler fetch it. You do not have to wait on a webhook to ship the meta tag.

Signed URL, not a screenshot

Screenshot APIs capture whatever is on the page. A named-layer template captures the title, author, and date you send — even if the live layout is a mess. Design 1200×630 once. Name title, author, date (and a cover image if you have one).

Mint an og:image URL

curl -X POST "https://app.jsontoimg.com/api/v1/img/sign" \
  -H "Authorization: Bearer $JSONTOIMG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"template":"<design-id>","format":"jpg","layers":{"title":{"text":"Ship the OG tag"}}}'

The response is a URL on app.jsontoimg.com. Minting is free. The first unique GET renders and bills one credit to the template owner.

Next.js sketch

const { url } = await client.signImageUrl({
  template: process.env.OG_TEMPLATE_ID,
  format: "jpg",
  layers: { title: { text: post.title }, author: { text: post.author } },
});
// <meta property="og:image" content={url} />

Full options, expiry, and batch mint: URL rendering guide. Code-heavy walkthrough: Next.js / WordPress how-to.

What the crawler actually fetches

A crawler arrives with no API key and no session. It reads the tag, GETs the URL, and gives up fast. Two things make that reliable: an absolute URL (relative paths are dropped), and the companion properties from the Open Graph protocol spec — og:image:width and og:image:height. Send the dimensions and the card renders without the crawler measuring the file first.

Design for the crop, not the canvas. 1200×630 is the slot every major network accepts, but LinkedIn and Slack shrink it hard in a feed, so a 28px subtitle disappears. Keep the headline large and the safe area generous. These files get indexed too — Google’s image SEO guidance on filenames and alt text applies to a generated card exactly as it does to a photograph.

Changing the template after URLs are out

A signed URL that omitted a version renders against whatever the template is today. That is fine until someone restyles it and a two-year-old shared link suddenly looks different. Pin a design version on anything you have already published and leave the unpinned URL for drafts. Platforms cache the fetched image on their side anyway, so a redesign will not propagate to old shares — plan for the old look to persist, not for a clean cutover.

Related

FAQ

How do I put a jsontoimg render in og:image?

Call POST /api/v1/img/sign with the template and layer overrides. Put the returned URL in the og:image meta tag. Crawlers GET it with no API key. The first unique payload costs one credit; the same query string streams the stored file.

Do I need a webhook to generate OG images?

No. Signed URLs are the CMS path. Use POST /api/v1/render?wait=60 only if you want to store the file yourself. Webhooks are for async jobs, not a requirement for meta tags.

What size should the template be?

1200×630 is the usual Open Graph slot. Render PNG or JPG. Pin a design version so a later editor tweak does not change already-shared URLs that omitted version.

Can I mint many OG URLs at once?

POST /api/v1/img/sign with jobs (1–50). That mints URLs; it does not queue POST /api/v1/renders/batch. Loop if you have more than 50 pages.

Get 25 free images →

Your first 25 images are on us.

Design a template, grab an API key, and render your first PNG or PDF in minutes. No card required.