Using the oEmbed API

Overview

oEmbed is an API that allows third-party websites and apps to fetch and display basic information about a Spotify URL and Embeds. It commonly powers link previews, or link 'unfurling' functionality on websites with messaging and user-created posts.

Discovering oEmbed URIs

Most pages on open.spotify.com, or the short link version (https://spotify.link), support oEmbed. If your application parses a Spotify web page then it can discover the corresponding oEmbed URI by searching the document for a <link> element with the type set to application/json+oembed. For example, the source of the NerdOut@Spotify podcast includes this HTML:


_10
<link rel="alternate" type="application/json+oembed" href="/?originalUrl=https%3A%2F%2Fdeveloper.spotify.com%2F%26quot%3Bhttps%3A%2F%2Fopen.spotify.com%2Foembed%3Furl%3Dhttps%253A%252F%252Fopen.spotify.com%252Fshow%252F5eXZwvvxt3K2dxha3BSaAe%26quot%3B%2520%2F%26gt%3B%253C%2Fspan">

Using oEmbed data from Spotify in your app

The oEmbed response is a JSON object that contains the title of the entity, an Embed code snippet, and (if available) a thumbnail image associated with the entity. You can find a sample oEmbed response below, or learn more about the oEmbed response properties through the oEmbed API reference documentation.


_13
{
_13
"html": "<iframe width=\"100%\" height=\"152\" title=\"Spotify Embed: My Path to Spotify: Women in Engineering \" style=\"border-radius: 12px\" frameborder=\"0\" allowfullscreen allow=\"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture\" src="/?originalUrl=https%3A%2F%2Fdeveloper.spotify.com%2F%26quot%3Bhttps%3A%2F%2Fopen.spotify.com%2Fembed%2Fepisode%2F7makk4oTQel546B0PZlDM5%3Futm_source%3Doembed%5C%26quot%3B%26gt%3B%26lt%3B%2Fiframe%26gt%3B%5Cn%26quot%3B%2C%253C%2Fspan">
_13
"width": 456,
_13
"height": 152,
_13
"version": "1.0",
_13
"provider_name": "Spotify",
_13
"provider_url": "https://spotify.com",
_13
"type": "rich",
_13
"title": "My Path to Spotify: Women in Engineering",
_13
"thumbnail_url": "https://i.scdn.co/image/ab67656300005f1ff8141e891abf749375772343",
_13
"thumbnail_width": 300,
_13
"thumbnail_height": 300
_13
}

Use cases

Common use cases for oEmbed include:

  • Displaying the title of a Spotify link in an app or website
  • Displaying the title and preview image of a Spotify link in an app or website
  • Displaying an Embed in your app or website