I’m facing an issue with the Spotify Web API regarding track release dates.
Context: from a playlist, I fetch each track and try to get its original release date. The problem is that the Track object does not contain any release_date, so I need to rely on track.album.release_date.
This works fine when the track exists only as a single, because the album type is "single" and album.release_date corresponds to the original release date of the song.
The issue is that if the artist later releases a full album that includes this same track, and the playlist contains the album version of the song, then track.album.release_date gives me the release date of the album, not the original release date of the single.
I checked both the public and private APIs, and it seems that for a single that appears on an album, there is no direct way to get the single release date.
Question: Is there any method/workaround to retrieve the original release date of a track, regardless of which version appears in the playlist?
Thanks!
You can use the ISRC of the track and do a search by ISRC ("isrc:XXXXXXXX"); this will return all the track versions appearing in album/singles/compilations, so you can use the minimum release date as original release date.
See below for an example using the track spotify:track:3M8bJdRfYj1S5iKZIgwAnH.
First you retrieve the ISRC by using the Track attribute:
"external_ids": { "isrc": "QZVM32200343" }
Then you use the ISRC to perform a track search using the query "isrc:QZVM32200343", like below
curl --request GET \
--url 'https://api.spotify.com/v1/search?q=isrc%3AQZVM32200343&type=track' \
--header 'Authorization: Bearer XXXXXX'
This will return a list of Track objects, each associated to an album/single/compilation object and a specific release_date attribute. Pick the minimum date between those and you'll have the original release date.