PHPackages                             zrashwani/key-pic - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zrashwani/key-pic

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zrashwani/key-pic
=================

psr7 compatible composer package for key pic spam detection webservice

1.0.2(10y ago)115MITPHPPHP &gt;=5.4.0

Since Nov 13Pushed 10y agoCompare

[ Source](https://github.com/zrashwani/KeyPic)[ Packagist](https://packagist.org/packages/zrashwani/key-pic)[ RSS](/packages/zrashwani-key-pic/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

Keypic
======

[](#keypic)

---

[![SensioLabsInsight](https://camo.githubusercontent.com/05faa05803c767c6c4aeeb0528c646e21cb374f95dafe411f1b76754620e6bbd/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f63323763343535312d616432622d343632312d623332642d6338346534626565363438392f6d696e692e706e67)](https://insight.sensiolabs.com/projects/c27c4551-ad2b-4621-b32d-c84e4bee6489)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2c7fb355c9c568c4b5ba8cab8fb91e70e1367861488b77d24a7843443a8a1892/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7a7261736877616e692f4b65795069632f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/zrashwani/KeyPic/?branch=master)

This library provides a wrapper to use [KeyPic](http://keypic.com) web service for spam detection, by using any [PSR-7](http://www.php-fig.org/psr/psr-7/) compliant request (`RequestInterface` objects).

How to Install
--------------

[](#how-to-install)

You can install this library with [Composer](http://getcomposer.org/). Drop this into your `composer.json`manifest file:

```
{
    "require": {
        "zrashwani/key-pic": "dev-master"
    }
}

```

Then run `composer install`.

How to use
----------

[](#how-to-use)

To use keypic web service with any request that implements [PSR-7](http://www.php-fig.org/psr/psr-7/):

```
require 'vendor/autoload.php';
use Zrashwani\KeyPic\KeyPic;

$keypicObj = new KeyPic($psrRequest); //initiate and configure keypic object
$keypicObj = $keypicObj->setFormID('YOUR_KEYPIC_FORM_ID') //set form ID
                       ->setDebug(true) // set debug mode
                       ->setTokenInputName("keypic_token"); //hidden input name
$token = $keypicObj->getToken();

if($psrRequest->getMethod() == "POST"){
    $data         = $psrRequest->getParsedBody();
    $email        = $data['EMAIL_INPUT'];
    $username     = $data['NAME_INPUT'];
    $message      = $data['MESSAGE_INPUT'];

    //Detect if entry is Spam? from 0% to 100%
    $spam = $keypicObj->isSpam($email, $username, $message);
    if($spam === false){
       echo "Cannot determine spam percentage.";
    }elseif($spam > 60){ //if spam percentage larger than certain number
        echo "user and/or submitted data seems spammy, spam percentage = ".$spam;
    }else{
        echo "Not Spam";
    }
}
```

In your form, place the call to `renderHtml()` method to render pixel image or javascript, along with keypic hidden token field as following:

```

    renderHtml(); ?>

```

How to Contribute
-----------------

[](#how-to-contribute)

1. Fork this repository
2. Create a new branch for each feature or improvement
3. Send a pull request from each feature branch

It is important to separate new features or improvements into separate feature branches, and to send a pull request for each branch.

All pull requests must adhere to the [PSR-2 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).

System Requirements
-------------------

[](#system-requirements)

- PHP 5.4.0+

License
-------

[](#license)

MIT Public License

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~0 days

Total

3

Last Release

3881d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/298baef5380170ffc9c8f276f59b7f099917717738aa6439ed037db29bb1efff?d=identicon)[zrashwani](/maintainers/zrashwani)

---

Top Contributors

[![zrashwani](https://avatars.githubusercontent.com/u/5447528?v=4)](https://github.com/zrashwani "zrashwani (21 commits)")

---

Tags

spamcaptchadetection

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/zrashwani-key-pic/health.svg)

```
[![Health](https://phpackages.com/badges/zrashwani-key-pic/health.svg)](https://phpackages.com/packages/zrashwani-key-pic)
```

###  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)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

344128.8M102](/packages/google-cloud-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[oat-sa/tao-core

TAO core extension

66140.1k108](/packages/oat-sa-tao-core)

PHPackages © 2026

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