Skip to main content

Profanity Filter API

The profanity API checks for profanity in the given text - it provides a 0/1 label for each token, where 1 indicates profanity was detected. Note that as with any profanity check API, there will be terms specific to different industries and audiences that are not captured; please contact us with any feedback.

Try it out

Sample Code

curl -X POST https://api.sapling.ai/api/v1/profanity \
-H "Content-Type: application/json" \
-d '{"key":"<api-key>", "text":"This is so damn stupid"}'

Sample Response

{
"labels": [
0,
0,
0,
1,
1
],
"toks": [
"This",
"is",
"so",
"damn",
"stupid."
]
}

Request Parameters

POST to https://api.sapling.ai/api/v1/profanity

key: String
32-character API key.

text: String
Text to check for profanity.

Response Parameters

The profanity filter API response contains two fields:

  1. toks: The tokens (words) detected in the sentence.
  2. labels: For each token, 0 (not profanity) or 1 (profanity).