Preview URL is not always provided
gdelataillade opened this issue · 2 comments
When I use the search
method for tracks, I always have a previewUrl.
But when I use the tracks
method with the trackId, for some specific tracks, preview url is null.
For example for this track:
Name: Get Back - Remastered 2009
Artist: The Beatles
ID: 4MLBqAEzNN89o2M9h92Z26
PreviewUrl: https://p.scdn.co/mp3-preview/2358f46f93a97c3a0824ff342a4befbf515c2564?cid=30646375fdb84441acccb3c1097a9af3
For some reason Spotify is not returning the preview_url for every Track. In their docu they also describe it as "Can be null".
My workaround: If there is no preview_url given in the Track response use the search API and search by the isrc ID.
Seems quite reliable so far.
OK, thank you for the answer. I've been using the same workaround ever since.
Since it's a Spotify API issue, I'll close this issue.