PHPackages                             fyrts/akismet - 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. fyrts/akismet

ActiveLibrary[API Development](/categories/api)

fyrts/akismet
=============

PHP library for implementing Akismet spam filtering

1.1.0(4y ago)28.7k↓46.9%MITPHPPHP ^7.1|^8.0

Since Aug 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Fyrts/akismet)[ Packagist](https://packagist.org/packages/fyrts/akismet)[ RSS](/packages/fyrts-akismet/feed)WikiDiscussions main Synced 1mo ago

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

Akismet
=======

[](#akismet)

PHP client for the [Akismet API](https://akismet.com/development/). [Akismet terms of use](https://akismet.com/tos/) apply to usage of this library.

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

[](#installation)

`composer require fyrts/akismet`

Usage
-----

[](#usage)

```
use Akismet\Akismet;
use Akismet\Comment;

// Instantiate API client with your API key and website root URL
$akismet = new Akismet('api-key', 'https://www.example.org');

// Define content to check for spam
$comment = new Comment();
$comment->setAuthor('Author Name')
        ->setAuthorEmail('author@example.org')
        ->setContent('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');

// Optionally include additional environment variables for more accurate result
$comment->includeServerVariables();

// Check for spam
$result = $akismet->check($comment);

if ($result->isSpam) {
    echo 'Comment is spam';
}
if ($result->isDiscardable) {
    echo 'Comment is safe to discard';
}
```

It's possible to set Akismet parameters directly if preferred. A list of parameters is available at [the official API documentation](https://akismet.com/development/api/#comment-check).

```
$comment = new Comment([
    'comment_author' => 'Author Name',
    'comment_author_email' => 'author@example.org',
    'comment_content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
]);
$comment->includeServerVariables();
```

If you'd like to provide all parameters by hand, you can just pass the array to the client directly.

```
$result = $akismet->check([
    'comment_author' => 'Author Name',
    'comment_author_email' => 'author@example.org',
    'comment_content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
]);
```

### Setting global parameters

[](#setting-global-parameters)

For checking multiple comments, it's possible to set global language, charset and environment parameters for all requests.

```
$akismet->setLanguage('en');
$akismet->setCharset('UTF-8');
$akismet->includeServerVariables();

$result = $akismet->check($comment);
```

Available endpoints
-------------------

[](#available-endpoints)

The following endpoints are accessible through the Akismet\\Akismet class:

- `Akismet::verifyKey()`
- `Akismet::check($comment)` or `Akismet::commentCheck($comment)`
- `Akismet::submitSpam($comment)`
- `Akismet::submitHam($comment)`

Available comment parameter methods
-----------------------------------

[](#available-comment-parameter-methods)

The following methods are accessible through the Akismet\\Comment class for setting parameters:

- `Comment::setUserIp($ip)`
- `Comment::setUserAgent($user_agent)`
- `Comment::setReferrer($referrer)` or `Comment::setReferer($referrer)`
- `Comment::setPermalink($permalink)`
- `Comment::setType($type)` or `Comment::setCommentType($type)`
- `Comment::setAuthor($author)` or `Comment::setCommentAuthor($author)`
- `Comment::setAuthorEmail($email)` or `Comment::setCommentAuthorEmail($email)`
- `Comment::setAuthorUrl($url)` or `Comment::setCommentAuthorUrl($url)`
- `Comment::setContent($content)` or `Comment::setCommentContent($content)`
- `Comment::setDate($date)` or `Comment::setCommentDate($date)`
- `Comment::setPostModifiedDate($date)` or `Comment::setCommentPostModifiedDate($date)`
- `Comment::setBlogLanguage($language)`
- `Comment::setBlogCharset($charset)`
- `Comment::setUserRole($role)`
- `Comment::setTest()`
- `Comment::setRecheckReason($reason)`

Any custom parameters can be set through `Comment::setParameter($key, $value)`.

Date parameters accept DateTime objects, unix timestamps or date strings in ISO 8601 format.

License
-------

[](#license)

`fyrts/akismet` is licensed under the MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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 ~432 days

Total

2

Last Release

1666d ago

PHP version history (2 changes)1.0.0PHP ^7.1

1.1.0PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fe7a44c5e07cf8dd0eed2941b88dcab03342fb149ede5347b3467bc17691d4e?d=identicon)[Fyrts](/maintainers/Fyrts)

---

Top Contributors

[![fyrts](https://avatars.githubusercontent.com/u/5918336?v=4)](https://github.com/fyrts "fyrts (2 commits)")

---

Tags

apiphpapisdkspamAkismet

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fyrts-akismet/health.svg)

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M468](/packages/saloonphp-saloon)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M24](/packages/php-opencloud-openstack)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

574.7M21](/packages/resend-resend-php)

PHPackages © 2026

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