Last active
December 12, 2023 15:02
-
-
Save MartinWeiss12/15b8aac44757b143aef937647d8cdbf1 to your computer and use it in GitHub Desktop.
Get Spotify API Access Token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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