Glossary
oEmbed
An open format that lets a site request embed code and metadata for a URL from the content provider, turning links into players and posts.
oEmbed is an open format that lets a website turn a plain URL from another site into embedded content, such as a playable video, a song player or a post, by asking the content provider for the embed code. The consumer sends the URL to the provider’s oEmbed endpoint and gets back a small JSON (or XML) document with a type, a title, a thumbnail and, for rich content, a block of HTML to place on the page. YouTube, Vimeo, Spotify, SoundCloud, Flickr and X all publish oEmbed endpoints, which is why pasting their links into a blog editor or chat app can produce a working player instead of a static link preview.
How oEmbed works
The specification, first published in 2008, defines two roles. A provider is a site with content worth embedding. A consumer is any site or app that wants to show that content. The provider runs an endpoint, and the consumer calls it with the URL of a specific item, plus optional maxwidth and maxheight parameters and a format of json or xml.
A request to a video site’s endpoint might pass the URL of one video and ask for JSON no wider than 640 pixels. The response describes the video: its type, title, the author’s name and URL, the provider’s name and URL, a thumbnail with its dimensions, a suggested cache age and, because a video needs a player, an html field containing an iframe sized to fit. The consumer places that HTML on its page, and the reader sees the provider’s own player.
Consumers find endpoints in two ways. The provider can advertise its endpoint in each page’s head with a link element whose type is application/json+oembed, so a consumer that fetches the page can discover it. Or the consumer can use a registry: the oEmbed project maintains a public list of providers and the URL patterns they handle, and most libraries ship with a copy. Discovery through the page is flexible but costs an extra fetch; the registry is faster but needs updating as providers change.
The four oEmbed types
Type | What it represents | Required fields |
|---|---|---|
photo | A static image | url, width, height |
video | Playable video | html, width, height |
rich | Other embeddable HTML, such as a post or audio player | html, width, height |
link | Metadata only, with nothing to embed | none beyond the common fields |
All responses can also carry version, title, author_name, author_url, provider_name, provider_url, cache_age, and thumbnail_url with thumbnail_width and thumbnail_height. In practice, video and rich responses are the ones that matter most, because they are what turns a link into something interactive.
oEmbed compared with Open Graph
Open Graph and oEmbed solve related but different problems. Open Graph tags live inside the page and describe it for any consumer that fetches the HTML: title, description, image, URL. The consumer builds its own card from those fields. oEmbed is an API that the provider controls, and its main purpose is to hand back embed code so the consumer can show the real content rather than a summary of it.
That difference shapes when each is used. Chat apps and social networks mostly want a consistent, safe card, so they read Open Graph and Twitter cards tags and render previews themselves. Publishing tools, content management systems and note-taking apps often want the real thing, a playable video in an article or a song in a document, so they call oEmbed. Many consumers do both: they try oEmbed for known providers and fall back to Open Graph for everything else. Both are part of the broader picture of URL metadata.
Where oEmbed is used
Content management systems are the largest consumers. WordPress uses oEmbed to turn a pasted YouTube or Vimeo URL into an embedded player, and it also acts as a provider, so WordPress sites can be embedded in other WordPress sites. Many note-taking and documentation tools do the same for videos, audio, maps and code snippets. Newsletter tools use oEmbed thumbnails to show video links as images, since email clients cannot run players.
On the provider side, video and audio platforms have the strongest reason to support it, because embeds bring them views and listens. Social platforms support it for posts, sometimes with conditions: Meta, for example, requires an access token for its oEmbed endpoints for Facebook and Instagram content. Providers can also restrict which domains may embed their content, or return different HTML depending on the requested size.
Security and performance considerations
The html field in a video or rich response is code from a third party that will run on your page. That is the main risk with oEmbed. Sensible consumers only accept HTML from an allowlist of trusted providers, render it inside sandboxed iframes, and set a content security policy that limits what embedded content can do. Photo and link responses are safer, because they contain only URLs and text, but those URLs still need the usual checks.
The second risk is the fetch itself. A consumer that discovers endpoints by fetching arbitrary pages faces the same server-side request forgery concerns as any link preview service, and needs to block internal addresses and validate redirects. Rate limits matter too: providers throttle heavy callers, so consumers should cache responses, honour cache_age where given, and back off on errors.
Performance is a separate concern. Each embedded player loads scripts, fonts and media from the provider, and a page with many embeds can become slow. A common pattern is to show the oEmbed thumbnail and title first, then load the real player only when the reader clicks, a facade that keeps pages light while preserving the embed.
Building an oEmbed consumer
A minimal consumer needs a provider registry, a function that matches URLs against provider patterns, a fetcher with timeouts, and a renderer that inserts the html safely or builds a card from photo and link responses. Discovery through the page’s link element adds coverage for providers you have not registered, at the cost of an extra fetch.
The harder work sits around that core. Responses need caching keyed on the normalised URL and requested size. Providers change endpoints and URL patterns, so the registry needs updating. Some providers return HTML that assumes their own scripts are loaded, others return fixed sizes that ignore maxwidth, and a few return errors for content that is private or region-restricted. When oEmbed fails, a good consumer falls back to an Open Graph card built from the page’s meta tags, so the reader still sees something useful. The overall process, from detecting a URL to showing a card or player, is described in link unfurling.
oEmbed and AI applications
For AI products, oEmbed responses are useful mostly as metadata. A title, author, provider and thumbnail give an agent a clear picture of a media link without downloading the media, and the provider name and author make citations easier to present. When an assistant saves a video or a podcast episode for a user, storing that metadata alongside the link makes the library searchable by title and creator immediately.
The embed HTML is less useful to a model, but valuable in the interface. An assistant that answers a question with a link to a specific talk or song can show the player inline, so the user can check the source without leaving the conversation. For search across what is said or shown inside the media itself, the content has to be transcribed and analysed, which is the territory of video search and audio search rather than oEmbed.
A worked example
A team runs an internal knowledge tool where staff share links to conference talks, product demos and podcast episodes. At first every link appears as a bare URL. Adding oEmbed for the main video and audio providers lets the tool show players inline, with titles and speakers drawn from the response, while an Open Graph fallback covers blogs and documentation. A later step stores the videos and episodes themselves so they can be searched by what was said. The pattern is typical: oEmbed handles presentation, Open Graph handles everything else, and transcription handles content.
oEmbed and Exabase
Exabase does not publish an oEmbed provider endpoint. The Exabase Link Preview API covers the consumer side for previews: GET /v2/link?url= returns a URL, title, description, site name, a detected type such as link or spotify, an image and favicon with pre-signed URLs and dimensions, and provider-specific metadata. For Spotify links, that metadata includes the track, artist, audio stream URL and embed player URL, described in the SpotifyMetadata model. The API adds richer data for YouTube, Amazon, Twitter, Airbnb, Vimeo, SoundCloud, Giphy and major news sites, renders pages with JavaScript, and falls back to the page title, meta description and first usable image when tags are missing. Details are in the link preview guide and the API reference, and the free tier covers 20,000 previews a month.
When you need the media itself to be searchable, upload it to Resources: audio and video files are transcribed and indexed, video is split into scenes and visually analysed, and Deep Search returns timestamped matches. Exabase Extract returns the same detail as structured JSON. The asset search solution and the podcast audio search use case show that pattern, and our post on making a podcast archive searchable covers what it takes in practice.
For embed and preview services, see the best link preview APIs roundup, Exabase vs Iframely, Exabase vs Embedly and Embedly alternatives.
Frequently asked questions
What is oEmbed used for?
oEmbed lets a site turn a link to another site’s content, such as a video or song, into an embedded player by requesting the embed code from the provider.
What is the difference between oEmbed and Open Graph?
Open Graph tags describe a page so consumers can build a preview card. oEmbed is a provider API that returns embed HTML so consumers can show the content itself.
Which sites support oEmbed?
Many media and social platforms, including YouTube, Vimeo, Spotify, SoundCloud, Flickr and X. The oEmbed project keeps a public registry of providers.
Is oEmbed safe to use?
It can be, with care. Rich and video responses contain third-party HTML, so accept it only from trusted providers, sandbox it in iframes and use a content security policy.
How do I find a site’s oEmbed endpoint?
Check the provider registry, or fetch the page and look for a link element with type application/json+oembed in the head.
Does oEmbed require an API key?
Usually not, but some providers require one. Meta, for example, requires an access token for its Facebook and Instagram oEmbed endpoints.
Does Exabase support oEmbed?
Exabase does not offer an oEmbed endpoint. Its Link Preview API returns preview data and provider-specific metadata, including Spotify embed player URLs.
Related pages: Open Graph, link preview, link unfurling, Twitter cards, og:image, URL metadata, Link Preview API, Iframely alternatives, Microlink vs Iframely, video search use case