Question

Is there a way to get a list of related artists through the spotify api. Like the small list that displays in the actual program?

Would be very useful if so, but I am not so sure

Cheers

Was it helpful?

Solution

Yes, it's available through libspotify. There's a SPArtistBrowse class that contains a lot of metadata, including the related artists. Check out the

CocoaLibSpotify comes with a documentation package, where you can find more details on what's included: https://github.com/spotify/cocoalibspotify.

Do note that it's currently extremely slow to load an entire SPArtistBrowse object. I'm assuming it's got something to do with libspotify loading it all in one chunk and on the main thread (?). From what I know, Spotify are suppose to remedy that in an upcoming version of libspotify, though.

OTHER TIPS

Get an artist's related artists is now available through the Spotify Web API.

GET https://api.spotify.com/v1/artists/{id}/related-artists is the format.

https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE/related-artists is an example request.

For more information, see the API documentation.

There is also a JSFiddle demo app.

Definitely! All you need is the "artist_id" and the SpotifyPublicAPI can return a list of the related artists. You don't need an access_token at all.

You can easily test the API call here on RapidAPI. I've specifically linked you to the getArtistsRelatedArtists endpoint. Rapid will provide you with a code snippet you can copy and paste directly into your code to make the call.

Here is an example testing the API call using Beyonce's artist_id:

getArtiistsRelatedArtists Beyonce

Here is a sample code snippet provided by RapidAPI wth Beyonce's artist_id passed as a parameter:

BeyonceCodeSnippet

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top