PHPackages                             shiftpi/metascan-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. shiftpi/metascan-api

AbandonedArchivedLibrary[API Development](/categories/api)

shiftpi/metascan-api
====================

Access to Metascan Online API

v0.1(10y ago)413MITPHPPHP &gt;=5.4.0

Since Jun 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/shiftpi/MetascanApi)[ Packagist](https://packagist.org/packages/shiftpi/metascan-api)[ RSS](/packages/shiftpi-metascan-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

ShiftpiMetascanApi
==================

[](#shiftpimetascanapi)

Client for [Metascan Online Public API](https://www.metascan-online.com/).

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

[](#installation)

### Using Composer

[](#using-composer)

Enable module by adding

```
// ...
'modules' => [
    // ...
    'ShiftpiMetascanApi',
    // ...
],
// ...
```

after you have required `shiftpi/metascan-api` in your `composer.json`.

Features
--------

[](#features)

### What is supported?

[](#what-is-supported)

- Scanning files by upload
- Looking up stored reports for single hashes

### What is not supported?

[](#what-is-not-supported)

- Looking up stored reports for multiple hashes
- Looking up IP addresses or URIs

Configuration
-------------

[](#configuration)

Add

```
'metascan' => [
    'key' => 'yourapikey'
]
```

to your application's config. You may want to use another HTTP client adapter. By default CURL is used. To use your own adapter, register `ShiftpiMetascanApi\Http\Adapter` and make sure it is an instance of `Zend\Http\Client\Adapter\AdapterInterface`.

Usage
-----

[](#usage)

### Scan data

[](#scan-data)

If you want to scan the whole content of a file, you should use the ScanService class. Retrieve an instance from the service manager by using the key `ShiftpiMetascanApi\Service\Scan`.

```
$service = $sm->get(\ShiftpiMetascanApi\Service\Scan::class);
$result = $service->scan(file_get_contents('/path/to/myfile.zip', 'myfile.zip', 'secretpassword'));
```

The second and third parameters are optional. If you upload an encrypted archive, Metascan Online can decrypt it if you provide the password as third parameter.

### Lookup hash

[](#lookup-hash)

A faster way checking files is looking up its hash. For that you can use the HashLookupService by retrieving `ShiftpiMetascanApi\Service\HashLookup` from the service manager.

```
$service = $sm->get(\ShiftpiMetascanApi\Service\HashLookup::class);
$result = $service->lookup(hash('sha256', file_get_contents('/path/to/myfile.zip')));
```

The parameter should be a SHA256, SHA1 or MD5 hash. If the parameter has an other string length, than a supported algorithm produces, an exception will be thrown. Please note: If you lookup a hash Metascan does not know, a "Not Found" state will be returned. This does not mean, that the file is probably not malicious.

Testing
-------

[](#testing)

There are some test files for the services present. You have to copy the file `test/config/config.local.php.dist` to `test/config/config.local.php` and paste your API key in order to run those.
These are tests against the real API, which will produce real API requests (no mocks!). Therefore be careful running them and keep yor API limits in mind. ;-)

License
-------

[](#license)

Licensed under the MIT license. See license file.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4001d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5779f646c2400735f3aa9aa73ada5a88abc49e1fde0053df924cb9e6357c20d9?d=identicon)[shiftpi](/maintainers/shiftpi)

---

Top Contributors

[![shiftpi](https://avatars.githubusercontent.com/u/7015605?v=4)](https://github.com/shiftpi "shiftpi (15 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shiftpi-metascan-api/health.svg)

```
[![Health](https://phpackages.com/badges/shiftpi-metascan-api/health.svg)](https://phpackages.com/packages/shiftpi-metascan-api)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[kablau-joustra/kj-sencha

Ext-JS / Sencha Touch RPC Intergration Module for Zend Framework 2

242.8k2](/packages/kablau-joustra-kj-sencha)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
