title: Python 3 Get and parse JSON API
body: <p>How would I parse a json api response with python?
  I currently have this:</p>
  
  <pre><code>import urllib.request
  import json
  
  url = 'https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty'
  
  def response(url):
      with urllib.request.urlopen(url) as response:
          return response.read()
  
  res = response(url)
  print(json.loads(res))
  </code></pre>
  
  <p>I'm getting this error:
  TypeError: the JSON object must be str, not 'bytes'</p>
  
  <p>What is the pythonic way to deal with json apis?</p>