Spotipy is a lightweight Python library for the Spotify Web API. With Spotipy you get full access to all of the music data provided by the Spotify platform.
Questions tagged [spotipy]
474 questions
15
votes
6 answers
Spotipy: How to read more than 100 tracks from a playlist
I'm trying to pull all tracks in a certain playlist using the Spotipy library for python.
The user_playlist_tracks function is limited to 100 tracks, regardless of the parameter limit. The Spotipy documentation describes it as:…

gestalt
- 153
- 1
- 2
- 7
11
votes
2 answers
Spotipy Refreshing a token with authorization code flow
I have a long-running script using spotipy. After an hour (per the Spotify API), my access token expires. I am catching this successfully, but I don't know where to go from there in regards to actually refreshing the token. I am using the…

gos
- 474
- 4
- 18
8
votes
1 answer
Setting Spotify credentials using Spotipy
I am trying out spotipy with python 2.7.10 preinstalled on my mac 10.10, specifically [add_a_saved_track.py][1] Here is the code as copied from github:
# Add tracks to 'Your Collection' of saved tracks
import pprint
import sys
import…

Steve
- 413
- 2
- 5
- 17
8
votes
4 answers
spotipy authorization code flow
I am using the Spotipy python library to interact with the Spotify web api. I have worked through the API and docs but I do not see a clear example that shows how the library supports the Authorization code flow (…

user4016779
- 81
- 1
- 1
- 4
5
votes
1 answer
Extract artist genre and song release date using spotipy
I am currently doing research into extracting specific items from a song in Spotify. I wanted to grab the specific release date and genres from an artist. I am pulling information from a pandas datagrams that looks like this:.
I've tried to do most…

KD Fer
- 91
- 1
- 4
5
votes
1 answer
Storing Spotify token in flask session using spotipy?
I may have a bad understanding of how the flask session works, but I am trying to generate a Spotify API access token using SpotiPY with the Authorization Code Flow, and store it in Flask's session storage.
The program doesn't seem to be able to…

Sam Tubb
- 945
- 3
- 19
- 40
5
votes
1 answer
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…

Cesser Jackson
- 53
- 1
- 1
- 3
5
votes
1 answer
Using multiple scopes with spotipy
I'm trying to use the Spotipy library to pull user tracks and make a playlist. Each function works individually (getTracks, makePlaylist); however, they require different scopes.
def generate_token(scope):
token = util.prompt_for_user_token(
…

Sophie
- 63
- 1
- 5
5
votes
3 answers
Refresh token spotipy
I am using spotipy to retrieve some tracks from Spotify using python. I get a token expiration error thus, I want to refresh my token. But I don't understand how to get the refresh token from spotipy.
Is there another way to refresh the token or…

mina
- 319
- 2
- 8
5
votes
1 answer
What do I do with a spotify api authentication redirect uri in Django?
I've built an app in Django that uses Spotipy, a Spotify API Python Library, and uses the spotipy.util.prompt_for_user_token() command as such to generate a token and access my private library as such:
import spotipy
import spotipy.util as…

Ryan Finley
- 51
- 1
- 3
4
votes
1 answer
Multiple scopes - WebAPI Spotify (Spotipy)
My question is:
is possible using two or more scopes in the same time with WebAPI Spotify (in particular Spotipy)?
For example to use the scopes 'user-modify-playback-state' and 'user-library-read'
Thanks

Alessandro Minervini
- 113
- 2
- 9
4
votes
1 answer
Spotipy: How do I search by both artist and song
Given a song title and an artist name, I am trying to find the correct song using Spotipy. However, I do not see a way to search by both song title and artist: it's either one or the other:
sp.search(q="Money", type="track", limit=10)
…

Timothy Elbert
- 137
- 1
- 3
- 13
4
votes
1 answer
Spotipy - get track ids from track names
Usually, spotipy requires track IDs as parameters to be passed, in order to return track names.
Say I have two lists, not obtained from the Spotify API:
artists
[u'Moses Sumney', u'Cherry Glazerr', u'Danny Brown', u'NxWorries']
and their…

8-Bit Borges
- 9,643
- 29
- 101
- 198
4
votes
1 answer
Spotipy - list index out of range
Writing a Spotipy script to return album tracks from a given album I'm occasionally getting the error:
album_id = results["albums"]["items"][0]["uri"]
IndexError: list index out of range
The error tends to happen for more popular artists…

Ghoul Fool
- 6,249
- 10
- 67
- 125
4
votes
1 answer
Spotipy trying to verify with oauth
I've been trying to verify with spotipy to make playlists, etc.
import spotipy
import spotipy.util as util
class buildPlayList():
def __init__(self,name):
scope = 'playlist-modify-public'
self.username=name
token =…

Eigenvalue
- 1,093
- 1
- 14
- 35