title: Parsing Through Nested JSON Python
body: <pre><code>data = response.json()
  sortJson = json.dumps(data, sort_keys=True,
                  indent=2, separators=(',', ':'))
  
  result = json.loads (data)
  print ('"saleTotal":', result['trips']['tripOption']['pricing']['saleTotal'])
  </code></pre>
  
  <p>This is the code I have currently. I'm looking to parse through a nested JSON file, but each time I run this I get the following error:</p>
  
  <p><em>TypeError: the JSON object must be str, not 'dict'</em></p>
  
  <p>The JSON file when Pretty Printed turns out like this:</p>
  
  <pre><code> {
    "kind":"qpxExpress#tripsSearch",
    "trips":{
      "data":{
        "aircraft":[
          {
            "code":"321",
            "kind":"qpxexpress#aircraftData",
            "name":"Airbus A321"
          }
        ],
        "airport":[
          {
            "city":"ORL",
            "code":"MCO",
            "kind":"qpxexpress#airportData",
            "name":"Orlando International"
          },
          {
            "city":"CHI",
            "code":"ORD",
            "kind":"qpxexpress#airportData",
            "name":"Chicago O'Hare"
          }
        ],
        "carrier":[
          {
            "code":"F9",
            "kind":"qpxexpress#carrierData",
            "name":"Frontier Airlines, Inc."
          }
        ],
        "city":[
          {
            "code":"CHI",
            "kind":"qpxexpress#cityData",
            "name":"Chicago"
          },
          {
            "code":"ORL",
            "kind":"qpxexpress#cityData",
            "name":"Orlando"
          }
        ],
        "kind":"qpxexpress#data",
        "tax":[
          {
            "id":"ZP",
            "kind":"qpxexpress#taxData",
            "name":"US Flight Segment Tax"
          },
          {
            "id":"AY_001",
            "kind":"qpxexpress#taxData",
            "name":"US September 11th Security Fee"
          },
          {
            "id":"US_001",
            "kind":"qpxexpress#taxData",
            "name":"US Transportation Tax"
          },
          {
            "id":"XF",
            "kind":"qpxexpress#taxData",
            "name":"US Passenger Facility Charge"
          }
        ]
      },
      "kind":"qpxexpress#tripOptions",
      "requestId":"2z1TQ9iVMcSlUH8HW0O0eq",
      "tripOption":[
        {
          "id":"WQZ8ICu2L8RLqt1MyMNFAQ001",
          "kind":"qpxexpress#tripOption",
          "pricing":[
            {
              "baseFareTotal":"USD37.11",
              "fare":[
                {
                  "basisCode":"Z00ZSS5",
                  "carrier":"F9",
                  "destination":"ORL",
                  "id":"AR5um4n2cToXHml3a125O0CU7toTISvPQER/01Xhbf2E",
                  "kind":"qpxexpress#fareInfo",
                  "origin":"CHI"
                }
              ],
              "fareCalculation":"ORD F9 MCO Q9.29 Q4.65 23.17Z00ZSS5 USD 37.11 END ZP ORD XT 2.79US 4.00ZP 5.60AY 4.50XF ORD4.50",
              "kind":"qpxexpress#pricingInfo",
              "latestTicketingTime":"2016-03-22T00:24-04:00",
              "passengers":{
                "adultCount":1,
                "kind":"qpxexpress#passengerCounts"
              },
              "ptc":"ADT",
              "saleFareTotal":"USD37.11",
              "saleTaxTotal":"USD16.89",
              "saleTotal":"USD54.00",
              "segmentPricing":[
                {
                  "fareId":"AR5um4n2cToXHml3a125O0CU7toTISvPQER/01Xhbf2E",
                  "kind":"qpxexpress#segmentPricing",
                  "segmentId":"GoIDkawPBE2TZk14"
                }
              ],
              "tax":[
                {
                  "chargeType":"GOVERNMENT",
                  "code":"US",
                  "country":"US",
                  "id":"US_001",
                  "kind":"qpxexpress#taxInfo",
                  "salePrice":"USD2.79"
                },
                {
                  "chargeType":"GOVERNMENT",
                  "code":"AY",
                  "country":"US",
                  "id":"AY_001",
                  "kind":"qpxexpress#taxInfo",
                  "salePrice":"USD5.60"
                },
                {
                  "chargeType":"GOVERNMENT",
                  "code":"XF",
                  "country":"US",
                  "id":"XF",
                  "kind":"qpxexpress#taxInfo",
                  "salePrice":"USD4.50"
                },
                {
                  "chargeType":"GOVERNMENT",
                  "code":"ZP",
                  "country":"US",
                  "id":"ZP",
                  "kind":"qpxexpress#taxInfo",
                  "salePrice":"USD4.00"
                }
              ]
            }
          ],
          "saleTotal":"USD54.00",
          "slice":[
            {
              "duration":167,
              "kind":"qpxexpress#sliceInfo",
              "segment":[
                {
                  "bookingCode":"Z",
                  "bookingCodeCount":9,
                  "cabin":"COACH",
                  "duration":167,
                  "flight":{
                    "carrier":"F9",
                    "number":"1294"
                  },
                  "id":"GoIDkawPBE2TZk14",
                  "kind":"qpxexpress#segmentInfo",
                  "leg":[
                    {
                      "aircraft":"321",
                      "arrivalTime":"2016-05-11T09:42-04:00",
                      "departureTime":"2016-05-11T05:55-05:00",
                      "destination":"MCO",
                      "duration":167,
                      "id":"LQKIza3yQIpaLyDq",
                      "kind":"qpxexpress#legInfo",
                      "meal":"Food and Beverages for Purchase",
                      "mileage":1006,
                      "origin":"ORD",
                      "originTerminal":"3",
                      "secure":true
                    }
                  ],
                  "marriedSegmentGroup":"0"
                }
              ]
            }
          ]
        }
      ]
    }
  }
  </code></pre>
  
  <p>Ultimately I'm trying to find the saleTotal and have the corresponding value printed alongside it:
  <strong>saleTotal: 54.00</strong></p>