I am trying to count the number of times the scan detects the file as being false. I tried looking at links such as Looking for a specific value in JSON file but it didn't solve my issue. In addition, I have not worked with API's that much so any help would be greatly appreciated.
This is what I have so far.
# Making the API call
url = 'https://www.virustotal.com/vtapi/v2/file/report'
params = {'apikey': api_key, 'resource': sha1_num}
response = requests.get(url, params=params)
allJson = response.json()
data = json.dumps(allJson)
count = 0
item_dict = json.loads(data)
print len(item_dict['scans']
for entry in data['scans']:
if entry['detected'] == 'false':
count += 1
print (count)
And, this is what the result for sublime.exe is on virustotal
{
"scans": {
"Bkav": {
"detected": false,
"version": "1.3.0.9466",
"result": null,
"update": "20180619"
},
"MicroWorld-eScan": {
"detected": false,
"version": "14.0.297.0",
"result": null,
"update": "20180619"
},
"CMC": {
"detected": false,
"version": "1.1.0.977",
"result": null,
"update": "20180619"
},
"CAT-QuickHeal": {
"detected": false,
"version": "14.00",
"result": null,
"update": "20180619"
},
"ALYac": {
"detected": false,
"version": "1.1.1.5",
"result": null,
"update": "20180619"
},