Music & audiosoundcloud.com

Can you embed SoundCloud in an iframe?

Yes, with the w.soundcloud.com player URL. SoundCloud documents this widget for embeds, not the normal track page.

Checked Test again

Live check

Two links, two results

Result of
Track pagePartial
soundcloud.com/forss/flickermood
X-Frame-Options
SAMEORIGIN
CSP frame-ancestors
Not sent
Response
200 OK · 414 ms · HTTPS
Widget URLEmbeddable
w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/293
X-Frame-Options
Not sent
CSP frame-ancestors
Not sent
Response
200 OK · 481 ms · HTTPS

Steps

How to embed SoundCloud

  1. Open the track or playlist on SoundCloud.
  2. Under the waveform, clickSharethenEmbed
  3. Select a player and set its options.
  4. Copy the embed code from Code & preview.
  5. Paste the code into the HTML editor of your site.

The owner must allow embeds.

If the Embed option is missing, turn on "Display embed code" in the track Permissions tab.

Embed code

Paste this into your page

HTML
<iframe
  width="100%"
  height="400"
  scrolling="no"
  frameborder="no"
  allow="autoplay; encrypted-media"
  src="https://w.soundcloud.com/player/?visual=true&url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F{track-id}&show_artwork=true"
  title="{track title}">
</iframe>

The url parameter takes the API URL of a track or playlist. Add widget parameters after it with &.

URL patterns

Swap the link you have for the embed URL

  • You havesoundcloud.com/{user}/{track}Use in the iframew.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/{track-id}

The widget needs the numeric track ID, not the track name. Copy it from the embed code.

Good to know

  • Widget options include auto_play, color, show_artwork, show_user, show_playcount, sharing, buying and download.
  • The SoundCloud Widget API can control a player on your page.

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.