2
votes

I am working with the Spotify API and I found a strange behavior. Some tracks have tow different IDs even the track is within the same album.

Example: https://api.spotify.com/v1/tracks/0YGzsfUBgNkcfw46TvYbxj https://api.spotify.com/v1/tracks/3B7qxL6lZWWONOXNmEKADY (less information)

Does anybody know why?

1

1 Answers

3
votes

Albums may be released several times, and tracks may be released several times but on different albums (e.g. the original and a Best Of). Even though they're in essence the same album or track, they will always have different Album URIs and Track URIs.

In your example, these two tracks are in a lot of ways the exact same track - but released on different versions of the same album. (The album may have been released in two different years, or by different companies.)

As a side-note, there's a concept of linked tracks in Spotify, that will equate a track that's released on several albums as the same tracks. If you attempt to play a certain track URI but it's not available in your market, Spotify will look for the same track on a different album that's available. The Web API also exposes this functionality, read more about it the Track Relinking Guide.