SoapBar API
A fast, flexible profanity filter
Hono
Next.js
Redis
Upstash
Summary
Soapbar is a flexible and fast profanity filter API designed to keep your applications clean and safe. It leverages Redis and a vector database on Upstash for fast and scalable data processing. Built with Cloudflare Workers and Hono, SoapBar ensures low-latency, globally distributed performance. The accompanying web app is developed using Next.js. With SoapBar, you can seamlessly integrate a robust content moderation tool into your projects, ensuring a professional and family-friendly user experience.

Tech Stack
- Upstash - for Redis and Vector Database
- Hono - backend framework
- Cloudflare Workers - for scalable, high performance API deployment
- Next.js - React framework
- Vercel - web app deployment
API Details
There are three possible properties for the JSON object response:
isProfanity : Boolean
score : Number
flaggedFor : String
Output without Profanity:

API response 👇
{
"isProfanity": false,
"score": 0.79129016
}
Output with Profanity:

API response 👇
{
"isProfanity": true,
"score": 1,
"flaggedFor": "fucking"
}
Rate Limits
Currently the rate limits are set to the following:
const RATE_LIMIT_WINDOW = 60; // Time window in seconds
const MAX_REQUESTS = 100; // Max requests per IP within time window
Make an API request:
const res = await fetch("https://soapbar.ryanhattonmain.workers.dev/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ message }),
});
Future Updates
- Model optimization - increase chance of catching profanity permutations
- Multi-language support - currently API only supports english
- Discord integration
- Support for other apps - please suggest any! 🙂