Announcements

Help Wizard

Step 1

NEXT STEP

get-artist-albums: market parameter

get-artist-albums: market parameter

Hi, i was looking a little into the api, especifically to the endpoint

https://api.spotify.com/v1/artists/{id}/albums

 

In this example 

https://developer.spotify.com/console/get-artist-albums/?id=02kJSzxNuaWGqwubyUba0Z&include_groups=si...

 

If I don't use the market parameter it returns what looks to be the same album twice (She's Fire by G-Easy). On closer inspection I see that the available_markets are diferent, one album having only "IN" and the other one having all other markets.

 

But if I use the market param on the call the result is the same. The only difference is that the field available_markets  doesn't come on the object.

 

Shouldn't the result be different if I use this param? For example if I use "IN" on the previous example it should return the song that only had "IN" as available market and if I use any other market it should return the other one.

 

Is this the intended use of this param?

Reply
4 Replies

Got the same issue. Even worse thing is that the albums I get when passing "market" parameter are not actually available in given region so any playback fails.

Like you said, passing "market" parameter causes the albums to have empty "available_markets" value

The documentation states this:

 


An ISO 3166-1 alpha-2 country code. If a country code is specified, only content that is available in that market will be returned. If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.

So, if you pass an access token, it will use the country associated with that user, which will override this parameter.

 

However, if you try to run this without an access token, it says "No token provided". So if it's not possible to run this without an access token, I don't see how it can ever use this parameter.

rsouthward,

You have to use Client Credentials if you don't want to use authorization with this endpoint. Or do you already use it?

Thanks @Ximzend, I didn't realise you could make 'anonymous' calls with the Client Credentials, this now makes sense, although there still seems to be some inconsistency with the markets parameter. I'd have thought that using the `Client Credentials` would list the valid markets for the song, but it seems to return an empty array, which doesn't really let me see which markets the song/album applies to.

Suggested posts