SebG.
SebG.

Reputation: 23

Spotify - How to create a playlist including certain albums from an artist

The objective: I Really love discovering music so I am trying to create a playlist to discover more songs from artists a user already likes (because you know, sometimes we just add a song or two from an artist and don´t take the time to explore the rest of his/her work).

The project: copying my Spotify songs in a simple Excel doc. I am able to determine the following:

  1. Name of the artists from which I only have 1 song
  2. Name of the artists from which I have between 2 and 4 songs
  3. Name of the artists from which I have 5 or more songs

Now, based on these results/inputs I would like to create the following playlists:

  1. "If I only have 1 song from an artist = Create a playlist with his TOP10"
  2. "If I have between 2 and 4 songs from an artist = Create a playlist with his TOP10 and all albums these songs are from"
  3. "If I have 5 or more songs from an artist = Create a playlist with all songs from this artist"

Is there a way to do so?

Thanks!

Upvotes: 2

Views: 261

Answers (2)

SamHecquet
SamHecquet

Reputation: 1836

For your number 2, "If I have between 2 and 4 songs from an artist = Create a playlist with his TOP10 and all albums these songs are from", you'll have to do many API calls but it's pretty easy to do :

Once you have your artist id (you'll find it with this endpoint "GET https://api.spotify.com/v1/search?q={artist_name}&type=artist")

You can ask for its top ten tracks with the endpoint "GET https://api.spotify.com/v1/artists/{id}/top-tracks"

Now you have your tracks object, you can get their album id, and get Album's Tracks using this endpoint "GET https://api.spotify.com/v1/albums/{id}/tracks"

I hope it'll help you!

Upvotes: 0

Erasyn
Erasyn

Reputation: 88

I'm not entirely sure if you're tied to excel, but based on this question I don't know how much research you have personally done.

To start with I would direct you to Spotify's API.

As far as implementation goes, you might want to look at using a scope to read a user's music, I would use the user-library-read one.

You could then proceed to examine the library as you've detailed above and add or replace its tracks.

Spotify's API should have any further information you need if you want to implement this.

Upvotes: 0

Related Questions