I’m trying to get a single recommended track when passing in a genre to the recommendations() function in the Spotipy library. This is my code: recommendations = sp.recommendations(seed_genres=[‘pop’], limit=1) I get back a dictionary that seemingly has multiple artists, if anyone has tips on how to extract data from a dictionary like this, please let me know as I am
Tag: spotify
Get Spotify access token with spotipy on Django and Python
I’m new to Django and I’m trying to link Spotify to my webapp. I’m using Spotify to do it and it correctly access to Spotify. To do it I have a button that opens the view below views.py If I don’t use auth_token = sp_auth.get_access_token() everything works fine and I got redirected to the correct. Unfortunately, if I add that
Is there a way to get a list of playlists containing a particular song in Spotipy (Spotify Python Api)
I want to create a recommendation system of sorts, and I’m trying to find playlists with a given song in them to see what other songs people listen alongside that. Is there a way to do that using the Spotify API in Python? Answer Nope, there isn’t. You could however use the endpoint https://api.spotify.com/v1/recommendationsto get related songs to a song.
How to Solve: Insufficient client scope in Python using Spotipy
When I try to run cretin modules in Spotipy I get an Insufficient client scope error message. Spotify gives a 403 client error saying “No Token Provided” Tried multiple modules only a few work such as the current_user() module but others spit back the Insufficient client scope error. Tried multiple modules only a few work such as the current_user() module
Spotify authorization code (not access token) is expiring – how can I circumvent this?
I am developing an app that creates a public Spotify playlist for a user who has given proper authorization to do so. I am using Flask and Python requests library to accomplish this, but after I’ve sent a few consecutive POST requests to get an access token from Spotify (using authorization code obtained from previous logic), it begins to fail.