/spotify_api_calls.py Secret
Last active
March 9, 2024 16:44
Spotify API - get_artist_id
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
... | |
from requests import post, get | |
... | |
def get_artist_id(token, artist_name): | |
url = f"https://api.spotify.com/v1/search?q={artist_name}&type=artist" | |
headers = {"Authorization": "Bearer " + token} | |
result = get(url, headers=headers) | |
json_result = json.loads(result.content) | |
print(json_result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment