Ruby Profanity Filter
Context-aware moderation for Ruby apps using only the standard library — no gems required.
Quick start in Ruby
require "net/http"
require "json"
uri = URI("https://api.theprofanityapi.com/v1/check")
req = Net::HTTP::Post.new(uri, {
"Authorization" => "Bearer #{ENV['PROFANITY_API_KEY']}",
"Content-Type" => "application/json",
})
req.body = { text: text, context: "comment", mode: "balanced" }.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)
# data["flagged"], data["intent"] Why context-aware matters
A plain word list flags "this game is sick" or medical text full of
anatomical terms. The Profanity API runs a five-layer pipeline that
scores intent, so "die" in a gaming taunt and "die" in a real
threat are handled differently. Pick a context and the engine
adjusts strictness automatically.
Other integrations
- Node.js
- TypeScript
- Python
- PHP
- Go
- Java
- C# / .NET
- Rust
- Kotlin
- Swift
- Dart
- Elixir
- Express.js
- Next.js
- NestJS
- Nuxt
- Fastify
- Django
- Flask
- FastAPI
- Laravel
- Symfony
- Ruby on Rails
- Spring Boot
- ASP.NET Core
- Phoenix
- React
- Vue
- SvelteKit
- Angular
- React Native
- Flutter
- WordPress
- Discord Bot
Ready to ship moderation?
Get an API key and 300 free requests a month. No credit card required.
Get started free →