Using the Spotify API, I have created the funtion recommend_songs() that allows a user to get song recommendations based on other artists and songs they enjoy.
- Input for the artist argument should be in list format. Ex: ['Justin Bieber, 'Drake', 'Beyonce'...]
- Input for the songs arguments should be a dictionary of tracks and the track artists. Ex: {'thank u, next':'Ariana Grande', 'Watermelon Sugar':'Harry Styles'...}
- The desired number of recommended songs in increments of 20 can be specified with the num_songs argument. The default is 20 songs.
- The number of artist inputs + the number of song inputs can not exceed 5.
Once the user is satisfied with their recommended tracks, they can use the function create_playlist() which takes the dataframe of recommended songs as input and creates a Spotify playlist - All done within Python.
- The funtion requires a user ID which can be found on your Spotify profile page. Select the three dots that appear below your profile picture, select 'Share' and then 'Copy Spotify URI'.
- The arguments 'playlist_name' and 'df' must also be specified.
See the notebook Song_Recommendation_Function for full documentation.