Skip to content

Instantly share code, notes, and snippets.

@cupofcodeblog
Last active March 9, 2024 16:44
Spotify API - get_artist_id
...
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