OEmbed API missing CORS headers

It's not possible to hit the oembed endpoint from client-side JS. Try running this in your browser console on any non-Spotify domain:

 

 

await fetch('https://open.spotify.com/oembed?url=https://open.spotify.com/track/6fHxL22apYBSywdSSZlp6h').then(r => r.json())

 

 

You will get a CORS error. For reference, YouTube, SoundCloud, Vimeo have CORS-enabled oembed endpoints.

Child Item
Child Item
Child Item

Accepted answers

Hello @cdrini, thanks for reporting this bug.

Your issue should be resolved now, we have added CORS support to the "/oembed" endpoint.

All comments

Hello @cdrini, thanks for reporting this bug.

Your issue should be resolved now, we have added CORS support to the "/oembed" endpoint.

Hi, 

it still doesn't work for playlists. The following example gives the same error.

await fetch('https://embed.spotify.com/oembed?url=https://open.spotify.com/playlist/5uHTCYBvcpQfP234BQwzqT').then(r => r.json())

 

Awesome! Thank you for the fix, dev team 🙂
Child Item
Child Item