PHPackages                             kicken/copyleaks-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. kicken/copyleaks-api

ActiveLibrary[API Development](/categories/api)

kicken/copyleaks-api
====================

Copyleaks API

v2.2.2(8mo ago)01401MITPHPPHP &gt;=7.4CI failing

Since Dec 22Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/kicken/copyleaks-api)[ Packagist](https://packagist.org/packages/kicken/copyleaks-api)[ RSS](/packages/kicken-copyleaks-api/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (9)Used By (0)

Copyleaks API v3 Implementation
===============================

[](#copyleaks-api-v3-implementation)

This is a simple [Copyleaks API version 3](https://api.copyleaks.com/documentation/v3) implementation.

Install
-------

[](#install)

The easiest way to install this is to use composer.

```
composer require kicken/copyleaks-api

```

Usage
-----

[](#usage)

First, create a new instance of the **CopyleaksAPI** class. Then you can use the *scans()* and *downloads()* methods to access the api endpoints.

Here are quick examples to help you get going. Read the library source for more details about features and how to use the library.

**Submit a document for scanning using a URL.**

```
const API_EMAIL = 'test@example.com';
const API_KEY = 'secret_api_key';

$client = new CopyleaksAPI(API_EMAIL, API_KEY);

//Setup callback URLs
$scanId = mt_rand();
$documentUrl = 'https://example.com/webhook.php?scan=' . $scanId . '&action=download';
$statusUrl = 'https://example.com/webhook.php?scan=' . $scanId . '&action=status&status={STATUS}';

//Submit scan request
$parameters = new SubmitUrlParameters($documentUrl, $scanId, $statusUrl);
$client->scans()->submitURL($parameters);

```

**Export results when complete**

```
const API_EMAIL = 'test@example.com';
const API_KEY = 'secret_api_key';

$json = json_decode(file_get_contents('php://input'));
$data = Completed::createFromJsonObject($json);

$matchMap = [
    'internet' => $data->results->internet,
    'database' => $data->results->database
];

$exportId = date('Ymd\tHis');
$completeHook = 'https://example.com/webhook.php?' . http_build_query([
        'scan' => $scanId,
        'action' => 'export',
        'what' => 'complete'
    ]);
$exportParameters = new ExportParameters($scanId, $exportId, $completeHook);
foreach ($matchMap as $type => $matchList){
    /** @var ResultItem $resultItem */
    foreach ($matchList as $resultItem){
        $resultParams = new ResultParameters($resultItem->id, 'https://example.com/webhook.php?' . http_build_query([
                'scan' => $scanId,
                'action' => 'export',
                'what' => 'result',
                'id' => $resultItem->id
            ]));
        $exportParameters->addResult($resultParams);
    }
}

$client = new CopyleaksAPI(API_EMAIL, API_KEY);
$client->downloads()->export($exportParameters);

```

Login token caching
-------------------

[](#login-token-caching)

Copyleaks recommends caching and re-using the provided authorization token as it is valid for 48-hours. This library, by default, will cache the token in memory. To cache the token elsewhere (such as to persistent storage), you can provide a custom implementation of the AuthorizationCache interface.

Known issues
------------

[](#known-issues)

Not all endpoints and model properties are implemented yet.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance61

Regular maintenance activity

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.9% 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 ~287 days

Recently: every ~202 days

Total

7

Last Release

250d ago

Major Versions

v1.1.0 → v2.0.02023-06-24

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

v2.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/93485c3a28acd5b5cc4649ef8081907889270d7c7a2832fa8aa19e31f9c688ac?d=identicon)[kicken](/maintainers/kicken)

---

Top Contributors

[![kicken](https://avatars.githubusercontent.com/u/6234547?v=4)](https://github.com/kicken "kicken (31 commits)")[![abedzoubi-mawdoo3](https://avatars.githubusercontent.com/u/64753322?v=4)](https://github.com/abedzoubi-mawdoo3 "abedzoubi-mawdoo3 (2 commits)")

---

Tags

hacktoberfest

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kicken-copyleaks-api/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

517.9M7](/packages/avalara-avataxclient)[alexacrm/dynamics-webapi-toolkit

Web API toolkit for Microsoft Dynamics 365 and Dynamics CRM

81324.1k1](/packages/alexacrm-dynamics-webapi-toolkit)[commercetools/commercetools-sdk

The official PHP SDK for the commercetools Composable Commerce APIs

19281.5k](/packages/commercetools-commercetools-sdk)

PHPackages © 2026

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