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.
Solved! Go to Solution.
Hello @cdrini, thanks for reporting this bug.
Your issue should be resolved now, we have added CORS support to the "/oembed" endpoint.
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())
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game…
Env: prod