import requests
API_KEY = 'your_api_key_here'
def scan_file(file_path):
url = 'https://www.virustotal.com/vtapi/v2/file/report'
params = {
'apikey': API_KEY,
'resource': file_path
}
response = requests.get(url, params=params)
return response.json()
file_hash = input("Enter the file hash to check: ")
result = scan_file(file_hash)
if result['response_code'] == 1:
print("Scan results:")
for scan in result['scans']:
print(f"{scan}: {result['scans'][scan]['result']}")
else:
print("File not found in the database.")