CleanTalk service API for C#
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


CleanTalk service API for C#. It is invisible protection from spam, no captches, no puzzles, no animals and no math.

Actual API documentation

How does API stop spam?

API uses several simple tests to stop spammers.

  • Spam bots signatures.
  • Blacklists checks by Email, IP, web-sites domain names.
  • JavaScript availability.
  • Comment submit time.
  • Relevance test for the comment.

How does API works?

API sends a comment's text and several previous approved comments to the servers. Servers evaluates the relevance of the comment's text on the topic, tests on spam and finaly provides a solution - to publish or put on manual moderation of comments. If a comment is placed on manual moderation, the plugin adds to the text of a comment explaining the reason for the ban server publishing.


  • .Net Framawork 4.5

SPAM test for text comment sample

    public const string AuthKey = "auth key";

    public class CheckMessageTests
        private ICleartalk _cleantalk;

        public void NotSpamMessageTest()
            var req1 = new CleantalkRequest(AuthKey)
                Message = "This is great storm!",
                SenderInfo = new SenderInfo
                    Refferrer = "",
                    UserAgent = "Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.12"
                SenderIp = "",
                SenderEmail = "",
                SenderNickname = "Mike",
                IsJsEnable = 1,
                SubmitTime = 12

            Debug.WriteLine("req1=" + WebHelper.JsonSerialize(req1));
            var res1 = _cleantalk.CheckMessage(req1);
            Debug.WriteLine("res1=" + WebHelper.JsonSerialize(res1));
            Assert.AreEqual(0, res1.IsInactive);
            Assert.IsTrue(res1.IsAllow.With(x => x.Value));

API Response description

API returns response object:

  • allow (0|1) - allow to publish or not, in other words spam or ham
  • comment (string) - server comment for requests.
  • id (string MD5 HEX hash) - unique request idenifier.
  • errno (int) - error number. errno == 0 if requests successfull.
  • errtstr (string) - comment for error issue, errstr == null if requests successfull.