Get rid of spam in your application.
Use our API to access Akismet’s powerful spam detection. One request in, one verdict out.
curl https://rest.akismet.com/1.1/comment-check \
-d api_key=YOUR_API_KEY \
-d blog=https://example.com \
-d user_ip=203.0.113.7 \
-d comment_type=comment \
-d comment_content="Cheap watches, click here"
// composer require automattic/akismet-sdk
use Automattic\Akismet\Akismet;
use Automattic\Akismet\DTO\Content;
$akismet = Akismet::create(
apiKey: 'YOUR_API_KEY',
site: 'https://example.com',
);
$result = $akismet->check( new Content(
userIp: $ip,
body: $content,
type: 'comment',
) );
$is_spam = $result->isSpam();
// npm install @automattic/akismet
import { Akismet } from '@automattic/akismet';
const akismet = new Akismet( {
apiKey: 'YOUR_API_KEY',
site: 'https://example.com',
} );
const result = await akismet.check( {
userIp: ip,
body: content,
type: 'comment',
} );
const isSpam = result.isSpam;
X-akismet-pro-tip: discard
Content-Type: text/plain
true
Spam, and safe to discard True means spam. The pro tip says it’s so blatant you can drop it without a second look.
Official: WordPress (opens in a new tab) · Drupal (opens in a new tab) · PHP SDK (opens in a new tab) · JavaScript SDK (opens in a new tab)
Node.js Python Ruby Go .NET community libraries
curl https://rest.akismet.com/1.1/comment-check \
-d api_key=YOUR_API_KEY \
-d blog=https://example.com \
-d user_ip=203.0.113.7 \
-d comment_type=comment \
-d comment_content="Cheap watches, click here"
// composer require automattic/akismet-sdk
use Automattic\Akismet\Akismet;
use Automattic\Akismet\DTO\Content;
$akismet = Akismet::create(
apiKey: 'YOUR_API_KEY',
site: 'https://example.com',
);
$result = $akismet->check( new Content(
userIp: $ip,
body: $content,
type: 'comment',
) );
$is_spam = $result->isSpam();
// npm install @automattic/akismet
import { Akismet } from '@automattic/akismet';
const akismet = new Akismet( {
apiKey: 'YOUR_API_KEY',
site: 'https://example.com',
} );
const result = await akismet.check( {
userIp: ip,
body: content,
type: 'comment',
} );
const isSpam = result.isSpam;
X-akismet-pro-tip: discard
Content-Type: text/plain
true
Spam, and safe to discard True means spam. The pro tip says it’s so blatant you can drop it without a second look.
curl https://rest.akismet.com/1.1/verify-key \
-d api_key=YOUR_API_KEY \
-d blog=https://example.com
// composer require automattic/akismet-sdk
use Automattic\Akismet\Akismet;
use Automattic\Akismet\Exception\InvalidApiKeyException;
$akismet = Akismet::create(
apiKey: 'YOUR_API_KEY',
site: 'https://example.com',
);
try {
$akismet->verifyKey();
$is_valid = true;
} catch ( InvalidApiKeyException $e ) {
$is_valid = false;
}
// npm install @automattic/akismet
import { Akismet, InvalidApiKeyError } from '@automattic/akismet';
const akismet = new Akismet( {
apiKey: 'YOUR_API_KEY',
site: 'https://example.com',
} );
let isValid = true;
try {
await akismet.verifyKey();
} catch ( error ) {
if ( ! ( error instanceof InvalidApiKeyError ) ) throw error;
isValid = false;
}
Content-Type: text/plain
valid
Key is valid Valid means the key works for this site. Anything else comes back as invalid.
curl https://rest.akismet.com/1.1/submit-spam \
-d api_key=YOUR_API_KEY \
-d blog=https://example.com \
-d user_ip=203.0.113.7 \
-d comment_type=comment \
-d comment_content="Cheap watches, click here"
// composer require automattic/akismet-sdk
use Automattic\Akismet\Akismet;
use Automattic\Akismet\DTO\Content;
$akismet = Akismet::create(
apiKey: 'YOUR_API_KEY',
site: 'https://example.com',
);
$akismet->submitSpam( new Content(
userIp: $ip,
body: $content,
type: 'comment',
) );
// npm install @automattic/akismet
import { Akismet } from '@automattic/akismet';
const akismet = new Akismet( {
apiKey: 'YOUR_API_KEY',
site: 'https://example.com',
} );
await akismet.submitSpam( {
userIp: ip,
body: content,
type: 'comment',
} );
Content-Type: text/plain
Thanks for making the web a better place.
Missed spam reported Akismet learns from what it missed. The reply is a plain thank-you, with no verdict to act on.
curl https://rest.akismet.com/1.1/submit-ham \
-d api_key=YOUR_API_KEY \
-d blog=https://example.com \
-d user_ip=203.0.113.7 \
-d comment_type=comment \
-d comment_content="Cheap watches, click here"
// composer require automattic/akismet-sdk
use Automattic\Akismet\Akismet;
use Automattic\Akismet\DTO\Content;
$akismet = Akismet::create(
apiKey: 'YOUR_API_KEY',
site: 'https://example.com',
);
$akismet->submitHam( new Content(
userIp: $ip,
body: $content,
type: 'comment',
) );
// npm install @automattic/akismet
import { Akismet } from '@automattic/akismet';
const akismet = new Akismet( {
apiKey: 'YOUR_API_KEY',
site: 'https://example.com',
} );
await akismet.submitHam( {
userIp: ip,
body: content,
type: 'comment',
} );
Content-Type: text/plain
Thanks for making the web a better place.
False positive reported Akismet learns from what it got wrong. The reply is a plain thank-you, with no verdict to act on.
Four calls cover the whole loop.
Verify your key once, check each submission, then report anything Akismet got wrong so it keeps learning.
Not sure where to start?
Read our getting started guide for an overview of the Akismet API: what to send, what comes back, and how to handle each answer.
Read the guide-
Get an API key and verify it
Every call carries your key and the site it’s for. Check both once with
verify-key. -
Check every submission
Send the content, the visitor’s IP address and a little context to
comment-check. It answers true for spam, false for real. -
Report what Akismet missed
When a moderator disagrees, send it back with
submit-spamorsubmit-ham, so the network learns from it.
Skip the plumbing.
-
Plugins and platforms
Official integrations for WordPress, Drupal, PHP and JavaScript, built and maintained by the Akismet team. Community plugins cover many other content management systems, forums and more.
- WordPress (opens in a new tab)
- Drupal (opens in a new tab)
- PHP SDK (opens in a new tab)
- JavaScript SDK (opens in a new tab)
-
Language libraries
Community-built libraries do all of the boring work for you, so you can focus on your app.
- Node.js
- Python
- Ruby
- Go
- .NET
- and more
-
Get in touch
Having trouble getting started, or just want to say hello? We’re happy to help.
Contact the team
Building with AI?
Works in apps built with Lovable, Base44, Bolt, Replit, v0, Cursor, Claude Code, Windsurf, and more. There’s nothing to install there: your app calls the Akismet API, and our prompt tells your AI how.
Get started with your AIOpen, and meant to be built on.
The Akismet API is open, and alternative uses of it are encouraged. The WordPress plugin is GPL and fine to use as a reference.
Get the OpenAPI spec Read the plugin source (opens in a new tab)
openapi: 3.0.3
info:
title: Akismet API
version: 1.1.0
servers:
- url: https://rest.akismet.com
paths:
/1.1/verify-key: …
/1.1/comment-check: …
/1.1/submit-spam: …
/1.1/submit-ham: …
/1.2/key-sites: …
/1.2/usage-limit: …
Explore the endpoints, or generate code to work with the API.