Developer Integration

Spam Detector REST API Documentation

Easy-to-use JSON API for real-time bilingual spam detection. Use this documentation to integrate with your web apps, mobile apps, or backend SMS pipelines.

POST/api/v1/spam/check
No Auth Required (Open API)120 req / min
Host Base URLhttps://spam-detector.kaptainmedia.com
Request Content-Typeapplication/json
CORS SupportAccess-Control-Allow-Origin: *

Request Specification

Send a JSON object containing the text message or content string to evaluate for spam keywords and patterns.

FieldTypeRequiredDescription
contentstringYesThe text content or SMS message to scan. Maximum length is 100,000 characters. Supports English, Bangla, and mixed Unicode.
Example Request Payload
{
  "content": "Congratulations! You have won $10,000 cash. Click here to claim your free reward."
}

Client Integration Code

Terminal Command
curl -X POST "https://spam-detector.kaptainmedia.com//api/v1/spam/check" \
  -H "Content-Type: application/json" \
  -d '{"content": "Congratulations! You have won $10,000 cash. Click here to claim your free reward."}'

Response Schemas & Statuses

200 OK (Spam Detected)
{
  "success": true,
  "isSpam": true,
  "status": "Spam Detected",
  "summary": {
    "totalMatches": 2,
    "englishMatches": 2,
    "banglaMatches": 0,
    "categories": [
      "Financial Scams & Lottery",
      "Phishing & Fake Offers"
    ]
  },
  "matches": [
    {
      "line": 1,
      "keyword": "won cash",
      "language": "English",
      "category": "Financial Scams & Lottery",
      "matchedText": "won $10,000 cash"
    },
    {
      "line": 1,
      "keyword": "claim your free",
      "language": "English",
      "category": "Phishing & Fake Offers",
      "matchedText": "claim your free"
    }
  ],
  "message": "Content flagged as spam."
}

Response Fields Reference

Field PathTypeDescription
successbooleanIndicates whether the request was successfully processed.
isSpambooleantrue if one or more prohibited spam keywords were found; otherwise false.
statusstringHigh-level status: "Spam Detected" or "Clean / Not Spam".
summary.totalMatchesnumberTotal occurrences of detected spam keywords across the entire text.
summary.englishMatchesnumberTotal matches originating from the English keyword database.
summary.banglaMatchesnumberTotal matches originating from the Bangla keyword database.
summary.categoriesstring[]Array of unique spam categories detected (e.g. Financial Scams & Lottery, Phishing, Adult/Gambling).
matches[]object[]Detailed list of matches including line, keyword, language, category, and matchedText.
messagestringHuman-readable summary verdict describing the detection outcome.

Live Interactive API Tester

Test the live endpoint directly from your browser. Click any preset sample or type custom message text.

Presets:
Payload: 93 chars