Go Profanity Filter

High-throughput content moderation for Go services with the standard net/http client.

Quick start in Go

payload, _ := json.Marshal(map[string]string{
    "text": text, "context": "chat", "mode": "fast",
})
req, _ := http.NewRequest("POST",
    "https://api.theprofanityapi.com/v1/check",
    bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer "+os.Getenv("PROFANITY_API_KEY"))
req.Header.Set("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()

var result struct {
    Flagged bool    `json:"flagged"`
    Intent  string  `json:"intent"`
    Score   float64 `json:"score"`
}
json.NewDecoder(res.Body).Decode(&result)

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

Ready to ship moderation?

Get an API key and 300 free requests a month. No credit card required.

Get started free →