Generate Twitter Card Images with an API

A Twitter (X) card image is the large preview shown when a link is shared on X. FastOG generates it dynamically at 1200×630 and signals summary_large_image, so every page gets a proper X card without creating an image by hand.

What a Twitter card image needs

X reads Open Graph tags and renders a summary_large_image card when the page links twitter:card = summary_large_image. The image renders at 1200×630. FastOG produces exactly that, and you point twitter:image at the same dynamic URL as og:image.

How to wire a dynamic Twitter card

Generate your FastOG URL once, then set both the OG and Twitter meta tags to it.

html
<meta property="og:image" content="https://fastog.com/api/v1/og?template=default&title=My+Post&key=sk_...&s=...">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="My Post">
<meta name="twitter:image" content="https://fastog.com/api/v1/og?template=default&title=My+Post&key=sk_...&s=...">

The same URL works for both tags. X falls back to og:image if twitter:image is absent, but setting both is harmless and explicit.

X Card validator tips

Check Detail
Public URL The image must be fetchable by X without auth
File size / format Keep under 5 MB; PNG is best for text cards
Cache X caches aggressively — use the Card Validator to force a refresh
Signed URLs FastOG's content-signed URLs only gate the first render; cached cards stay valid

FAQ

Do I need separate images for X and Open Graph?

No. X reads the same 1200×630 image. This page exists because the correct twitter:card tags are easy to get wrong.

Why is my X card not updating after I change the title?

X caches the old card. Open the X Card Validator, paste the URL, and re-scrape.

Does FastOG handle the twitter meta tags too?

FastOG generates the image; you still add the twitter:card and twitter:image meta tags to your page (as shown above). Our free Open Graph Meta Tag Generator writes all the tags for you.

Related

Try it free — no signup required

Preview and test dynamic OG images in seconds.

Open the Free OG Image Tester