VirusTotal API
Project description
VirusTotal API 3 version
The module that implements the service API functions www.virustotal.com (3 versions) available using the public key. For a detailed description of the API, see: https://developers.virustotal.com/v3.0/reference.
The following VirusTotal API functions are implemented:
For files:
/files
/files/upload_url
/files/{id}
/files/{id}/analyse
/files/{id}/comments
/files/{id}/comments
/files/{id}/votes
/files/{id}/votes
/files/{id}/{relationship}
/file_behaviours/{sandbox_id}/pcap
For URLs:
/urls
/urls/{id}
/urls/{id}/analyse
/urls/{id}/comments
/urls/{id}/comments
/urls/{id}/votes
/urls/{id}/votes
/urls/{id}/network_location
For domains:
/domains/{domain}
/domains/{domain}/comments
/domains/{domain}/comments
/domains/{domain}/{relationship}
/domains/{domain}/votes
/domains/{domain}/votes
For IP-addresses:
/domains/{domain}
/domains/{domain}/comments
/domains/{domain}/comments
/domains/{domain}/{relationship}
/domains/{domain}/votes
/domains/{domain}/votes
File and URL analysis:
/analyses/{id}
Installation
$ pip install vtapi3
Usage
import json
from vtapi3 import VirusTotalAPIFiles, VirusTotalAPIError
...
vt_files = VirusTotalAPIFiles('<API key>')
try:
result = vt_files.upload('<file path>')
except VirusTotalAPIError as err:
print(err, err.err_code)
else:
if vt_files.get_last_http_error() == vt_files.HTTP_OK:
result = json.loads(result)
result = json.dumps(result, sort_keys=False, indent=4)
print(result)
else:
print('HTTP Error [' + str(vt_files.get_last_http_error()) +']')
...
Output
{
"data": {
"type": "analysis",
"id": "NjY0MjRlOTFjMDIyYTkyNWM0NjU2NWQzYWNlMzFmZmI6MTQ3NTA0ODI3Nw=="
}
}
License
MIT Copyright (c) 2020 Evgeny Drobotun
Documentation
Documentation for using this package: https://virustotalapi3.readthedocs.io
Release History
1.0.4 (1.02.2020)
Fixing README.rst for better PYPI presentation.
1.0.3 (26.01.2020)
Added a new attribute _last_result to the VirustotalAPI base class.
Added a new method get_last_result to the VirustotalAPI base class.
1.0.2 (12.01.2020)
Fixed errors in source comments.
Fixing README.rst for better PYPI presentation.
Fixing setup.py for better PYPI presentation.
README.rst translated into English.
Added two tests (test_get_version_avi() and test_get_lost_http_error ()) in test_vt_3.py
1.0.1 (08.01.2020)
First release of vtapi3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.