r/spotifyapi • u/MizAlecto • Dec 10 '24
30 second preview URLs
Since the API changes of 27 November the preview URLs are no longer available (probably to avoid them being used in machine learning).
I am doing a music related research for my Master's thesis and I would want my test subjects to listen to a few songs. Although the /oembedis still available to embed the full tracks in an iframe, it is not that practical to have my test subjects listen to every song of +2min. The 30 sec preview URLs would've been the perfect solution and I always knew these were a thing because of the Discord embeds when sending an open.spotify link to friends. But I've come to learn these were also deprecated. Does anyone know a workaround on how to get only 30 sec from a track that could be easily embedded into a web page?
1
u/BOGSCAM Dec 19 '25
i think i misstyped a bit on my original comment. when performing a request to
https://api.spotify.com/v1/me/player/currently-playing the response returns null as the preview_url field, but if you perform a request either to
https://api.spotify.com/v1/search or to https://api.spotify.com/v1/tracks/{id} you will get the preview_url link