Skip to main content

VirusTotal API

Project description

VirusTotal API 3 version

The module that implements the service API functions (3 versions) available using the public key. For a detailed description of the API, see:

The following VirusTotal API functions are implemented:

For files:

  • POST /files
  • GET /files/upload_url
  • GET /files/{id}
  • POST /files/{id}/analyse
  • GET /files/{id}/comments
  • POST /files/{id}/comments
  • GET /files/{id}/votes
  • POST /files/{id}/votes
  • GET /files/{id}/{relationship}
  • GET /file_behaviours/{sandbox_id}/pcap

For URLs:

  • POST /urls
  • GET /urls/{id}
  • POST /urls/{id}/analyse
  • GET /urls/{id}/comments
  • POST /urls/{id}/comments
  • GET /urls/{id}/votes
  • POST /urls/{id}/votes
  • GET /urls/{id}/network_location

For domains:

  • GET /domains/{domain}
  • GET /domains/{domain}/comments
  • POST /domains/{domain}/comments
  • GET /domains/{domain}/{relationship}
  • GET /domains/{domain}/votes
  • POST /domains/{domain}/votes

For IP-addresses:

  • GET /domains/{domain}
  • GET /domains/{domain}/comments
  • POST /domains/{domain}/comments
  • GET /domains/{domain}/{relationship}
  • GET /domains/{domain}/votes
  • POST /domains/{domain}/votes

File and URL analysis:

  • GET /analyses/{id}


$ pip install vtapi3


import json
from vtapi3 import VirusTotalAPIFiles, VirusTotalAPIError
vt_files = VirusTotalAPIFiles('<API key>')
    result = vt_files.upload('<file path>')
except VirusTotalAPIError as err:
    print(err, err.err_code)
    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('HTTP Error [' + str(vt_files.get_last_http_error()) +']')


  "data": {
    "type": "analysis",


MIT Copyright (c) 2020 Evgeny Drobotun


Documentation for using this package:

Release History

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 for better PYPI presentation.
  • README.rst translated into English.
  • Added two tests (test_get_version_avi() and test_get_lost_http_error ()) in

1.0.1 (08.01.2020)

  • First release of vtapi3

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for vtapi3, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size vtapi3-1.0.3.tar.gz (8.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page