Classify migration guide

Migrate from OOPSpam to Botpoison Classify

Three edits: swap the API key, point the same JSON request at Classify, and branch on Classify's label rather than on a threshold you chose for a score from 0 to 6. Your handler keeps its routes, its fields and its inbox.

Last verified

Migrate this project's spam filtering from OOPSpam to Botpoison Classify.
Follow the guide at https://botpoison.com/migrate/from-oopspam.md
Make the three edits it describes, and keep the form's fields and routes.

Why sites move off OOPSpam

OOPSpam returns a Score from 0 to 6, and the threshold is yours to pick; its docs treat 3 and above as spam. Classify's label carries a threshold that is published with its rate: it flags about 1 in 1,000 good messages at 0.8, counted across all the traffic in our reference set. A single site's own rate is usually higher; see labels and scores.

OOPSpam reads the fields you pick out of the form: content, senderIP, email. Classify can read every field the form posted, so a pitch in the company field counts too.

What maps to what

Key
OOPSpamAn X-Api-Key header
ClassifyA secret key, as a bearer token, an X-Api-Key header or secretKey
Endpoint
OOPSpamPOST to /v1/spamdetection on api.oopspam.com
ClassifyPOST to /classify on api.botpoison.com
What you send
OOPSpamcontent, senderIP, email and switches such as blockTempEmail
ClassifyThe message and email as content, with the same X-Api-Key header. senderIP has no counterpart
Answer
OOPSpamScore from 0 to 6, and Details on the checks that ran
Classifylabel, spam or clean, a score from 0 to 1, and the model
Threshold
OOPSpamYours to pick, 3 in the docs
ClassifySpam from 0.8, carried by the label

The three edits. Off OOPSpam, onto Classify

Swap the key

Replace the OOPSpam API key with a Classify secret key, kept in your server's environment like the old one.

Shell
OOPSPAM_KEY=xxxxxxxx
BOTPOISON_CLASSIFY_SECRET_KEY=sk_xxxxxxxx

Point the request at Classify

Keep the JSON request and the X-Api-Key header. Swap the URL and the key, send the message and email as content, name the model, and drop senderIP.

JavaScript
const oopspam = await fetch("https://api.oopspam.com/v1/spamdetection", {
const classify = await fetch("https://api.botpoison.com/classify", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": process.env.OOPSPAM_KEY,
"X-Api-Key": process.env.BOTPOISON_CLASSIFY_SECRET_KEY,
},
body: JSON.stringify({
content: req.body.message,
senderIP: req.ip,
email: req.body.email,
content: { message: req.body.message, email: req.body.email },
model: "spam-standard",
}),
});
const { Score } = await oopspam.json();
const { label, score } = await classify.json();

Branch on the label, tune with the score

The label carries the spam threshold, so there is no number to pick for it. The score is there for a review queue of your own.

JavaScript
if (Score >= 3) return fileAway(req.body);
if (label === "spam") return fileAway(req.body);
if (score >= 0.65) return holdForReview(req.body);

What behaves differently

One score. OOPSpam's Details says which check fired. Classify answers one score for the whole message.

An outage answers 503. It is not counted. Deliver the message as clean, so an outage never loses a real one.

Questions

What is the equivalent of a Score of 3?

There is none: the two scales are built differently. Start with the label, and set a review queue from the score if you want one. The labels and scores page lists how many good messages score above each point.

Can I test it before I switch?

Yes. With the secret key test, a message containing botpoison-test-spam answers spam and anything else answers clean. Test calls never count. See test mode.

Moving from Akismet instead?

See the guide from Akismet.

Sources

OOPSpam is a trademark of OOPSpam. Botpoison is not affiliated with OOPSpam.

Other migration guides

To Challenge

Invisible CAPTCHA alternative
  • v2 checkbox, v2 invisible or v3 score. Swap the script, the key and the siteverify call.

  • Drop the cf-turnstile widget. The check runs fresh on each Send and moves to one verify call.

  • Remove the h-captcha div and the form-encoded siteverify request. Nobody labels images again.

To Classify

Spam classifier
  • comment-check answers "true" or "false" as text. Classify answers a label, and a score to hold the borderline ones on.

Switch to Classify for free

Stop spam now
No credit card required
Three edits
Your fields stay as they are
Free to start