Skip to main content

Virus Total Public/Private/Intel API

Project description


Virus Total Public/Private/Intel API


$ pip install virustotal-api


from __future__ import print_function
import json
import hashlib
from virus_total_apis import PublicApi as VirusTotalPublicApi

API_KEY = 'Sign-Up for API Key at'

EICAR_MD5 = hashlib.md5(EICAR).hexdigest()

vt = VirusTotalPublicApi(API_KEY)

response = vt.get_file_report(EICAR_MD5)
print(json.dumps(response, sort_keys=False, indent=4))


    "response_code": 200,
    "results": {
        "scan_id": "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f-1397510237",
        "sha1": "3395856ce81f2b7382dee72602f798b642f14140",
        "resource": "44d88612fea8a8f36de82e1278abb02f",
        "response_code": 1,
        "scan_date": "2014-04-14 21:17:17",
        "permalink": "",
        "verbose_msg": "Scan finished, scan information embedded in this object",
        "sha256": "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f",
        "positives": 49,
        "total": 51,
        "md5": "44d88612fea8a8f36de82e1278abb02f",
        "scans": {
            "Bkav": {
                "detected": true,
                "version": "",
                "result": "DOS.EiracA.Trojan",
                "update": "20140412"
            "MicroWorld-eScan": {
                "detected": true,
                "version": "",
                "result": "EICAR-Test-File",
                "update": "20140414"
            "nProtect": {
                "detected": true,
                "version": "2014-04-14.02",
                "result": "EICAR-Test-File",
                "update": "20140414"
            "AVG": {
                "detected": true,
                "version": "",
                "result": "EICAR_Test",
                "update": "20140414"
            "Panda": {
                "detected": true,
                "version": "",
                "result": "EICAR-AV-TEST-FILE",
                "update": "20140414"
            "Qihoo-360": {
                "detected": true,
                "version": "",
                "result": "Trojan.Generic",
                "update": "20140414"


To run the tests:

$ ./tests


You’re looking at it.


Find a bug? Want more features? Find something missing in the documentation? Let me know! Please don’t hesitate to file an issue and I’ll get right on it.


See all contributors on GitHub.

Please update the HISTORY.rst, and submit a Pull Request on GitHub.


MIT Copyright (c) 2014-2019 blacktop

Release History

1.1.11 (2019-09-22)

Allow for hash list input in get_file_report

1.1.10 (2018-03-12)

Intel API Fix

1.1.9 (2018-01-03 aka the day the CPUs fell)

Intel API Fix

1.1.7 (2017-05-28)

Intel API Fix

1.1.6 (2017-05-14)

Py3 Fix

1.1.5 (2017-04-13)

API Changes

  • Added Intelligence notifications feed and ability to programmatically delete notifications from the feed. (credit: @keithjjones)

1.1.4 (2017-03-11)

Fixed timeout functionality, removed unnecessary methods

  • Fixed the timeout parameter in the PublicApi and removes unnecessary code in the PrivateApi (credit: @mrredamber aka LEGEND)

1.1.3 (2017-02-03)

Request Timeout Functionality

  • Adds a timeout parameter to methods that make requests to the VirusTotal API (credit: @mrredamber aka LEGEND)

1.1.2 (2016-04-13)

API Changes

  • Re-adding the ability to use files from memory as well as from disk. (credit: @tweemeterjop)

1.1.1 (2016-03-13)

API Changes

  • Adding file/url feed private API endpoint.

1.0.9 (2016-01-01)


  • Fix scan_file (upload to VT), do not leak full path. (credit: @Rafiot)

1.0.8 (2014-12-26)


  • Fixed get_url_report method for the Private API (credit: @John-Lin)

1.0.7 (2014-10-17)


  • Fixed get_network_traffic method to return the pcap data (credit: adrianherrera)

1.0.6 (2014-09-22)


  • Fixed a small typo in the private API’s scan_file method (credit: adrianherrera)

1.0.5 (2014-05-18)


  • Fixing README.rst for better PYPI presentation.

1.0.2 (2014-05-18)

API Changes

  • Changing folder structure so when people import it it is not dumb :(

1.0.1 (2014-04-14)


  • Trying to fix for deploying to PYPI.

Project details

Download files

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

Source Distribution

virustotal-api-1.1.11.tar.gz (18.1 kB view hashes)

Uploaded source

Built Distribution

virustotal_api-1.1.11-py2.py3-none-any.whl (16.0 kB view hashes)

Uploaded 3 7

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page