title: Using Genius API
body: <p>The docs are <a href="https://docs.genius.com/" rel="nofollow noreferrer">here</a></p>
  
  <p>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.</p>
  
  <p>&nbsp;</p>
  
  <p>What I'm trying to do is:  </p>
  
  <pre><code>-get artist id  
  -get all the songs by an artist   
  -get the lyrics to a song
  </code></pre>
  
  <p>&nbsp;</p>
  
  <p>I don't really have any code right now because I can't figure out how to call the api besides like </p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Any guidance would be appreciated. Thanks.</p>
  
  <p>&nbsp;</p>
  
  <hr/>
  
  <p>&nbsp;</p>
  
  <p><strong>edit:</strong></p>
  
  <p>I have this working right now - input artist name and a song and it will return <a href="https://pastebin.com/iKtexJ4a" rel="nofollow noreferrer">data</a>. Now how would I go through that data - like how would I get the 'full_title', 'id', or the lyrics?</p>
  
  <pre><code>#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)
  </code></pre>