Detect bad words, swear words and profanity in a given text
The Bad Word Filter API uses natural language processing (NLP) to decode content into logical words ignoring punctuation, case, accent and other formatting details.
We also apply word transformations to detect obfuscation of bad words, for example converting "leetspeak" and repeating or spurious character sequences.
We then scan for words and sentences using several large catalogs of known and verified bad words.
You can select from two main word catalogs depending on your use-case and how strict you want the filter to behave.
You can also use this API to censor (mask) out bad words from the supplied text using the specified censor character.
This API uses a mostly English based catalog with some common swear words from other languages too, official support for more languages is currently in the pipeline.
The content to scan. This can be either a URL to load from, a file upload (multipart/form-data) or an HTML content string
censor-character
no
string
The character to use to censor out the bad words found
catalog
no
string
strict
Which catalog of bad words to use, we currently maintain two bad word catalogs:
strict - the largest database of bad words which includes profanity, obscenity, sexual, rude, cuss, dirty, swear and objectionable words and phrases. This catalog is suitable for environments of all ages including educational or children's content
obscene - like the strict catalog but does not include any mild profanities, idiomatic phrases or words which are considered formal terminology. This catalog is suitable for adult environments where certain types of bad words are considered OK
API Response
Parameter
Type
Description
is-bad
boolean
Does the text contain bad words
bad-words-total
integer
Total number of bad words detected
bad-words-list
array
An array of the bad words found
censored-content
string
The censored content (only set if censor-character has been set)
API Performance
Characteristic
Value
Description
Avg Latency
15ms
Average RTT for requests within the same data center/region
Max Rate
200/second
Maximum inbound request rate. Exceeding this will result in request throttling
Max Concurrency
250
Maximum concurrent/simultaneous requests. Exceeding this will result in error code 06 [TOO MANY CONNECTIONS]