I am trying to run a query with an API to get a piece of information. However, I get too much data. I am looking for a way to only get a specific value, which is the number after "totalItemCount". How can I search for the value of "totalItemCount" which shows up like "totalItemCount":number,. How can I run the API query search for number for "totalItemCount"? So far, I have code:
import requests
import json
##headers
headers = {
'Accept': 'application/json',
'x-api-key':'apikeyNumber'
}
response = requests.get('https://app.application.com/api/v3/agents/1', headers=headers)
data = response.json()
data_str = json.dumps(data, indent=2)
print(data_str)
Output: Large amount of data, a snippet:
...
"LastRebootTime": "2022-11-10T15:25:44Z",
"OSVersion": "21H2",
"OSBuild": "19044.2251",
"OfficeFullVersion": "16.0.10391.20029",
}
],
"totalItemCount": 1088,
"page": 1,
"itemsInPage": 20,
"totalPages": 55,
"prevLink": "",
}
Not sure on the parsing after running the api query.