{"id":46,"date":"2026-07-08T10:42:31","date_gmt":"2026-07-08T10:42:31","guid":{"rendered":"https:\/\/blog.skndan.com\/jsontoimg\/?page_id=46"},"modified":"2026-11-17T13:33:55","modified_gmt":"2026-11-17T13:33:55","slug":"open-graph-images","status":"publish","type":"page","link":"https:\/\/blog.skndan.com\/jsontoimg\/use-cases\/open-graph-images\/","title":{"rendered":"OG Image API: Signed Open Graph Images from JSON"},"content":{"rendered":"<p>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\u2019s 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.<\/p>\n<h2>Signed URL, not a screenshot<\/h2>\n<p>Screenshot APIs capture whatever is on the page. A named-layer template captures the title, author, and date you send \u2014 even if the live layout is a mess. Design 1200\u00d7630 once. Name <code>title<\/code>, <code>author<\/code>, <code>date<\/code> (and a cover image if you have one).<\/p>\n<h2>Mint an og:image URL<\/h2>\n<pre><code>curl -X POST &quot;https:\/\/app.jsontoimg.com\/api\/v1\/img\/sign&quot; \\\n  -H &quot;Authorization: Bearer $JSONTOIMG_API_KEY&quot; \\\n  -H &quot;Content-Type: application\/json&quot; \\\n  -d &#39;{&quot;template&quot;:&quot;&lt;design-id&gt;&quot;,&quot;format&quot;:&quot;jpg&quot;,&quot;layers&quot;:{&quot;title&quot;:{&quot;text&quot;:&quot;Ship the OG tag&quot;}}}&#39;\n<\/code><\/pre>\n<p>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.<\/p>\n<h2>Next.js sketch<\/h2>\n<pre><code>const { url } = await client.signImageUrl({\n  template: process.env.OG_TEMPLATE_ID,\n  format: &quot;jpg&quot;,\n  layers: { title: { text: post.title }, author: { text: post.author } },\n});\n\/\/ &lt;meta property=&quot;og:image&quot; content={url} \/&gt;\n<\/code><\/pre>\n<p>Full options, expiry, and batch mint: <a href=\"https:\/\/jsontoimg.com\/docs\/guides\/url-rendering\">URL rendering guide<\/a>. Code-heavy walkthrough: <a href=\"https:\/\/jsontoimg.com\/blog\/auto-generate-og-images-with-jsontoimg\">Next.js \/ WordPress how-to<\/a>.<\/p>\n<h2>What the crawler actually fetches<\/h2>\n<p>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 <a href=\"https:\/\/ogp.me\/\">Open Graph protocol spec<\/a> \u2014 <code>og:image:width<\/code> and <code>og:image:height<\/code>. Send the dimensions and the card renders without the crawler measuring the file first.<\/p>\n<p>Design for the crop, not the canvas. 1200\u00d7630 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 \u2014 <a href=\"https:\/\/developers.google.com\/search\/docs\/appearance\/google-images\">Google\u2019s image SEO guidance<\/a> on filenames and alt text applies to a generated card exactly as it does to a photograph.<\/p>\n<h2>Changing the template after URLs are out<\/h2>\n<p>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 \u2014 plan for the old look to persist, not for a clean cutover.<\/p>\n<h2>Related<\/h2>\n<ul>\n<li><a href=\"https:\/\/jsontoimg.com\/use-cases\">All image generation use cases<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/nextjs-og-image-vs-template-api\">Next.js OG image vs a template API<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/og-image-not-showing-debug-checklist\">OG image not showing? Debug checklist<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/wordpress-open-graph-images-from-post-titles\">WordPress OG image automation<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/tools\/free-open-graph-image-generator\">Free OG image generator<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/tools\/free-og-preview\">Open Graph preview tool<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/use-cases\/social-posts\">Social share images<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/pricing\">Pricing<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/docs\">Docs<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/json-to-image-converter\">How JSON-to-image conversion works<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/open-graph-image-generator-guide\">Open Graph image generator guide<\/a><\/li>\n<\/ul>\n<h2>FAQ<\/h2>\n<h3>How do I put a jsontoimg render in og:image?<\/h3>\n<p>Call POST \/api\/v1\/img\/sign with the template and layer overrides. Put the returned URL in the <code>og:image<\/code> meta tag. Crawlers GET it with no API key. The first unique payload costs one credit; the same query string streams the stored file.<\/p>\n<h3>Do I need a webhook to generate OG images?<\/h3>\n<p>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.<\/p>\n<h3>What size should the template be?<\/h3>\n<p>1200\u00d7630 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.<\/p>\n<h3>Can I mint many OG URLs at once?<\/h3>\n<p>POST \/api\/v1\/img\/sign with jobs (1\u201350). That mints URLs; it does not queue POST \/api\/v1\/renders\/batch. Loop if you have more than 50 pages.<\/p>\n<p><a href=\"https:\/\/app.jsontoimg.com\/login\">Get 25 free images \u2192<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mint a signed GET URL per page for og:image. First fetch renders; repeats are free. No webhook required to ship the meta tag.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":45,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-46","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/pages\/46","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/comments?post=46"}],"version-history":[{"count":5,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/pages\/46\/revisions"}],"predecessor-version":[{"id":403,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/pages\/46\/revisions\/403"}],"up":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/pages\/45"}],"wp:attachment":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/media?parent=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}