A word list catches the easy cases and fails on the rest: users type sh1t, f.u.c.k and fuuuck, and naive filters block Scunthorpe, Password and class. Here's what free options do well, where they fail, and how to filter comments in 26 languages.
Free options
- npm
bad-words / Python better-profanity: simple English lists, fine for a hobby project.
- PurgoMalum: a free web service, English-focused, no SLA. See PurgoMalum alternatives.
- LDNOOBW lists on GitHub: word lists in many languages, which you match yourself.
The hard parts are the same for all of them: obfuscated spellings, words that are innocent in English but rude elsewhere (and the reverse), and substrings inside ordinary words.
The API way
- Open the Profanity Filter API on Apify.
- Send texts, or point it at another dataset (for example reviews from our scrapers) and the field to check.
- Pick languages or
auto, a mode (mask, replace, remove or flag), and standard or strict. - Add your own blockWords and allowWords. For real-time checks, use the instant API endpoint, which also accepts PurgoMalum-style calls.
curl -X POST "https://api.apify.com/v2/acts/blueberry_rainstorm~profanity-filter/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"texts": [
"What a great product, thanks!",
"This is sh1t and the support is f u c k i n g useless"
],
"languages": [
"auto"
],
"mode": "mask"
}'
Each row returns the cleaned text, whether it was flagged, the matched words with their language and position, and the original text.
What it costs
$0.20 per 1,000 texts; empty texts are free. 50,000 comments cost $10.
Limits
It matches words, not tone: it won't catch an insult made of polite words. Non-English lists come from LDNOOBW, and Chinese, Japanese and Korean are matched as substrings.
Questions
What is the Scunthorpe problem?
Filters that match bad words inside other words block innocent text like Scunthorpe, Password or class. This API matches whole words and was tested on 370,105 English words to remove false hits.
Does it catch leetspeak?
Yes: sh1t, f u c k, fuuuck, f*ck and Cyrillic or Greek look-alike letters.
Which languages are supported?
26, including English, Spanish, French, German, Portuguese, Italian, Dutch, Russian, Arabic, Hindi, Japanese and Chinese, with auto-detection by script.
Can I switch from PurgoMalum?
Yes. The instant API has PurgoMalum-compatible endpoints, so moving is a base-URL change.