internetarchive / virustotalapi
VirusTotal Public API v2.0 PHP Wrapper
Package info
github.com/internetarchive/virustotal_apiwrapper
pkg:composer/internetarchive/virustotalapi
Requires
- php: >=7.4.0
- guzzlehttp/guzzle: ^7.11.1
Requires (Dev)
- phpunit/phpunit: ^10.0.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-19 22:07:41 UTC
README
Maintained fork of Jay Zeng's original version.
This is a PHP SDK to interact with Virus Total Public API v2.0, please see their API docs for details.
Usage:
- You will need composer (http://getcomposer.org/)
- composer search virustotalapi or visit the package info on packagist (https://packagist.org/packages/jayzeng/virustotalapi)
Include the following in your composer.json:
{
"require": {
"internetarchive/virustotalapi": "dev-main"
}
}
composer update -v -o
Quick start:
<?php
require_once 'vendor/autoload.php';
$apiKey = 'your_api_key';
$file = new VirusTotal\File($apiKey);
$resp = $file->scan('foo.txt');
var_dump($resp);
?>
Sample output:
[jayzeng] ~/Projects/virustotal_apiwrapper/Example] (master)> php file.php |more
array(8) {
["scan_id"]=>
string(75) "1afc739de16163a80380326ce05e1e69edfc99b7a931329ab127b5099377f076-1370244536"
["sha1"]=>
string(40) "da9ed61e1bfa981c545acad4136e8a05f0602e45"
["resource"]=>
string(64) "1afc739de16163a80380326ce05e1e69edfc99b7a931329ab127b5099377f076"
["response_code"]=>
int(1)
["sha256"]=>
string(64) "1afc739de16163a80380326ce05e1e69edfc99b7a931329ab127b5099377f076"
["permalink"]=>
string(117) "https://www.virustotal.com/file/1afc739de16163a80380326ce05e1e69edfc99b7a931329ab127b5099377f076/analysis/1370244536/"
["md5"]=>
string(32) "b2f301b40a5fb752b19ae0e5c7f679b4"
["verbose_msg"]=>
string(64) "Scan request successfully queued, come back later for the report"
}
Example:
Still feeling confusing? See examples/ (https://github.com/internetarchive/virustotal_apiwrapper/tree/master/examples)
Jay Zeng also put together a demo application with source code is available.
How to run tests?
vendor/bin/phpunit --configuration tests/conf/phpunit.xml tests
Issues & Development
- Source code is hosted on GitHub
- Report issues, questions, or request features on GitHub Issues
How to release new version?
- RELEASE_VERSION - version number
- RELEASE_MESSAGE - release message
make release RELEASE_VERSION="0.1" RELEASE_MESSAGE="v0.1 is released"
How to contribute?
Awesome! Please follow these steps:
- Create an issue GitHub Issues to explain what you intended to do
- Fork the repository into your GitHub account
- Create a new branch (preferably with a descriptive name that ties to the issue number e.g: feature/issue1_add_urlendpoint)
- Add/Refactor tests
- Run tests locally (Please reference How to run tests) and make sure they all pass locally
- Send in a pull request
- Pass tests & travis build
Author:
Jay Zeng, e-mail: jayzeng@jay-zeng.com
Maintainer of this fork:
Pablo Duboue, e-mail: pablo.duboue@gmail.com