Anti-Spam API - check_bot

Bot Detection API: a bot score for every visitor, before they touch a form

Two parts: a small script on the page collects browser signals, your backend sends the visitor's IP and token to the API and gets a bot_expectation score from 0 to 1 plus an allow or deny decision. Runs in the background on any page view. The visitor sees nothing.

  • Works on page views, searches and clicks, not only on form submits
  • Server-side decision: a request without the token is still scored by IP
  • Request frequency per IP for the last 10 minutes, hour and 24 hours
  • Part of Anti-Spam: $12 per year, unlimited calls, free 7-day trial
Full access during the trial, no credit card. Spam checks are not counted and never limited.
In short

Your page collects signals, your server asks the cloud, the cloud answers with a score. You decide what to do with bots: block, slow down or just log.

  • frontend_data: the script stores browser and behaviour signals under an event_token.
  • check_bot: your backend sends IP plus token, gets bot_expectation and allow.
  • For forms and sign-ups add check_message and check_newuser from the same API.
1,100,000+websites feeding IP reputation
0 to 1bot_expectation score, 0.5 is the default threshold
about 0.1 sresponse time from Europe

How it works

  1. Add the script to your pages: <script src="https://moderate.cleantalk.org/ct-bot-detector-wrapper.js" defer></script>. It collects browser and behaviour signals (frontend_data method) and stores them under an event_token.
  2. On a page view, a search, a click or a form submit, your backend sends a POST to https://moderate.cleantalk.org/api2.0 with method_name check_bot, the visitor's IP and the event_token.
  3. The cloud combines the front-end signals, the IP's history across 1,100,000+ websites and request frequency, and answers in real time.
  4. You decide: show the page, show a block page, slow the response down or just log the score.

 

Example

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

{
  "method_name": "check_bot",
  "auth_key": "your_access_key",
  "sender_ip": "127.0.0.1",
  "event_token": "sha_256_string_from_the_script",
  "page_url": "https://your-site.com/search?q=..."
}

Response

{
  "allow": 1,
  "bot_expectation": "0.2",
  "ip_frequency_10min": 2,
  "ip_frequency_1hour": 0,
  "ip_frequency_24hour": 0,
  "comment": "Allowed"
}

bot_expectation above 0.5 means allow = 0. The three ip_frequency fields show how many events this IP produced in the last 10 minutes, hour and 24 hours, useful for your own rate limits.

 

Why server-side

No JavaScript, still scored

Client-only fingerprinting scripts are easy to skip: a bot that does not run JavaScript never gets scored. With check_bot a request without the token is still checked by IP reputation and frequency.

Forged tokens do not help

The decision is made on your server with the cloud's answer, so a bot cannot talk itself into an allow by editing the page.

Shared IP intelligence

An IP caught spamming or brute-forcing on one of a million CleanTalk sites is known to yours as well.

Nothing for the visitor to solve

No CAPTCHA, no puzzle, no delay. Real users never notice the check.

 

Where to use it

Search and catalogue pages

The pages that get scraped most, where a form-only check never runs.

Pricing and stock endpoints

Hit by price bots around the clock. Score the request, slow down or block.

Sign-up and login pages

Score the visitor before the form is even submitted, then add check_newuser on submit.

Internal APIs and app backends

Send the IP, get a score. No widget to render.

For forms, comments and sign-ups use check_message and check_newuser from the same Anti-Spam API: they add email and text analysis on top of the bot score.

Libraries and examples

The same access key and libraries as the Anti-Spam API: PHP (Composer package cleantalk/php-antispam, plus the php-checkbot library with a search form example), Python (PyPI package cleantalk-python-antispam), Ruby (gem cleantalk), C# (.NET and .NET Core), examples for curl, Wget and Go in the docs. Every method is a plain HTTPS POST with JSON.

Pricing

check_bot is part of Anti-Spam: $12 per year for one website, unlimited API calls. Packages for 3 to 40 websites cost less per site. Start with a free 7-day trial, no credit card required.

 

See it work

Open cleantalk.org/am-i-a-bot in your browser: the page runs the same check on you and shows the score and the signals behind it.

See also: Anti-Spam API for forms, comments and sign-ups, IP Reputation API and Email Reputation API for raw reputation data. Method reference: check_bot.

FAQ

What is a bot detection API?

A web service that tells your server whether a request comes from a human or an automated script. CleanTalk's check_bot returns a probability (bot_expectation) and a decision (allow) using browser signals, IP reputation and request frequency.

Does it need JavaScript on the page?

The script improves accuracy, but a request without a token is still scored by IP reputation and frequency. That is the point of doing it server-side.

Will it block search engines?

The decision is yours: check_bot returns a score and a verdict, your code decides whom to block. Keep your own allow list for crawlers you want to let through and run the check only on the pages that matter.

How fast is it?

About 0.1 second from Europe. Set a client timeout of 3 to 5 seconds and fall back to allow if the cloud does not answer.

Is there a free plan?

Free 7-day trial with full access, no card. Then $12 per year per website, API calls are unlimited.

Can I see it work before integrating?

Yes. Open cleantalk.org/am-i-a-bot: the page runs the same check on you and shows the score and the signals behind it.