PHPackages                             capy/capy\_api\_client - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. capy/capy\_api\_client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

capy/capy\_api\_client
======================

Capy PHP HTTP client library makes verify puzzle/avatar and evaluate blacklist/riskbase for capy's services become easier

1.0.7(9y ago)065MITPHPPHP &gt;=5.4

Since Aug 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mincom2015/capy_api_php_client)[ Packagist](https://packagist.org/packages/capy/capy_api_client)[ RSS](/packages/capy-capy-api-client/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (2)Versions (9)Used By (0)

capy-api-php-client
===================

[](#capy-api-php-client)

### Capy PHP client library makes verify puzzle/avatar and evaluate blacklist/riskbase for capy's services become easier:

[](#capy-php-client-library-makes-verify-puzzleavatar-and-evaluate-blacklistriskbase-for-capys-services-become-easier)

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

[](#installation)

The Capy PHP library client Provider can be installed via Composer by requiring the capy/capy\_api\_client package in your project's composer.json .

```
 "require": {
    "capy/capy_api_client": "~1.0"
 },
```

or

Require this package with composer:

```
composer require capy/capy_api_client
```

Usage
-----

[](#usage)

### I. Puzzle verify:

[](#i-puzzle-verify)

***Step 1*: Create new instance**

$puzzleClient = new PuzzleClient($privateKey, $timeout);

With parameters:

- $privateKey: An API key is a key used for verifying site ownership. It can be obtained from [show privatekey](https://jp.api.capy.me/account/edit/)
- $timeOut : Request to server CAPY is Timeout (seconds)

***Step 2*: Implement verify**

- $result = $puzzleClient.verify($capy\_challengekey, $capy\_answer)

With parameters:

- $capy\_chanllengekey = $\_POST\['capy\_challengekey'\];
- $capy\_answer = $\_POST\['capy\_answer'\];

***Step 3*: Handle data result**

```
switch ($result) {
    case PuzzleConst::Success:
      rint "1";
        break;
    case PuzzleConst::IncorrectAnswer:
        print "2";
        break;
    case PuzzleConst::InvalidRequestMethod:
        print "3";
        break;
    case PuzzleConst::InvalidPostParameters:
        print "4";
        break;
    case PuzzleConst::InvalidPrivateKey:
        print "5";
        break;
    case PuzzleConst::InvalidChallengeKey:
        print "6";
        break;
    case PuzzleConst::InvalidCaptchaKey:
        print "7";
        break;
    case PuzzleConst::InvalidOnetimeCaptcha:
        print "8";
        break;
    case PuzzleConst::IsNotActive:
        print "9";
        break;
    case PuzzleConst::UnknownError:
        print "2";
        break;
    case PuzzleConst::Timeout:
        print "2";
        break;
}
```

### II. Avatar verify:

[](#ii-avatar-verify)

***Step 1*: Create new instance**

$avatarClient = new AvatarClient($privateKey, $timeout);

With parameters:

- $privateKey: An API key is a key used for verifying site ownership. It can be obtained from [show privatekey](https://jp.api.capy.me/account/edit/)
- $timeOut : Request to server CAPY is Timeout (seconds)

***Step 2*: Implement verify**

- $result = $avatarClient.verify($capy\_challengekey, $capy\_answer)

With parameters:

- $capy\_chanllengekey = $\_POST\['capy\_challengekey'\];
- $capy\_answer = $\_POST\['capy\_answer'\];

***Step 3*: Handle data result**

```
switch ($result){
    case AvatarConst::Success;
        print "1";
        break;
    case AvatarConst::IncorrectAnswer;
        print "2";
        break;
    case AvatarConst::InvalidRequestMethod;
        print "3";
        break;
    case AvatarConst::InvalidPostParameters;
        print "4";
        break;
    case AvatarConst::InvalidChallengeKey;
        print "5";
        break;
    case AvatarConst::IsNotActive;
        print "6";
        break;
    case AvatarConst::UnknownError;
        print "7";
        break;
    case AvatarConst::Timeout;
        print "8";
        break;
}
```

### III. Blacklist evaluate:

[](#iii-blacklist-evaluate)

***Step 1*: Create new instance**

$blacklistClient = new BlacklistClient($apiKey, $timeout, $blacklist\_key);

With parameters:

- $apiKey: An API key is a key used for verifying site ownership. It can be obtained from [show api key](https://jp.api.capy.me/account/edit/)
- $timeOut : Request to server CAPY is Timeout (seconds)
- $blacklist\_key = The key will get from capy server [show blacklist key](https://jp.api.capy.me/blacklist/) ;

***Step 2*: Implement verify**

- $result = $blacklistClient.evaluate($ip\_address)

With parameters:

- $ip\_address = $\_POST\['ip\_address'\];

$result value:

- \["result"=&gt;BlacklistConst::TooManySuccesses, "value"=&gt;0.1\]

***Step 3*: Handle data result**

```
switch ($result["result"]) {
    case BlacklistConst::TooManySuccesses:
        print "1";
        break;
    case BlacklistConst::TooMayFailures:
        print "2";
        break;
    case BlacklistConst::NotFound:
        print "3";
        break;
    case BlacklistConst::FoundButExpired:
        print "4";
        break;
    case BlacklistConst::InWhiteList:
        print "5";
        break;
    case BlacklistConst::InvalidParameters:
        print "6";
        break;
    case BlacklistConst::InvalidIpAddress:
        print "7";
        break;
    case BlacklistConst::InvalidPrivateKey:
        print "8";
        break;
    case BlacklistConst::InvalidBlacklistKey:
        print "9";
        break;
    case BlacklistConst::CalculationError:
        print "10";
        break;
    case BlacklistConst::TimeOut:
        print "11";
        break;
    case BlacklistConst::Others:
        print "12";
        break;
    case BlacklistConst::UnknownError:
        print "13";
        break;
}
```

### IV. Riskbase evaluate:

[](#iv-riskbase-evaluate)

***Step 1*: Create new instance**

$riskbaseClient = new RiskbaseClient($apiKey, $timeout, $riskbase\_key);

With parameters:

- $apiKey: An API key is a key used for verifying site ownership. It can be obtained from [show api key](https://jp.api.capy.me/account/edit/)
- $timeOut : Request to server CAPY is Timeout (seconds)
- $riskbase\_key = The key will get from capy server [show riskbase key](https://jp.api.capy.me/riskbase/) ;

***Step 2*: Implement verify**

- $result = $riskbaseClient.evaluate($capy\_data)

With parameters:

- $capy\_data = $\_POST\['capy\_data'\];

$result value:

- \["result"=&gt;RiskbaseConst::Success, "value"=&gt;0.7, "reasons"=&gt;\[RiskbaseConst::DifferentISP, RiskbaseConst::DifferentCountry\]\]

***Step 3*: Handle data result**

```
switch ($result["result"]) {
    case RiskbaseConst::Success;
        print "1";
        break;
    case RiskbaseConst::InvalidParameters;
        print "2";
        break;
    case RiskbaseConst::IncorrectParameters;
        print "3";
        break;
    case RiskbaseConst::InvalidPrivateKey;
        print "4";
        break;
    case RiskbaseConst::InvalidUsername;
        print "5";
        break;
    case RiskbaseConst::EvaluationError;
        print "6";
        break;
    case RiskbaseConst::DataBaseError;
        print "7";
        break;
    case RiskbaseConst::NotInDataBase;
        print "8";
        break;
    case RiskbaseConst::BadRequest;
        print "9";
        break;
    case RiskbaseConst::TimeOut;
        print "10";
        break;
    case RiskbaseConst::UnknownError;
        print "11";
        break;
}
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~0 days

Total

7

Last Release

3591d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11662786?v=4)[Hoang Truong Minh](/maintainers/mincom2015)[@mincom2015](https://github.com/mincom2015)

---

Top Contributors

[![kiyoaki](https://avatars.githubusercontent.com/u/218958?v=4)](https://github.com/kiyoaki "kiyoaki (1 commits)")[![mincom2015](https://avatars.githubusercontent.com/u/11662786?v=4)](https://github.com/mincom2015 "mincom2015 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/capy-capy-api-client/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[dreamfactory/df-core

DreamFactory(tm) Core Components

1652.0k38](/packages/dreamfactory-df-core)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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