Glossary

Twitter Cards

Twitter Cards are meta tags that tell X (formerly Twitter) how to show a shared link as a rich preview with an image, title and description.

Twitter Cards are a set of meta tags, such as twitter:card, twitter:title and twitter:image, that a web page places in its HTML head to tell X (formerly Twitter) how to show a link to that page as a rich preview. When someone posts the URL, X’s crawler fetches the page, reads the tags and renders a card with an image, a title and a short description in place of a bare link. The tags work alongside Open Graph, and X falls back to Open Graph values when a twitter: tag is missing, so most sites need only one or two X-specific lines on top of the meta tags they already publish.

The name survived the 2023 rebrand. X’s developer documentation still calls them Cards and the tags still use the twitter: prefix, so the term means the same thing whether people say Twitter Cards or X Cards. Other software reads the same tags too. Slack, Discord and many chat tools check twitter:image or twitter:title when they build their own link previews, which means the tags shape how a link looks well beyond X.

How Twitter Cards work

A card is produced when a URL is shared. X’s crawler, which identifies itself with the Twitterbot user agent, requests the page, parses the head of the HTML and looks for tags in the form <meta name="twitter:card" content="summary_large_image">. It reads the card type first, then the title, description, image and any fields specific to that type. If the site blocks Twitterbot in robots.txt, the crawler cannot read the tags and no card appears.

The crawler works from the HTML the server returns. It does not wait for client-side JavaScript to assemble the page, so tags injected after load by a single-page app are often invisible to it. This is the most common reason a card fails on a React or Vue site, and the usual fix is to render the tags on the server or at build time. Most preview crawlers behave the same way, which is why JavaScript rendering and dynamic content come up so often when previews go wrong. The parsing itself is ordinary HTML parsing of the head element: the crawler has no interest in the body text.

X also stores what it found. Once a card has been generated for a URL, later posts of the same URL reuse the cached data for a while, so a corrected image or title may not appear straight away. Adding a query parameter to the URL forces a fresh fetch, though it also creates a separate URL for analytics, which is one reason pages declare a canonical URL.

Card types

X documents four card types. The type is set by the twitter:card tag, and each one expects a slightly different set of fields.

Card type

What it shows

Typical use

summary

A small square thumbnail beside the title and description

Articles, product pages, profile pages

summary_large_image

A large image at a 2:1 ratio with the title and domain

Blog posts, news, launches, anything with a strong image

player

An inline video or audio player in an iframe

Video and audio hosts

app

The app name, icon and a store download link

Mobile app promotion

Earlier versions of the format also had photo, gallery and product cards. X retired those in 2015, so a page that still declares one should be moved to summary or summary_large_image.

For most content sites, summary_large_image is the sensible default because the larger image takes more space in the timeline. Since late 2023, X has shown most link cards as the image with the domain overlaid, and the title is no longer printed beneath it in most of its clients. That puts even more weight on the image, since for many readers it is now the only part of the card they see.

The tags

A card needs only a few tags. The table lists the ones that apply to the two summary types, with the Open Graph property X uses when the Twitter tag is absent.

Tag

Purpose

Open Graph fallback

twitter:card

Card type: summary, summary_large_image, player or app

og:type, for a summary card only

twitter:site

The @username of the website

None

twitter:creator

The @username of the author

None

twitter:title

Title, up to 70 characters

og:title

twitter:description

Description, up to 200 characters

og:description

twitter:image

Absolute URL of the card image

og:image

twitter:image:alt

Alt text for the image, up to 420 characters

og:image:alt

Player cards add twitter:player, an HTTPS URL for the iframe, with twitter:player:width and twitter:player:height, and optionally twitter:player:stream for a raw video or audio file. App cards add a name, a store ID and a custom URL scheme for iPhone, iPad and Google Play.

The site and creator tags attribute the card to accounts on X. They are optional for a summary card. Publishers use them so that posts of their links credit both the publication and the writer, and so that the card can offer a follow prompt for the right account.

How the Open Graph fallback works

X reads Open Graph tags when its own tags are absent. If a page has og:title, og:description and og:image but no twitter:title, twitter:description or twitter:image, X uses the Open Graph values. X’s documentation also says a summary card can render without a twitter:card tag at all, provided og:type, og:title and og:description are present. To get the large image layout you still need twitter:card set to summary_large_image, because Open Graph has no equivalent field.

So the practical minimum for most sites is a full set of Open Graph tags plus one line: <meta name="twitter:card" content="summary_large_image">. Add twitter:image only when the image for X should differ from the og:image, for example a 2:1 crop for X and a 1.91:1 image for other platforms. Duplicating every field in both namespaces does no harm, but it doubles the places where a title can drift out of date when a page is edited.

Mind the attribute. Open Graph tags are specified with property="og:title", while Twitter Cards were specified with name="twitter:title". Following each specification avoids problems with third-party parsers that look for only one form.

Image requirements

Images cause most card problems. For summary_large_image, X documents a 2:1 aspect ratio, a minimum of 300 by 157 pixels and a maximum of 4096 by 4096 pixels. Summary cards use a square image, with a minimum of 144 by 144 pixels. For both, the file must be under 5 MB and in JPG, PNG, WebP or GIF format. Only the first frame of an animated GIF is used, and SVG is not supported.

The image URL must be absolute and publicly reachable. A relative path, an image behind authentication or a server that blocks Twitterbot all produce a card with no image. The server should also send the correct MIME type, since an image served as text/html will be rejected. A common working size is 1200 by 600 pixels, which meets the 2:1 ratio and stays sharp on high-density screens. Keep text and logos away from the edges, because clients crop differently, and supply twitter:image:alt so screen reader users get a description of the picture.

Debugging a card that does not show

When a card fails, work through the same chain the crawler follows. First, fetch the page as Twitterbot would, with a plain HTTP request and no JavaScript, and check that the twitter: and og: tags are in the returned HTML. Second, check robots.txt and any firewall or bot protection in front of the site, because anti-bot detection aimed at scrapers sometimes catches preview crawlers too. Third, confirm that the image URL loads on its own, returns an image content type and sits within the size limits. Fourth, follow any redirect chain: the crawler follows redirects, but long chains, redirects to login pages and hops between HTTP and HTTPS are frequent failure points.

X’s Card Validator was the standard testing tool for years, and the documentation still points to it, but reports from 2022 onwards say the visual preview was removed and the tool now shows a log of what it found. Many teams test by posting to a private account, or with a preview checker that reads the same tags. A link preview API is a third option, since it fetches the page from outside your network and shows what a crawler sees.

A worked example

A product team publishes a launch post on a Next.js site and shares it on X. The post appears as a bare link. Fetching the URL with curl shows a head containing only a title and a meta description: the Open Graph and Twitter tags are set in a client-side component, so they exist only after JavaScript runs. Moving the tags into the page’s server-rendered metadata fixes the HTML, but the card still shows no image. The og:image value is /images/launch.png, a relative path. Changing it to the absolute HTTPS URL, adding twitter:card set to summary_large_image and exporting the image at 1200 by 600 pixels produces a full card. Because X has cached the earlier failed fetch, the team checks the result by posting the URL with a campaign parameter, then lets the cache on the original URL expire.

The same page now previews correctly in Slack and in the team’s internal tools, because each of them reads the same tags. An agent that saves the link through a preview API gets the same title, description and image, which keeps bookmarks and citations consistent wherever the link appears.

Twitter Cards and other preview formats

Twitter Cards are one of several overlapping ways a page describes itself to other software. Open Graph, created by Facebook, is the most widely read and acts as the baseline. oEmbed works the other way round: instead of the page carrying tags, the consumer asks the provider for embed HTML, which is how a video link becomes a playable player. Schema.org structured data describes the page for search engines in JSON-LD and is rarely used for social cards. The favicon, the canonical link and the page title fill gaps when richer tags are missing.

Link preview services combine all of these. A service fetches the page, reads the Twitter, Open Graph and standard meta tags, follows redirects, resolves relative image URLs and returns one normalised object. That is the job behind link unfurling in chat apps, and the same URL metadata is useful in agent pipelines, where a bookmark or a cited source needs a title, image and description without a full web scraping job. Card tags also suffer from link rot like any metadata: when an image URL dies or a page moves, old posts keep a broken card. Some sites go further and publish tags that misdescribe the page, a problem covered in 10 websites that lie in their Open Graph tags.

Where Exabase fits

Exabase works on the consumer side of card metadata. The Link Preview API takes a URL with GET /v2/link and returns its url, title, description, siteName, a detected type, an image and a favicon (each with a pre-signed URL, width and height) and provider-specific metadata. Pages are rendered with JavaScript before parsing, so tags added by a client-side framework are still found, and where Open Graph tags are missing the API falls back to the page title, meta description and first usable image. It follows redirects and returns the final URL with the canonical URL, has richer integrations for providers including Twitter, YouTube and Vimeo, and caches first fetches for up to 24 hours. The first 20,000 previews each month are free. The link preview guide and the API reference cover the request and the response, and why we built a free link preview API explains the background.

Exabase does not generate Twitter Cards for your site or show how X will render them; that stays with your own templates. Where you need more than a preview, Extract processes a web page into text chunks as part of file extraction, and saving a link as a bookmark in Resources stores its title, description, site name, favicon, a screenshot and a reader-mode copy of the page, all searchable through Deep Search. To compare preview services, see the best link preview APIs, Exabase vs Microlink and Exabase vs OpenGraph.io.

Frequently asked questions

What are Twitter Cards?

Twitter Cards are twitter: meta tags in a page’s HTML head that tell X how to display a shared link as a rich preview with an image, a title and a description.

Are Twitter Cards still used now that Twitter is X?

Yes. X still documents and renders Cards, and the tags still use the twitter: prefix. Slack, Discord and other apps read them too.

What is the difference between Twitter Cards and Open Graph?

Open Graph is Facebook’s preview format and is read by most platforms. Twitter Cards are X’s own tags. X falls back to Open Graph for the title, description and image, so most sites only need to add twitter:card.

Which Twitter Card type should I use?

Use summary_large_image for most articles and landing pages. Use summary for a small square thumbnail, player for inline video or audio, and app for mobile app promotion.

What size should a Twitter Card image be?

For summary_large_image, use a 2:1 image between 300 by 157 and 4096 by 4096 pixels and under 5 MB. 1200 by 600 pixels is a common choice. See og:image for sizing across platforms.

Why is my Twitter Card not showing?

Usually the tags are added by client-side JavaScript, the image URL is relative or blocked, robots.txt blocks Twitterbot, or X has cached an earlier failed fetch of the URL.

Can Exabase read Twitter Card data from a URL?

Yes, for previews. The Exabase Link Preview API returns a page’s title, description, image, favicon and canonical URL, with richer data for Twitter links. It does not show how X itself will render a card.

Related pages: Open Graph, link preview, og:image, meta tags, link unfurling, oEmbed, URL metadata, free Link Preview API, best link preview APIs, Exabase vs Iframely

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.