Skip to content

Instantly share code, notes, and snippets.

@kittinan
Created August 2, 2018 15:28
Show Gist options
  • Save kittinan/20a82cca210598250450fe720bb39e91 to your computer and use it in GitHub Desktop.
Save kittinan/20a82cca210598250450fe720bb39e91 to your computer and use it in GitHub Desktop.
sample code for spotipy
# https://github.com/plamere/spotipy/issues/194#issuecomment-315458391
# http://spotipy.readthedocs.io/en/latest/#client-credentials-flow
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
client_credentials_manager = SpotifyClientCredentials(client_id='CLIENT_ID', client_secret='CLIENT_SECRET')
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
results = sp.search(q='bodyslam', type='artist', limit=5)
artist = sp.artist('ARTIST_ID')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment