PHPackages                             scanii/scanii-php - 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. scanii/scanii-php

ActiveLibrary[API Development](/categories/api)

scanii/scanii-php
=================

Zero-dependency PHP SDK for the Scanii content security API

v6.3.0(1mo ago)10Apache-2.0PHPPHP ^8.4CI failing

Since Mar 24Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/scanii/scanii-php)[ Packagist](https://packagist.org/packages/scanii/scanii-php)[ Docs](https://github.com/scanii/scanii-php)[ RSS](/packages/scanii-scanii-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (1)Versions (30)Used By (0)

scanii-php
==========

[](#scanii-php)

Official PHP SDK for the [Scanii](https://www.scanii.com) content processing API.

SDK Principles
--------------

[](#sdk-principles)

1. **Light.** Zero runtime dependencies, stdlib only.
2. **Up to date.** Always current with the latest Scanii API.
3. **Integration-only.** Wraps the REST API — retries, concurrency, and batching are the caller's responsibility.

The only stdlib extensions required are `ext-curl` and `ext-json`, both shipped by default with every official PHP distribution (including the Windows builds).

Install
-------

[](#install)

```
composer require scanii/scanii-php
```

Requires PHP 8.4 or newer.

Quickstart
----------

[](#quickstart)

```
use Scanii\ScaniiClient;
use Scanii\ScaniiTarget;

$client = ScaniiClient::create('your-api-key', 'your-api-secret', ScaniiTarget::US1);

// Scan a file from disk:
$result = $client->process('/path/to/file');
echo implode(', ', $result->findings);
```

`ScaniiClient::create` returns a thread-friendly client that you can reuse across requests; the constructor performs no I/O.

### Scanning from a stream

[](#scanning-from-a-stream)

Pass any PHP stream resource — `fopen()`, `tmpfile()`, `php://temp`, etc.:

```
// From a temp file / in-memory stream:
$stream = fopen('php://temp', 'r+');
fwrite($stream, $content);
rewind($stream);

$result = $client->processStream($stream, 'upload.bin');
echo implode(', ', $result->findings);
fclose($stream);
```

API
---

[](#api)

MethodRESTReturns`process($path, $metadata, $callback)``POST /files``ScaniiProcessingResult``processStream($stream, $filename, $contentType, $metadata, $callback)``POST /files``ScaniiProcessingResult``processAsync($path, $metadata, $callback)``POST /files/async``ScaniiPendingResult``processAsyncStream($stream, $filename, $contentType, $metadata, $callback)``POST /files/async``ScaniiPendingResult``processFromUrl($location, $callback, $metadata)``POST /files``ScaniiProcessingResult` (v2.2 preview)`fetch($location, $metadata, $callback)``POST /files/fetch``ScaniiPendingResult``retrieve($id)``GET /files/{id}``ScaniiProcessingResult``retrieveTrace($id)``GET /files/{id}/trace``?ScaniiTraceResult` (v2.2 preview)`ping()``GET /ping``bool``createAuthToken($timeoutSeconds)``POST /auth/tokens``ScaniiAuthToken``retrieveAuthToken($id)``GET /auth/tokens/{id}``ScaniiAuthToken``deleteAuthToken($id)``DELETE /auth/tokens/{id}``void``retrieveAccountInfo()``GET /account.json``ScaniiAccountInfo`Full API reference: .

Regional endpoints
------------------

[](#regional-endpoints)

ConstantEndpoint`ScaniiTarget::US1``https://api-us1.scanii.com``ScaniiTarget::EU1``https://api-eu1.scanii.com``ScaniiTarget::EU2``https://api-eu2.scanii.com``ScaniiTarget::AP1``https://api-ap1.scanii.com``ScaniiTarget::AP2``https://api-ap2.scanii.com``ScaniiTarget::CA1``https://api-ca1.scanii.com``ScaniiTarget::AUTO``https://api.scanii.com` — **deprecated**, does not guarantee regional data placementPass any string URL for a custom or local endpoint:

```
$client = ScaniiClient::create('key', 'secret', 'http://localhost:4000');
```

Local development with scanii-cli
---------------------------------

[](#local-development-with-scanii-cli)

Run the integration tests against a local mock server — no real credentials needed:

```
docker run -d --name scanii-cli -p 4000:4000 ghcr.io/scanii/scanii-cli:latest server
composer install
composer test
```

Test credentials: key `key`, secret `secret`, endpoint `http://localhost:4000`.

Migration from `uvasoftware/scanii-php`
---------------------------------------

[](#migration-from-uvasoftwarescanii-php)

```
-"uvasoftware/scanii-php": "^5.0"
+"scanii/scanii-php": "^6.0"
```

The PHP namespace is unchanged (`Scanii\…`). Other notable changes:

- The runtime no longer depends on Guzzle. Only `ext-curl` and `ext-json` (both stdlib).
- The autoloader uses PSR-4 — `src/Scanii/...` files moved up to `src/...`.
- Result objects use **public `readonly` properties** instead of getters:

    ```
    - $r->getFindings()
    + $r->findings
    ```
- `process` / `processAsync` / `fetch` now take an explicit nullable `?string $callback` last arg (previously implicit through metadata):

    ```
    - $client->fetch($url, $callback, $metadata)
    + $client->fetch($url, $metadata, $callback)
    ```
- Errors throw `Scanii\ScaniiException` (and `ScaniiAuthException`, `ScaniiRateLimitException` subclasses), not Guzzle exceptions.

The old composer coordinate `uvasoftware/scanii-php` is deprecated and will not receive further updates.

API documentation
-----------------

[](#api-documentation)

See  for the full Scanii API contract.

License
-------

[](#license)

Apache 2.0 — see [LICENSE](LICENSE).

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance93

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 79.7% 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

Every ~166 days

Recently: every ~20 days

Total

21

Last Release

35d ago

Major Versions

v2.1 → v3.x-dev2017-09-05

v3.2.2 → v4.0.12021-04-06

v4.0.2 → v5.0.12022-10-15

v5.2.0 → v6.0.02026-04-27

PHP version history (7 changes)v2.2.2PHP ^5.5 || ^7.0

v3.x-devPHP ^7.0

v3.1.0PHP ^7.3

v4.0.1PHP ^7.4 || ^8.0

v5.0.1PHP ^8.1

v5.1.0PHP ^8.1.2

v6.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/97554168ee096bf4bad69df4f127e7ca9a3edeba3a9244b616560c645bc66f96?d=identicon)[cleverfoo](/maintainers/cleverfoo)

---

Top Contributors

[![rferreira](https://avatars.githubusercontent.com/u/36054?v=4)](https://github.com/rferreira "rferreira (102 commits)")[![BernardoScantamburlo](https://avatars.githubusercontent.com/u/136368099?v=4)](https://github.com/BernardoScantamburlo "BernardoScantamburlo (15 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

composermalware-analysisphpscaniiantivirusscanningscaniicontent-securityav

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/scanii-scanii-php/health.svg)

```
[![Health](https://phpackages.com/badges/scanii-scanii-php/health.svg)](https://phpackages.com/packages/scanii-scanii-php)
```

###  Alternatives

[facebook/php-business-sdk

PHP SDK for Facebook Business

90923.5M35](/packages/facebook-php-business-sdk)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[marcocesarato/amwscan

AMWSCAN (Antimalware Scanner) is a php antimalware/antivirus scanner console script written in php for scan your project. This can work on php projects and a lot of others platform.

76418.8k2](/packages/marcocesarato-amwscan)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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