Skip to content

Instantly share code, notes, and snippets.

@healthiq-treyHolterman
Created August 26, 2019 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save healthiq-treyHolterman/18b7467158ed820f0d4a27ea06349fe9 to your computer and use it in GitHub Desktop.
Save healthiq-treyHolterman/18b7467158ed820f0d4a27ea06349fe9 to your computer and use it in GitHub Desktop.
Starting to use sp client
import spotipy
import spotipy.util as util
if __name__ == '__main__':
username = "<Your Username (or user number) here>"
token = util.prompt_for_user_token(username,scope = 'user-top-read',client_id='<Your client ID>',client_secret='<Your client Secret>',redirect_uri='http://localhost/')
if token:
sp = spotipy.Spotify(auth=token)
myTopArtists = sp.current_user_top_artists(5, 0, 'short_term')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment