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/checkNo 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.
| Field | Type | Required | Description |
|---|---|---|---|
| content | string | Yes | The 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 Path | Type | Description |
|---|---|---|
| success | boolean | Indicates whether the request was successfully processed. |
| isSpam | boolean | true if one or more prohibited spam keywords were found; otherwise false. |
| status | string | High-level status: "Spam Detected" or "Clean / Not Spam". |
| summary.totalMatches | number | Total occurrences of detected spam keywords across the entire text. |
| summary.englishMatches | number | Total matches originating from the English keyword database. |
| summary.banglaMatches | number | Total matches originating from the Bangla keyword database. |
| summary.categories | string[] | 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. |
| message | string | Human-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