virustotal-api


Namevirustotal-api JSON
Version 1.1.11 PyPI version JSON
download
home_pagehttps://github.com/blacktop/virustotal-api
SummaryVirus Total Public/Private/Intel API
upload_time2019-09-22 18:03:41
maintainer
docs_urlNone
authorblacktop
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://raw.githubusercontent.com/blacktop/virustotal-api/master/doc/logo.png

virustotal-api
==============

.. image:: https://travis-ci.org/blacktop/virustotal-api.svg?branch=master
    :target: https://travis-ci.org/blacktop/virustotal-api

.. image:: http://img.shields.io/:license-mit-blue.svg
        :target: http://doge.mit-license.org

.. image:: https://img.shields.io/pypi/v/virustotal-api.svg
    :target: https://pypi.python.org/pypi/virustotal-api/

.. image:: https://img.shields.io/pypi/pyversions/virustotal-api.svg
        :target: https://pypi.python.org/pypi/virustotal-api/


Virus Total Public/Private/Intel API

- https://www.virustotal.com/en/documentation/public-api/
- https://www.virustotal.com/en/documentation/private-api/
- https://www.virustotal.com/intelligence/help/automation/

Installation
------------

.. code-block:: bash

    $ pip install virustotal-api


Usage
-----
.. code-block:: python

    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 virustotal.com'

    EICAR = "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*".encode('utf-8')
    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))


Output:
-------
.. code-block:: json

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

Testing
-------

To run the tests:

.. code-block:: bash

    $ ./tests


Documentation
-------------

You're looking at it.

Issues
------

Find a bug? Want more features? Find something missing in the documentation? Let me know! Please don't hesitate to `file an issue <https://github.com/blacktop/virustotal-api/issues/new>`_ and I'll get right on it.

Contributing
------------

`See all contributors on GitHub <https://github.com/blacktop/virustotal-api/graphs/contributors>`_.

Please update the `HISTORY.rst <https://github.com/blacktop/virustotal-api/blob/master/HISTORY.rst>`_, and submit a `Pull Request on GitHub <https://help.github.com/articles/using-pull-requests/>`_.

License
-------

MIT Copyright (c) 2014-2019 **blacktop**


.. :changelog:

Release History
---------------

1.1.11 (2019-09-22)
-------------------

**Allow for hash list input in get_file_report**

- https://github.com/blacktop/virustotal-api/pull/28 (credit: @CDuPlooy)

1.1.10 (2018-03-12)
-------------------

**Intel API Fix**

- https://github.com/blacktop/virustotal-api/pull/23 (credit: @leadZERO)

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

**Intel API Fix**

- https://github.com/blacktop/virustotal-api/pull/22 (credit: @leadZERO)

1.1.7 (2017-05-28)
------------------

**Intel API Fix**

- https://github.com/blacktop/virustotal-api/pull/18 (credit: @doug-the-guy)

1.1.6 (2017-05-14)
------------------

**Py3 Fix**

- Change `e.message` to `str(message)` (credit: [@DeanF](https://github.com/blacktop/virustotal-api/pull/19))

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)
------------------

**Privacyfixes**

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

1.0.8 (2014-12-26)
------------------

**Bugfixes**

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

1.0.7 (2014-10-17)
------------------

**Bugfixes**

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

1.0.6 (2014-09-22)
------------------

**Bugfixes**

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

1.0.5 (2014-05-18)
------------------

**Bugfixes**

- 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)
------------------

**Bugfixes**

- Trying to fix setup.py for deploying to PYPI.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/blacktop/virustotal-api",
    "name": "virustotal-api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "blacktop",
    "author_email": "dev@blacktop.io",
    "download_url": "https://files.pythonhosted.org/packages/2a/44/2780b13218eb0b417ee3bf57b24df82496853c14d30524b43a89b8cc9222/virustotal-api-1.1.11.tar.gz",
    "platform": "",
    "description": ".. image:: https://raw.githubusercontent.com/blacktop/virustotal-api/master/doc/logo.png\n\nvirustotal-api\n==============\n\n.. image:: https://travis-ci.org/blacktop/virustotal-api.svg?branch=master\n    :target: https://travis-ci.org/blacktop/virustotal-api\n\n.. image:: http://img.shields.io/:license-mit-blue.svg\n        :target: http://doge.mit-license.org\n\n.. image:: https://img.shields.io/pypi/v/virustotal-api.svg\n    :target: https://pypi.python.org/pypi/virustotal-api/\n\n.. image:: https://img.shields.io/pypi/pyversions/virustotal-api.svg\n        :target: https://pypi.python.org/pypi/virustotal-api/\n\n\nVirus Total Public/Private/Intel API\n\n- https://www.virustotal.com/en/documentation/public-api/\n- https://www.virustotal.com/en/documentation/private-api/\n- https://www.virustotal.com/intelligence/help/automation/\n\nInstallation\n------------\n\n.. code-block:: bash\n\n    $ pip install virustotal-api\n\n\nUsage\n-----\n.. code-block:: python\n\n    from __future__ import print_function\n    import json\n    import hashlib\n    from virus_total_apis import PublicApi as VirusTotalPublicApi\n\n    API_KEY = 'Sign-Up for API Key at virustotal.com'\n\n    EICAR = \"X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*\".encode('utf-8')\n    EICAR_MD5 = hashlib.md5(EICAR).hexdigest()\n\n    vt = VirusTotalPublicApi(API_KEY)\n\n    response = vt.get_file_report(EICAR_MD5)\n    print(json.dumps(response, sort_keys=False, indent=4))\n\n\nOutput:\n-------\n.. code-block:: json\n\n    {\n        \"response_code\": 200,\n        \"results\": {\n            \"scan_id\": \"275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f-1397510237\",\n            \"sha1\": \"3395856ce81f2b7382dee72602f798b642f14140\",\n            \"resource\": \"44d88612fea8a8f36de82e1278abb02f\",\n            \"response_code\": 1,\n            \"scan_date\": \"2014-04-14 21:17:17\",\n            \"permalink\": \"https://www.virustotal.com/file/275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f/analysis/1397510237/\",\n            \"verbose_msg\": \"Scan finished, scan information embedded in this object\",\n            \"sha256\": \"275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f\",\n            \"positives\": 49,\n            \"total\": 51,\n            \"md5\": \"44d88612fea8a8f36de82e1278abb02f\",\n            \"scans\": {\n                \"Bkav\": {\n                    \"detected\": true,\n                    \"version\": \"1.3.0.4959\",\n                    \"result\": \"DOS.EiracA.Trojan\",\n                    \"update\": \"20140412\"\n                },\n                \"MicroWorld-eScan\": {\n                    \"detected\": true,\n                    \"version\": \"12.0.250.0\",\n                    \"result\": \"EICAR-Test-File\",\n                    \"update\": \"20140414\"\n                },\n                \"nProtect\": {\n                    \"detected\": true,\n                    \"version\": \"2014-04-14.02\",\n                    \"result\": \"EICAR-Test-File\",\n                    \"update\": \"20140414\"\n                },\n                ...<snip>...\n                \"AVG\": {\n                    \"detected\": true,\n                    \"version\": \"13.0.0.3169\",\n                    \"result\": \"EICAR_Test\",\n                    \"update\": \"20140414\"\n                },\n                \"Panda\": {\n                    \"detected\": true,\n                    \"version\": \"10.0.3.5\",\n                    \"result\": \"EICAR-AV-TEST-FILE\",\n                    \"update\": \"20140414\"\n                },\n                \"Qihoo-360\": {\n                    \"detected\": true,\n                    \"version\": \"1.0.0.1015\",\n                    \"result\": \"Trojan.Generic\",\n                    \"update\": \"20140414\"\n                }\n            }\n        }\n    }\n\nTesting\n-------\n\nTo run the tests:\n\n.. code-block:: bash\n\n    $ ./tests\n\n\nDocumentation\n-------------\n\nYou're looking at it.\n\nIssues\n------\n\nFind a bug? Want more features? Find something missing in the documentation? Let me know! Please don't hesitate to `file an issue <https://github.com/blacktop/virustotal-api/issues/new>`_ and I'll get right on it.\n\nContributing\n------------\n\n`See all contributors on GitHub <https://github.com/blacktop/virustotal-api/graphs/contributors>`_.\n\nPlease update the `HISTORY.rst <https://github.com/blacktop/virustotal-api/blob/master/HISTORY.rst>`_, and submit a `Pull Request on GitHub <https://help.github.com/articles/using-pull-requests/>`_.\n\nLicense\n-------\n\nMIT Copyright (c) 2014-2019 **blacktop**\n\n\n.. :changelog:\n\nRelease History\n---------------\n\n1.1.11 (2019-09-22)\n-------------------\n\n**Allow for hash list input in get_file_report**\n\n- https://github.com/blacktop/virustotal-api/pull/28 (credit: @CDuPlooy)\n\n1.1.10 (2018-03-12)\n-------------------\n\n**Intel API Fix**\n\n- https://github.com/blacktop/virustotal-api/pull/23 (credit: @leadZERO)\n\n1.1.9 (2018-01-03 aka the day the CPUs fell)\n--------------------------------------------\n\n**Intel API Fix**\n\n- https://github.com/blacktop/virustotal-api/pull/22 (credit: @leadZERO)\n\n1.1.7 (2017-05-28)\n------------------\n\n**Intel API Fix**\n\n- https://github.com/blacktop/virustotal-api/pull/18 (credit: @doug-the-guy)\n\n1.1.6 (2017-05-14)\n------------------\n\n**Py3 Fix**\n\n- Change `e.message` to `str(message)` (credit: [@DeanF](https://github.com/blacktop/virustotal-api/pull/19))\n\n1.1.5 (2017-04-13)\n------------------\n\n**API Changes**\n\n- Added Intelligence notifications feed and ability to programmatically delete notifications from the feed. (credit: @keithjjones)\n\n1.1.4 (2017-03-11)\n------------------\n\n**Fixed timeout functionality, removed unnecessary methods**\n\n- Fixed the timeout parameter in the PublicApi and removes unnecessary code in the PrivateApi (credit: @mrredamber aka LEGEND)\n\n1.1.3 (2017-02-03)\n------------------\n\n**Request Timeout Functionality**\n\n- Adds a timeout parameter to methods that make requests to the VirusTotal API (credit: @mrredamber aka LEGEND)\n\n1.1.2 (2016-04-13)\n------------------\n\n**API Changes**\n\n- Re-adding the ability to use files from memory as well as from disk. (credit: @tweemeterjop)\n\n1.1.1 (2016-03-13)\n------------------\n\n**API Changes**\n\n- Adding file/url feed private API endpoint.\n\n1.0.9 (2016-01-01)\n------------------\n\n**Privacyfixes**\n\n- Fix scan_file (upload to VT), do not leak full path. (credit: @Rafiot)\n\n1.0.8 (2014-12-26)\n------------------\n\n**Bugfixes**\n\n- Fixed get_url_report method for the Private API (credit: @John-Lin)\n\n1.0.7 (2014-10-17)\n------------------\n\n**Bugfixes**\n\n- Fixed get_network_traffic method to return the pcap data (credit: adrianherrera)\n\n1.0.6 (2014-09-22)\n------------------\n\n**Bugfixes**\n\n- Fixed a small typo in the private API's scan_file method (credit: adrianherrera)\n\n1.0.5 (2014-05-18)\n------------------\n\n**Bugfixes**\n\n- Fixing README.rst for better PYPI presentation.\n\n1.0.2 (2014-05-18)\n------------------\n\n**API Changes**\n\n- Changing folder structure so when people import it it is not dumb :(\n\n1.0.1 (2014-04-14)\n------------------\n\n**Bugfixes**\n\n- Trying to fix setup.py for deploying to PYPI.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Virus Total Public/Private/Intel API",
    "version": "1.1.11",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "371fe10b873b889efea9c97bbfa35ce56e5d1c2fc1a2996f7287060215ad49be",
                "md5": "92c950d8e48c4c66ff45a106a7cbcada",
                "sha256": "d238603aafa9d6229394f4df26fb076eb0f5ddf4b60672cf0fd1b7f2608a8b29"
            },
            "downloads": -1,
            "filename": "virustotal_api-1.1.11-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "92c950d8e48c4c66ff45a106a7cbcada",
            "packagetype": "bdist_wheel",
            "python_version": "3.7",
            "requires_python": null,
            "size": 15978,
            "upload_time": "2019-09-22T18:03:43",
            "upload_time_iso_8601": "2019-09-22T18:03:43.999205Z",
            "url": "https://files.pythonhosted.org/packages/37/1f/e10b873b889efea9c97bbfa35ce56e5d1c2fc1a2996f7287060215ad49be/virustotal_api-1.1.11-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2a442780b13218eb0b417ee3bf57b24df82496853c14d30524b43a89b8cc9222",
                "md5": "bb67ab2f188848fefc58aa7edf530022",
                "sha256": "9f1d783a848e928a78aa168372645c6899cbbd6b888951e1d6335e5b87de1c3d"
            },
            "downloads": -1,
            "filename": "virustotal-api-1.1.11.tar.gz",
            "has_sig": false,
            "md5_digest": "bb67ab2f188848fefc58aa7edf530022",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 18063,
            "upload_time": "2019-09-22T18:03:41",
            "upload_time_iso_8601": "2019-09-22T18:03:41.402065Z",
            "url": "https://files.pythonhosted.org/packages/2a/44/2780b13218eb0b417ee3bf57b24df82496853c14d30524b43a89b8cc9222/virustotal-api-1.1.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2019-09-22 18:03:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "blacktop",
    "github_project": "virustotal-api",
    "lcname": "virustotal-api"
}
        
Elapsed time: 0.05464s