Announcements
The Spotify Stars Program: Celebrating Values Week!

Help Wizard

Step 1

NEXT STEP

Empty available markets if item not available in the token's country

Empty available markets if item not available in the token's country

I have an app that uses the track endpoint and I noticed this strange bug
My token is in the United States, for reference.

When testing the track endpoint, I tried a track with the ID of 1gx8hCtGJtMfUz8TR1lGlT, which is a track I know is available in the UK at the very least (because I've had people confirm) but is not available in the US

the available_markets field returned an empty array at the track endpoint

 

It could also be defaulting the the US like your search endpoint does (which, by the way, you really should make the search all regions to avoid the API spam that's already been coded into some wrapper libs due to this policy, but that's been suggested and denied on this forum and not the main topic of this post), but because I don't have a non-US token, I can't test that

I also haven't tested the album endpoint because I haven't bothered to find an album where every single track is unavailable in the US, but it's likely that's broken too

 

All I know is, if a track isn't available in the US, the available_markets field is empty at the track endpoint despite being available in some markets

Please fix this, thank you!

Reply
5 Replies

Hi @AustinTi,

 

Welcome to the forum! Often Spotify has several instances of a track in its catalogue, each available in a different set of markets. It's possible for a track to be unavailable in one market, but linked to a track that is available in another locale. Take a look at our track relinking guide for more information.

Apologies, that isn't quite what I was looking for. I wasn't pointing out the differences of markets for tracks in the catalogue, I was purely pointing out that the available_markets field returns an empty array when the track is unavailable in my token's associated country

 

For example, I tested the exact same track in the track relinking guide you linked me, 6kLCHFM39wkFjOuyPGLGeQ. It's documented to return 

[ "AT", "AU", "BE", "DK", "ES", "FI", "FR", "HU", "IT", "PL", "PT", "SE", "SK", "TR", "TW" ]

But it returns an empty array instead

 

The only restriction I can see on the available_markets property is when a market parameter is supplied in the request, which (and I apologize for not detailing that in my original post) am not doing.

 

I don't see a reason why the available_markets field should ever be blank conditionally like that, hence why I marked this as a possible bug.

I have this problem with the search endpoint

Is there any update on this issue? 

I have been getting empty available_markets on the track endpoint since around October 7th.

 

Thanks for your help

Was this issue ever fixed as I suspect it's related to unusual results I am seeing.

Suggested posts