Skip to content

Instantly share code, notes, and snippets.

@MartinWeiss12
Last active December 12, 2023 15:02
Show Gist options
  • Save MartinWeiss12/15b8aac44757b143aef937647d8cdbf1 to your computer and use it in GitHub Desktop.
Save MartinWeiss12/15b8aac44757b143aef937647d8cdbf1 to your computer and use it in GitHub Desktop.
Get Spotify API Access Token
# your client id
client_id = ''
# your client secret
client_secret = ''
token_url = 'https://accounts.spotify.com/api/token'
token_data = {'grant_type': 'client_credentials'}
token_response = requests.post(token_url, auth=(client_id, client_secret), data=token_data)
access_token = token_response.json()['access_token']
headers = {'Authorization': f'Bearer {access_token}'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment