The docs are here
I'm new to using api's and I've been trying to figure out how to use this with no luck. I have the client id, secret id, and access token already.
What I'm trying to do is:
-get artist id
-get all the songs by an artist
-get the lyrics to a song
I don't really have any code right now because I can't figure out how to call the api besides like
import requests
genius_client_id = ''
genius_secret_id = ''
genius_client_access_token = ''
base_url = 'https://api.genius.com/'
r = requests.get(*insert api call here*)
print(r)
Any guidance would be appreciated. Thanks.
edit:
I have this working right now - input artist name and a song and it will return data. Now how would I go through that data - like how would I get the 'full_title', 'id', or the lyrics?
#search for song
import requests
client_access_token = ''
base_url = 'https://api.genius.com'
user_input = input('artist and song: ').replace(" ", "-")
path = 'search/'
request_uri = '/'.join([base_url, path])
print(request_uri + user_input)
params = {'q': user_input}
token = 'Bearer {}'.format(client_access_token)
headers = {'Authorization': token}
r = requests.get(request_uri, params=params, headers=headers)
print(r.text)