Wednesday 1 January 2020

Is there any way to get an artist's user id with the Spotify API?



One of the cool things about Spotify is the ability to view playlists created by both users and artists.



You can get a list of playlists for any user with:
https://api.spotify.com/v1/users/{user_id}/playlists




This will work if you plug in an artist's user id as well.
Example: https://api.spotify.com/v1/users/officialfoofighters/playlists returns playlists created by Foo Fighters (the actual band).



The problem is that I see no way to programmatically get an artist's user id. The actual artist id is different and will not work. I managed to manually get Foo Fighter's user id in a hacky way using the Spotify desktop client, but I would like to find a programmatic solution.



Anyone know of any workarounds?


Answer



I'm happy that you're asking for this, because it's a feature that we've been wanting to add to the Web API for a while. So even though the answer to this question is that it isn't possible to find an artist's username using the Web API (and the other way around) right now, I'd urge you to keep up to date on changes in the API through @SpotifyPlatform or our Change Log.


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...