Wood Between StudioAPIs & Actors

Home / APIs / CleanText

CleanText Profanity Filter & PII Redaction

Detect and censor profanity (leetspeak-aware), redact emails, phones, cards and SSNs, and score readability.

Open on RapidAPI

Endpoints

PathWhat it does
/profanityCensor or flag profanity, including leetspeak
/redactRedact emails, phones, cards, SSNs, IBANs, IPs, URLs
/analyzeReadability scores and reading time
/cleanProfanity and PII together

Examples

Replace YOUR_KEY with your RapidAPI key. Host: cleantext-profanity-filter-pii-redaction.p.rapidapi.com

curl

curl --request POST \
  --url 'https://cleantext-profanity-filter-pii-redaction.p.rapidapi.com/profanity' \
  --header 'Content-Type: application/json' \
  --header 'X-RapidAPI-Key: YOUR_KEY' \
  --header 'X-RapidAPI-Host: cleantext-profanity-filter-pii-redaction.p.rapidapi.com' \
  --data '{"text": "this is sh1t, email a@b.co"}'

JavaScript

const res = await fetch('https://cleantext-profanity-filter-pii-redaction.p.rapidapi.com/profanity', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-RapidAPI-Key': process.env.RAPIDAPI_KEY,
    'X-RapidAPI-Host': 'cleantext-profanity-filter-pii-redaction.p.rapidapi.com'
  },
  body: JSON.stringify({"text": "this is sh1t, email a@b.co"})
});
const data = await res.json();

Python

import os, requests
r = requests.post(
    'https://cleantext-profanity-filter-pii-redaction.p.rapidapi.com/profanity',
    headers={
        'X-RapidAPI-Key': os.environ['RAPIDAPI_KEY'],
        'X-RapidAPI-Host': 'cleantext-profanity-filter-pii-redaction.p.rapidapi.com',
        'Content-Type': 'application/json',
    },
    json={"text": "this is sh1t, email a@b.co"},
)
print(r.json())

Notes

Nothing you send is stored by our code. Calls go through RapidAPI, which bills according to the plan you pick. The origin runs on Cloudflare Workers.