I am getting a data in response when I hit the API URL in django. I want to get content_id from that data to check whether it already exists or not. How to iterate the JSON to find the certain key and and its value?
r.json() =
{
"code": 200,
"status": "OK",
"data": [
{
"cart_id": "36",
"content": [
{
"price": "100",
"price_id": "1",
"code": "USD",
"symbol": "$",
"name": "Carol of the Bells SATB - arr. Jay Rouse",
"content_id": "17408"
}
],
"poster_url": "http://devstudio.cnedocent.com/img/No-Image-Vertical.png"
}
],
"msg": "Contents Found!"
}
i tried r.json()['data'][0]['content'][0] but it works in only one data in, if there are more than one data then when i try to iterate content_id with for loop it doesnt work
r.json()at the top, I'm familiar with navigating json but never seen it with that top line