spotify

Spotify Error 401 even though I, supposedly, have access_token (Python)

Spotify Error 401 even though I, supposedly, have access_token (Python) Question: import requests import base64 # Request an access token def request_access_token(): AUTH_URL = ‘https://accounts.spotify.com/api/token’ # POST auth_response = requests.post(AUTH_URL, { ‘grant_type’: ‘client_credentials’, ‘client_id’: "<client ID>", ‘client_secret’: "<client Secret>", }) # convert the response to JSON auth_response_data = auth_response.json() # save the access token print(auth_response_data) …

Total answers: 1

HTTP Request Code 206 Spotify Server Error

HTTP Request Code 206 Spotify Server Error Question: I am trying to get the user authorization code for the authentication flow. When sending the get request with Python and requests I have two dictionaries for headers and params, yet I get the 206 response and server error. I have all the mandatory parameters and header …

Total answers: 1

Spotipy Current Track Data – Getting current track ID

Spotipy Current Track Data – Getting current track ID Question: I don’t see a whole lot of info on current_user_playing_track() for Spotipy so hoping someone will be able to help me on this. import spotipy import spotipy.util as util from spotipy.oauth2 import SpotifyClientCredentials from spotipy.oauth2 import SpotifyOAuth import json import requests cid = ‘my client …

Total answers: 2

How do I extract values from Python groupby for data analysis?

How do I extract values from Python groupby for data analysis? Question: New to python and I am using Spotify’s spotipy package in Python to try and create a "music taste diversity score" for my top spotify artists. I have clustered all the artists songs based on 7 of spotify’s built in features and displayed …

Total answers: 1

Spotipy (sp.track() specifically) takes too long to run

Spotipy (sp.track() specifically) takes too long to run Question: I am trying to extract the release data, explicit flag and popularity score of approximately 18,000 songs. I want to append these results to my data frame Initially, I tried this. – for i,track in enumerate(df[‘uri’]): release_dates.append(sp.track(track)[‘album’][‘release_date’]) But I took too long to run, so I …

Total answers: 1

Spotify api | my python script won't run when my Spotify app is turned off

Spotify api | my python script won't run when my Spotify app is turned off Question: I would like to make a script in python that retrieves what I’m listening to in real time on Spotify and allow me to send the information to an Arduino, But the problem is that my script refuses to …

Total answers: 2

Is there a library for parsing through JSON data using Spotipy?

Is there a library for parsing through JSON data using Spotipy? Question: I’ve been using Spotipy as my first intermediate project, and when I grab data from my account, it gives me a bunch of data in JSON format. It’s possible I’m just doing it all wrong, but from what I see, it’s really difficult …

Total answers: 2

Spotipy – 401 token error "no token proviced" with .search function

Spotipy – 401 token error "no token proviced" with .search function Question: I have a list of dictionaries that contain album information which I’m trying to use to search within Spotify and then add to users’ saved albums. I tried following the examples given in the spotipy documentation, however, I’m getting an issue when using …

Total answers: 1

Using pagination with the Spotify search API

Using pagination with the Spotify search API Question: I’m working on a program that pulls up random songs within a specified genre on Spotify. Each track is denoted by an random ‘offset’ inside the search query, per the Spotify docs here. But I’m unable to put a number higher than 999 in this (like the …

Total answers: 2