Matthew Justin
Matthew Justin

Reputation: 83

Spotify API to find Artist IDs from names?

I'm looking to use the Spotify API/Spotipy to unfollow many, many artists that I no longer want to follow, about 1200 of them.

I've got a list of them by their names, but the Spotify Unfollow Artist API function seems to just work by Artist ID. Is there a function to return IDs by name? I know I can do the reverse: find name using ID.

I've looked in the Spotify and Spotipy docs and it doesn't appear to be doable, but perhaps I'm missing something? Maybe there's a workaround?

Thanks! Matthew

Upvotes: 1

Views: 3140

Answers (1)

RoguePlanetoid
RoguePlanetoid

Reputation: 4576

There's a Search for an Item endpoint which takes a type of artist, you could provide the Artist Name to this API, depending on the name you might get a result back but can check that the result contains the name you want and then get the Id of the Artist from that

Upvotes: 2

Related Questions