title: TypeError: the JSON object must be str, not 'dict'
body: <p>Sorry guys, I couldn't find the satisfying answer to print part of json response. Can someone help me here please:</p>
  
  <pre><code>import json
  import requests
  import pprint 
  
  response = requests.get('&lt;api endpoing&gt;')
  json_data = response.json()
  print(json.dumps(json_data, indent=4, sort_keys=True))
  </code></pre>
  
  <p>Json response would be </p>
  
  <pre><code>{
      "Value1": "SomeValue",
      "data": {
          "subval1": false,
          "subval2": "0a4",
          "subval3": "",
          "subval4": "Click h!",
          "subval5": "1002",
          "subval6": "932",
          "subval7": "i2",
          "subval8": 250,
          "subval9": 0,
          "subval10": 1,
          "subval11": 3,
          "subval12": 1,
          "subval13": "&lt;!&gt;",
          "subval14": "",
          "subval15": "Click !!",
          "subval16": "",
          "subval17": 300
      },
      "error": true,
      "message": "Success",
      "status": 200
  }
  </code></pre>
  
  <p>Now, I would like to traverse and print only the "data": values. I will do the following </p>
  
  <pre><code>data = json.loads(json_data)
  data_set = (data['data'])
  print(data_set)
  </code></pre>
  
  <p>But the error Im getting: TypeError: the JSON object must be str, not 'dict'</p>