title: How to count value occurrences in json response using python?
body: <p>I have a json response that looks like below and I would like to count how many times <code>corrId</code> has been mentioned.</p>
  <pre><code>{
    &quot;result&quot;:
      {
        &quot;corrList&quot;:[
          {
            &quot;corrId&quot;:123456,
            &quot;title&quot;:&quot;sample1&quot;,
          },
          {
            &quot;corrId&quot;:45678,
            &quot;title&quot;:&quot;sample2&quot;,
          },
          {
            &quot;corrId&quot;:987654,
            &quot;title&quot;:&quot;sample3&quot;,
          }
        ],
        &quot;find&quot;:true
      }
  }
  </code></pre>
  <p>For the above, I would expect result to be <code>3</code></p>
  <p>I have tried something like above, but it throws an error:</p>
  <pre><code>r = requests.get(url = HOSTNAME + endpoint, headers = headers, verify=False)
  data = json.loads(r.text)
  corrList = len(data['corrList'][0]['corrId'])
  print (corrList)
  </code></pre>
  <p>My error:</p>
  <pre><code>TypeError: object of type 'int' has no len()
  </code></pre>
  <p>Would someone be able to help? thanks in advance!</p>