README.rst
1.. image:: https://raw.githubusercontent.com/blacktop/virustotal-api/master/doc/logo.png
2
3virustotal-api
4==============
5
6.. image:: https://travis-ci.org/blacktop/virustotal-api.svg?branch=master
7 :target: https://travis-ci.org/blacktop/virustotal-api
8
9.. image:: http://img.shields.io/:license-mit-blue.svg
10 :target: http://doge.mit-license.org
11
12.. image:: https://img.shields.io/pypi/v/virustotal-api.svg
13 :target: https://pypi.python.org/pypi/virustotal-api/
14
15.. image:: https://img.shields.io/pypi/pyversions/virustotal-api.svg
16 :target: https://pypi.python.org/pypi/virustotal-api/
17
18
19Virus Total Public/Private/Intel API
20
21- https://www.virustotal.com/en/documentation/public-api/
22- https://www.virustotal.com/en/documentation/private-api/
23- https://www.virustotal.com/intelligence/help/automation/
24
25Installation
26------------
27
28.. code-block:: bash
29
30 $ pip install virustotal-api
31
32
33Usage
34-----
35.. code-block:: python
36
37 import json
38 import hashlib
39 from virus_total_apis import PublicApi as VirusTotalPublicApi
40
41 API_KEY = 'Sign-Up for API Key at virustotal.com'
42
43 EICAR = "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"
44 EICAR_MD5 = hashlib.md5(EICAR).hexdigest()
45
46 vt = VirusTotalPublicApi(API_KEY)
47
48 response = vt.get_file_report(EICAR_MD5)
49 print json.dumps(response, sort_keys=False, indent=4)
50
51
52Output:
53-------
54.. code-block:: json
55
56 {
57 "response_code": 200,
58 "results": {
59 "scan_id": "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f-1397510237",
60 "sha1": "3395856ce81f2b7382dee72602f798b642f14140",
61 "resource": "44d88612fea8a8f36de82e1278abb02f",
62 "response_code": 1,
63 "scan_date": "2014-04-14 21:17:17",
64 "permalink": "https://www.virustotal.com/file/275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f/analysis/1397510237/",
65 "verbose_msg": "Scan finished, scan information embedded in this object",
66 "sha256": "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f",
67 "positives": 49,
68 "total": 51,
69 "md5": "44d88612fea8a8f36de82e1278abb02f",
70 "scans": {
71 "Bkav": {
72 "detected": true,
73 "version": "1.3.0.4959",
74 "result": "DOS.EiracA.Trojan",
75 "update": "20140412"
76 },
77 "MicroWorld-eScan": {
78 "detected": true,
79 "version": "12.0.250.0",
80 "result": "EICAR-Test-File",
81 "update": "20140414"
82 },
83 "nProtect": {
84 "detected": true,
85 "version": "2014-04-14.02",
86 "result": "EICAR-Test-File",
87 "update": "20140414"
88 },
89 ...<snip>...
90 "AVG": {
91 "detected": true,
92 "version": "13.0.0.3169",
93 "result": "EICAR_Test",
94 "update": "20140414"
95 },
96 "Panda": {
97 "detected": true,
98 "version": "10.0.3.5",
99 "result": "EICAR-AV-TEST-FILE",
100 "update": "20140414"
101 },
102 "Qihoo-360": {
103 "detected": true,
104 "version": "1.0.0.1015",
105 "result": "Trojan.Generic",
106 "update": "20140414"
107 }
108 }
109 }
110 }
111
112Testing
113-------
114
115To run the tests:
116
117.. code-block:: bash
118
119 $ ./tests
120
121
122Documentation
123-------------
124
125You're looking at it.
126
127Issues
128------
129
130Find 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.
131
132Contributing
133------------
134
135`See all contributors on GitHub <https://github.com/blacktop/virustotal-api/graphs/contributors>`_.
136
137Please 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/>`_.
138
139License
140-------
141
142MIT Copyright (c) 2014-2016 **blacktop**
143