Download the PHP package automattic/akismet-sdk without Composer

On this page you can find all versions of the php package automattic/akismet-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package akismet-sdk

Akismet PHP SDK

Official PHP SDK for the Akismet spam protection service by Automattic.

Note: This SDK is for non-WordPress PHP applications. WordPress sites should use the official Akismet plugin.

Requirements

Installation

If you don't have a PSR-18 HTTP client installed, add one:

Quick Start

How It Works

Features

API Methods

Method Description
verifyKey() Verify your API key is valid
check($content) Check if content is spam
submitSpam($content) Report missed spam (false negative)
submitHam($content) Report false positive
getSubscription() Get subscription / account plan information
getStats($interval) Get historical spam/ham statistics and breakdown
getUsageLimit() Get API usage stats and limits
getExtendedUsageLimit() Get usage stats with notice level and upgrade recommendation
getKeySites() Get sites using your API key (JSON format only; CSV is not supported)
getAccessToken() Exchange API key for a scoped access token (stats pages only, not for API calls)

Integration Identification

If you're building a framework integration (Drupal, Laravel, Symfony, etc.), identify your integration via applicationUserAgent. This is prepended to the SDK's User-Agent header so Akismet can track compatibility and usage:

Framework Integration

Use ContentFactory to create Content objects from PSR-7 requests with automatic IP and user agent extraction:

Trusted Proxies

By default, ContentFactory::fromRequest() uses REMOTE_ADDR as the client IP. If your application runs behind a reverse proxy or load balancer, pass the proxy IPs to trust forwarded headers (X-Forwarded-For, X-Real-IP, CF-Connecting-IP, True-Client-IP):

Submitting Feedback

Help improve Akismet's accuracy by reporting mistakes:

Error Handling

All SDK exceptions implement AkismetException, so you can catch everything with a single type:

Exception When
InvalidApiKeyException API key is invalid or revoked
ValidationException Invalid input (e.g., bad IP address, malformed month format)
ClientErrorException HTTP 4xx client errors (excluding 429)
RateLimitException HTTP 429 — too many requests
NetworkException Connection failures or DNS resolution errors
ServerException HTTP 5xx or unexpected API response body

API keys are automatically redacted from exception messages to prevent credential leakage in logs.

Testing

Use test mode during development to avoid affecting your accuracy metrics:

In test mode:

Documentation

License

GPL-2.0-or-later


All versions of akismet-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
php-http/discovery Version ^1.14
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package automattic/akismet-sdk contains the following files

Loading the files please wait ...