// cornerstone

OG Image From URL — generate or validate

People search "OG image from URL" for two reasons. Either they want to generate a new OG image by pointing a tool at their live page URL, or they want to validate an existing og:image URL to see how it renders across platforms. This page answers both.

Generate from URL7-day trial, no credit card required

Which one are you trying to do?

Generate an OG image from a URL

The hosted approach: a service that takes your page URL as a query parameter, screenshots that page in a real browser, returns a 1200×630 image, and caches it on a global CDN. You reference the generated URL in your og:image meta tag. Done.

{/* In your <head> — once */}
<meta
  property="og:image"
  content="https://uselinkshot.com/api/og/v1/<TEMPLATE_ID>?url=<PAGE_URL>"
/>

{/* Example for a Next.js blog post */}
<meta
  property="og:image"
  content={`https://uselinkshot.com/api/og/v1/abc-123?url=${encodeURIComponent(
    `https://example.com/blog/${post.slug}`
  )}`}
/>

Linkshot defaults to 1200×630 at 2× pixel density — the standard OG dimensions Facebook, X, LinkedIn, Slack, Discord, and iMessage all accept. Cached at the edge globally; cache hits do not consume your monthly quota.

Hide what you don't want at capture

Add the linkshot: TailwindCSS modifier to elements you want hidden or restyled only during screenshot capture. Your live page stays as is.

<nav class="linkshot:hidden"> … </nav>

Validate an existing og:image URL

Once you have an og:image URL set, you want to verify how each platform renders the unfurled card. Each major platform exposes its own debugger:

Visiting six debuggers per page is tedious. Linkshot is shipping a free /og-image-debugger tool that shows all six previews in parallel and offers a one-click path to regenerate the image with Linkshot if it looks wrong.

Common reasons an OG image URL fails to render

  • URL returns HTML or a 30x redirect instead of an image binary
  • Image is smaller than the platform minimum (~600×315)
  • Image is larger than the platform maximum (~5–8 MB)
  • Platform cached an older version (use per-platform debugger to force rescrape)
  • Mixed content (http on https page) or CORS issues
  • Relative URL instead of absolute https://

What URL goes in the og:image meta tag?

The og:image meta tag value should be an absolute HTTPS URL that returns a binary image (PNG, JPG, or WebP) at 1200×630 (or close). Some quick rules:

  • Always absolute, with the full https:// scheme. Relative URLs fail silently in social crawlers.
  • PNG, JPG, or WebP. SVG is not reliably supported.
  • Recommended: 1200×630 (1.91:1 aspect ratio) — the de facto standard across platforms.
  • Under 8 MB total response size to satisfy the strictest platforms.
  • Stable URL — platforms cache by URL, so changing the URL invalidates everywhere.
  • Reachable from outside your network (no auth required, no IP allowlists).

Related guides

Frequently asked questions

What does "OG image from URL" actually mean?

It is a dual question. (1) "How do I generate an OG image from a URL?" — pass the page URL to a hosted service that screenshots it and returns a 1200×630 image you reference in og:image. (2) "What URL goes in my og:image meta tag?" — an absolute HTTPS URL that returns a PNG/JPG/WebP of the right dimensions for link unfurling. Linkshot answers both — the generated URL is the one you put in your meta tag.

How big should the URL response be?

Under 8 MB total to be safe across all platforms. Most platforms accept up to 5 MB; X has historically been the strictest. Linkshot defaults to optimized PNG/WebP under 1 MB, well within every platform limit.

Do I need an absolute URL or relative?

Always absolute, with the full https:// protocol and domain. Social-media crawlers fetch the URL from outside your site, so relative paths fail silently. Linkshot URLs are always absolute by construction.

How do I validate that a URL works as an OG image?

Paste the page URL into the Facebook Sharing Debugger, X Card Validator, or LinkedIn Post Inspector. Each shows how the OG card renders on that platform. Linkshot is shipping a free /og-image-debugger tool that checks all 6 platforms (FB, X, LinkedIn, Slack, Discord, iMessage) in parallel.

My og:image URL works but the preview is broken — why?

Common culprits: (1) the URL returns HTML or a 30x redirect instead of an image binary; (2) the image is too small (most platforms want at least 600×315); (3) the platform cached an older version (use the per-platform debugger to force re-scrape); (4) CORS or mixed-content issues. Linkshot handles all four by default.

How does Linkshot generate the URL?

You register your domain, create a template (or use the default 1200×630 / retina template), then construct a URL like https://uselinkshot.com/api/og/v1/<TEMPLATE_ID>?url=<PAGE_URL>. Drop that into your og:image meta tag. The first request renders; every subsequent request hits the edge cache.

Can I use a query string in the page URL?

Yes. Linkshot URL-encodes the page URL parameter, so query strings, fragments, and special characters work transparently. The screenshot is taken of exactly the URL you pass.

Will the URL update when my page content changes?

Linkshot caches each unique page URL's screenshot for the configured TTL. When the cache expires (or when you bust it via the dashboard), the next request renders the current state of the page. So yes — the URL stays the same, the bytes update on the next cycle.

Generate your OG image from a URL

Drop one meta tag in your <head> with your page URL. Done in 5 minutes, $9/mo with no credit card.

7-day free trial · no credit card required