title: Searching json for a specific value
body: <p>I'm attempting use Python 3 to search through json for specific variables. The results usually look something like this.</p>
  
  <pre><code>[
    {
      "string": "00002000",
      "existedPrior": true
    },
    {
      "string": "00002001",
      "existedPrior": false
    },
    {
      "string": "00002002",
      "existedPrior": true
    },
    {
      "string": "00002003",
      "existedPrior": true
    },
    {
      "string": "00002004",
      "existedPrior": false
    }
  ]
  </code></pre>
  
  <p>The goal of this script would be to search these values for where "existedPrior" is false, then take the string from that value and insert it into an array. I could then later take the values of the array and re-query them against another endpoint for more data.</p>
  
  <p>From what I've gathered, this is kind of close to what I'm hoping to do, but isn't actually getting me there.</p>
  
  <pre><code>import json
  import requests
  
  q = 'https://website.com/api/var'
  r = requests.get(url=q)
  
  strings = []
  
  data = r.json()
  i = 0
  
  for item in data:
      if item['existedPrior'] == 'false':
          i += 1
          strings.append(item['string'])
          print(item['string'])
      else:
          break
  
  print("New additions: ", i)
  </code></pre>
  
  <p>It's my understanding that json and python don't share the same "definition" of boolean, and this causes trouble. I read elsewhere on stackoverflow on how to handle this, but it involved json.dumps and json.loads and all sorts of messy bits that I wasn't 100% sure were needed. </p>
  
  <p>As an aside, would it be better to just convert the json into a python dictionary and search from there?</p>