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
2
votes
1 answer
Is there a way to retrieve more than 50 recently played tracks using spotipy?
I've been playing around with spotipy and the spotify API and I wanted to create a dashboard where I present some metrics about my main playlist and my recently played songs. As it happens, in most functions, there's an imposed limit of 50 results.…

Hugo Torres
- 308
- 4
- 13
2
votes
1 answer
Spotify API: Restricting recommendations to specific artists?
I'm working on an app using the Spotipy library and would like to use the Spotify recommendations call to get recommended songs by only a specific artist. I know there are tuneable attributes for more specific characteristics but is there a…

abdch
- 23
- 4
2
votes
1 answer
Getting a 404 error at random times when trying run a search endpoint on Spotify's API using Spotipy?
Just for simplicity, say I want to search Beyonce 1000 times
artist_name_list = []
for i in np.arange (0, 1000, 1):
searchResults = sp.search("beyonce",1,0,"artist")
artist = searchResults['artists']['items'][0]
artist_name = artist['name']
…

stuckonspotipy
- 21
- 1
2
votes
3 answers
How to speed up Spotipy API calls for millions of records?
I'm attempting to get the audio feature data for about 4.5 years worth of Spotify Top 200 Charts. It's for 68 countries + global ranking, so about 20 million records in all. I'm querying a SQL Lite database with all of that data.
This is prep for a…

robotpsychology
- 53
- 7
2
votes
0 answers
Spotify API user authentication
I am trying to make a spotify web app using Spotipy and Spotify's API, the barebone of the program uses the core of this program: https://github.com/plamere/spotipy/blob/master/examples/app.py such as the login and authentication page. I've added…

Ben Martinez
- 21
- 1
2
votes
2 answers
Google Colab - Spotipy not redirecting me to the specified redirect_uri
I want to experiment with the Spotify API using the Spotipy python package.
So to start, in my Spotify Developer app,
I have set the redirect_uri to https://example.com/callback/
This is the code I am trying to run on a Google Colab notebook
import…

Shrawan Sapre
- 70
- 6
2
votes
1 answer
How to get Track Duration for Spotify using Spotipy
I've been playing around with Spotify API in Python (Spotipy) and I don't know how to get the duration of the track I'm currently playing on Spotify.
I'm assuming it would look something like this:
global spotifyObject
trackInfo =…

Kelvin Jou
- 271
- 2
- 12
2
votes
2 answers
How do I make my discord bot print an entire playlist at once?
Building a discord bot using discord.py and I integrated the Spotify API to print the list of songs featured in a playlist.
The code I have right now prints each song 1 sentence at a time (so 50 in total) which is pretty inefficient and means a lot…

Man1mega
- 21
- 2
2
votes
0 answers
How do I authenticate Spotipy with a Flask webserver?
I'm trying to make a dashboard that controls Spotify playback with Flask. I've been trying to use Spotipy to achieve this, but I am confused on how to authenticate a user token through a Flask server.
This is my code currently:
from flask import…

WoaItsBren
- 97
- 1
- 1
- 8
2
votes
1 answer
How do I use oAuth with spotipy on headless device?
I want to create a simple app that tracks how many minutes I listen to music on Spotify every day. To my knowledge, I need to use oAuth to receive this data (user-read-currently-playing). I am currently authenticating like this:
token =…

PhiJoTo
- 205
- 1
- 2
- 7
2
votes
0 answers
Airflow cannot open .cache file
I am trying to automate the flow of calling Spotify. I am nearly there but I am held up at one point.
I am using Airflow (ETL tool) to run my python scripts.
I am able to connect using the spotipy module but it cannot read/access the…

David Whiteside
- 71
- 6
2
votes
2 answers
How to find out if a playlist has a playlist image cover in Spotipy?
As title says, im trying to see how if a playlist has a playlist image cover so that it doesn't try to load one that doesnt exist.
Here is my method:
currentPlaylist = spotifyObject.user_playlist(username, playlistManageURI)
if…

marceloexc
- 21
- 3
2
votes
1 answer
User authentication for Spotify in Python using Spotipy on AWS
I am currently building a web-app that requires a Spotify user to login using their credentials in order to access their playlists
I'm using the Spotipy python wrapper for Spotify's Web API and generating an access token using,
token =…

Vignesh R
- 53
- 11
2
votes
1 answer
Spotipy - how do I get songs from a playlist starting at a given index?
I've read about the offset parameter in the documentation; however, I can't figure out how to use it. Here's my code so far. Unfortunately only the first 100 songs are retrieved from the playlist. How do I change the index so that I can retrieve…

Peter Schorn
- 916
- 3
- 10
- 20
2
votes
1 answer
How do I use this list as a parameter for this function?
I'm new to Python and I'm using it to write a Spotify app with Spotipy. Basically, I have a dictionary of tracks called topTracks. I can access a track and its name/ID and stuff…

yhtrjdtryh
- 73
- 4