title: Navigating JSON Tree in Python
body: <p>Simple python student, simple python question. While (attempting to) navigate a JSON request with Python, I realized I was completely unaware of how to navigate multiple parents. <strong>My goal is to call get_part, which first grabs data from an API in JSON format, and then separates the value <em>GHI</em> as a string from it.</strong></p>
  <p>My current (simplified) code is:</p>
  <pre><code>def get_part():
    response = requests.get(&quot;APIUrlHere.com&quot;)
    json_data = json.loads(response.text)
    output = str(json_data[&quot;groupOne&quot;][2][&quot;value&quot;])
  </code></pre>
  <p>The API is in the format:</p>
  <pre><code>{
    &quot;status&quot;: {
      &quot;status&quot;: &quot;Running&quot;,
    },
    &quot;groupOne&quot;: {
      &quot;one&quot;: {
        &quot;value&quot;: &quot;ABC&quot;,
      },
      &quot;two&quot;: {
        &quot;value&quot;: &quot;DEF&quot;,
      },
      &quot;thr&quot;: {
        &quot;value&quot;: &quot;GHI&quot;,
      }
    }
  }
  </code></pre>
  <p>Attempting to run this code as is gives me an error message &quot;KeyError: 0&quot;. What exactly am I doing wrong?</p>