Anti-Spam API

Anti-Spam API: one call to check a sign-up, comment or order for spam

Send the sender's email, IP and message to the CleanTalk cloud and get allow or deny back in about 0.1 second. No CAPTCHA for your visitors, no word lists to maintain, works with any stack.

  • Three methods, one access key: sign-ups, messages, bot detection on any page
  • JSON over HTTPS, libraries for PHP, Python, Ruby and C#
  • Unlimited API calls, $12 per year per website
  • Free 7-day trial, no credit card
Full access during the trial. Spam checks are not counted and never limited.
In short

Your backend asks, the CleanTalk cloud answers. The decision is based on a shared blocklist fed by more than a million protected websites, behaviour signals from the sender's browser and the text itself.

  • check_newuser for registrations and sign-ups.
  • check_message for comments, reviews, contact forms and orders.
  • check_bot for page views and background requests.
1,100,000+websites protected by CleanTalk
5,000,000+spam reports processed every month
3 methodsone access key, any language

What the API checks

Pick the method that matches the action on your site. Every method returns a decision, a short reason and the raw signals, so you can block, hold for moderation or just log.

check_newuser

Sign-ups and registrations

Email, IP, nickname and the sender's browser data. Catches bot accounts, disposable mailboxes and throwaway sign-ups before they reach your database.

check_message

Comments, reviews, forms

Text plus sender data. Stops link spam, SEO spam and scripted submissions in contact forms, comments, reviews and checkout, without blocking real people.

check_bot

Page views and requests

IP plus a token from the front-end script. Lets you detect bots on any page or endpoint, not only on forms, and rate-limit them by IP activity.

 

Example: check a registration

Request: POST https://moderate.cleantalk.org/api2.0

{
  "method_name": "check_newuser",
  "auth_key": "your_access_key",
  "sender_email": "stop_email@example.com",
  "sender_ip": "127.0.0.1",
  "sender_nickname": "John",
  "js_on": 1,
  "submit_time": 12
}

Response

{
  "allow": 0,
  "comment": "*** Forbidden. Sender blacklisted. ***",
  "codes": "FORBIDDEN BL",
  "account_status": 1
}

allow: 1 means let it through, allow: 0 means spam. The comment field is safe to show to the user. The address stop_email@example.com always returns spam, use it to test your integration.

 

How it works

  1. Add one script tag to your pages (optional, improves accuracy). It collects browser signals and gives you an event_token for the request.
  2. On submit, your backend sends the form data and the token to the API. One HTTPS POST with JSON, from any language.
  3. CleanTalk checks the sender in real time. Against the cloud blocklist of IPs and emails reported by a million sites, against behaviour signals and against the text.
  4. You act on the answer. Block, hold for moderation or log. Wrong decision? Send it back with send_feedback and the cloud learns.

 

Why an API instead of a CAPTCHA

Nothing for the visitor to solve

The check runs on the server side and in the background. Real users never see a puzzle, so sign-up and checkout conversion stays intact.

Works where CAPTCHA does not

Mobile apps, chat bots, email-to-ticket systems, imports and any backend that accepts user content can call the API. There is no widget to render.

Decision, not just a score

You get allow or deny plus the reason. No thresholds to tune, no model to train, no word lists to keep up to date.

Shared intelligence

A bot blocked on one of a million CleanTalk sites is known to yours as well. Your own feedback improves the cloud for everyone.

 

Libraries and examples

Language How to get it Notes
PHP Composer package cleantalk/php-antispam 600,000+ downloads, used by the official CMS plugins
Python PyPI package cleantalk-python-antispam Separate Django package on GitHub
Ruby RubyGems cleantalk 180,000+ downloads
C# / .NET GitHub CleanTalk/csharp-antispam .NET and .NET Core, ASP.NET middleware example
Go, curl, Wget Code samples in the docs Plain HTTPS POST, no library needed
Node.js, Laravel, Yii Community library and framework packages Linked from the docs

Every method is a plain HTTPS POST with JSON, so any language with an HTTP client works.

Pricing

$12 per year for one website. API calls are unlimited, spam checks are not counted. Packages for 3 to 40 websites cost less per site. Start with a free 7-day trial, no credit card required.

 

See it without code

Open Am I a Bot to run the bot check on yourself, or paste an address into the Email Checker: both pages show the same signals the API returns.

Need reputation data instead of a decision?

If you want raw data about an IP or email (spam rate, last seen, disposable or not, country, network type) rather than an allow or deny answer, use the Block Lists API: spam_check and email_check. See IP Reputation API and Email Reputation API.

FAQ

What is an anti-spam API?

An anti-spam API is a web service your backend calls to find out whether a form submission, sign-up or comment is spam. You send the sender's email, IP and message, the service answers allow or deny. CleanTalk's API does this in one HTTPS call using a cloud database built from spam reports of a million websites.

Does it replace CAPTCHA?

Yes. The check runs on the server side and in the background, the visitor sees nothing. You can keep CAPTCHA as a fallback for borderline cases if you want.

How fast is it?

About 0.1 second from Europe. Set a client timeout of 3 to 5 seconds and let the submission through if the API does not answer: a missing verdict should never block a real customer.

Is there a free plan?

There is a free 7-day trial with full access and no card. After that the service is $12 per year per website.

Which languages are supported?

Any language that can send an HTTPS POST with JSON. Official libraries cover PHP, Python, Ruby and C#, the docs have examples for Node.js and Go.

Can I check IPs or emails without a form?

Yes, use spam_check and email_check from the Block Lists API, they return reputation data for any IP or email.