I have a JSON API response that looks like the following:
json_data=
{
"sales_list": [
{
"date": "all",
"country": "all",
"units": {
"product": {
"promotions": 0,
"downloads": 1,
"updates": 2,
"refunds": 3
},
"iap": {
"promotions": 0,
"sales": 0,
"refunds": 0
}
},
"revenue": {
"product": {
"promotions": "0.00",
"downloads": "0.00",
"updates": "0.00",
"refunds": "0.00"
},
"iap": {
"promotions": "0.00",
"sales": "0.00",
"refunds": "0.00"
},
"ad": "0.00"
}
}
],
"next_page": null,
"code": 200,
"prev_page": null,
"vertical": "apps",
"page_num": 1,
"iap_sales_list": [],
"currency": "USD",
"page_index": 0,
"market": "ios"
}
I'm using Python and am trying to access the first "downloads" value in the response. So I need to go from sales_list (list in a dict) > units (dict) > product (dict) > downloads. How to I got about digging down these multiple layers to access just this single value?
I've seen questions about accessing values within a dictionary within a list, or within a nested dictionary. But I'm a little confused as to how to navigate between/among lists in dictionaries and dictionaries in lists. Any help would be greatly appreciated.