Skip to main content

Anti Spam

Decides if a comment is spam. The article context is optional, and if omitted the comment is evaluated for spam on its own, without context. The definition of spam is broad, from obvious commercial sales, through to probable malware (not checked, just signs of it in the comment, do not rely on this for security), through to SEO or link spam and much more.

First-pass screening: spam is decided by a fast first-pass screen alone; no comment gets a fuller assessment for spam. There are three outcomes. Spam (screen probability 0.85 or above): is_spam is true, confidence is the screen's probability, and reasoning is "Classified as spam by first-pass screening." Delete it. Suspected spam (0.50 up to 0.85): is_spam is false, suspected_spam is true, and suggestion holds a short message for the commenter. Send the comment back to its writer with the suggestion rather than deleting it: a real person can fix it, a spammer will not bother. Not spam (below 0.50): is_spam and suspected_spam are false, suggestion and reasoning are empty. If screening was unavailable the comment is answered as not spam with confidence 0 and reasoning "Not checked for spam: screening was unavailable.", and the check is not charged.

Header Parameters
X-User-Email email — REQUIRED

Account email address, for authentication

X-API-Key string — REQUIRED

API key owned by the user (email), for authentication

Request Body — REQUIRED
comment string — REQUIRED

The comment text to be evaluated for spam.

article_context_id uuid

Optional. UUID to identify the article context.

Responses
200

Successful response - returns JSON result from spam evaluation.

Schema — OPTIONAL
reasoning string

How the verdict was reached. "Classified as spam by first-pass screening." for spam; "Not checked for spam: screening was unavailable." when screening gave no answer; empty otherwise.

confidence number

Possible values: value ≤ 1

Confidence (0-1) in the verdict given: in spam when is_spam is true, in not spam when it is false. 0 when the comment was not screened.

is_spam boolean

True if the comment is spam (screen probability 0.85 or above) and should be deleted; false otherwise, including for suspected spam.

suspected_spam boolean — OPTIONAL

True if the comment looks like spam but not surely (screen probability 0.50 up to 0.85). It is not spam and should not be deleted: send it back to the commenter with the suggestion, as for a comment that needs revision. Always false when is_spam is true.

suggestion string — OPTIONAL

A short message for the commenter of a suspected-spam comment, saying what to change: "This looks like spam. How about removing the link?" when the comment contains a link, otherwise "This reads like promotion. How about saying what you think about the discussion?". Empty unless suspected_spam is true.

400

Bad Request - Missing or invalid parameters.

401

Unauthorized - Missing or incorrect authentication.