Music & audiomusic.apple.com

Can you embed Apple Music in an iframe?

Yes, with the embed.music.apple.com player. Apple documents this embed code for songs, albums and playlists, not the music.apple.com page.

Checked Test again

Live check

Two links, two results

Result of
Playlist pageBlocked
music.apple.com/us/playlist/todays-hits/pl.f4d106fed2bd41149aaacabb233eb5eb
X-Frame-Options
DENY (ignored)
CSP frame-ancestors
'none'
Response
200 OK · 397 ms · HTTPS
Embed playerEmbeddable
embed.music.apple.com/us/playlist/todays-hits/pl.f4d106fed2bd41149aaacabb233eb5eb
X-Frame-Options
Not sent
CSP frame-ancestors
Not sent
Response
200 OK · 699 ms · HTTPS

Steps

How to embed Apple Music

  1. Go to music.apple.com and open the song, album or playlist.
  2. ClickMore (…)thenCopy Embed Code
  3. Paste the HTML code into your page.
  4. To set the height and width first, use Apple Music Marketing Tools. Set the size under Preview Player, then click Copy Embed.

Embed code

Paste this into your page

HTML
<iframe
  src="https://embed.music.apple.com/{country}/{type}/{name}/{id}"
  height="450"
  width="100%"
  allow="autoplay *; encrypted-media *"
  title="Media player">
</iframe>

Copy Embed Code gives the exact code. Use that code. Apple's Marketing Tools set the height and width.

URL patterns

Swap the link you have for the embed URL

  • You havemusic.apple.com/{country}/album/{name}/{id}Use in the iframeembed.music.apple.com/{country}/album/{name}/{id}
  • You havemusic.apple.com/{country}/playlist/{name}/{id}Use in the iframeembed.music.apple.com/{country}/playlist/{name}/{id}

The {country} part is the storefront, such as us.

Good to know

  • Listeners who are not signed in can play a 30-second clip of a song.
  • For an album or playlist, listeners who are not signed in see a preview with the full song list.
  • Listeners who sign in to Apple Music can hear full tracks in the embed.
  • Listeners can open Apple Music from the player to sign in or start a free trial.

Sources

Profile updated

Know before you embed.

Free, no sign-up, nothing stored. Paste a URL and get a verdict, a live preview, and the fix.