Angular Profanity Filter

Wrap moderation in an Angular service that calls your own backend via HttpClient.

Quick start in Angular

@Injectable({ providedIn: "root" })
export class ModerationService {
  constructor(private http: HttpClient) {}

  check(text: string) {
    return this.http.post<{ flagged: boolean }>("/api/moderate", { text });
  }
}

// in a component
this.moderation.check(value).subscribe(({ flagged }) => {
  if (flagged) this.error = "Please revise your message.";
});

Note: Never embed your API key in the Angular bundle. Call a backend route that holds it.

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 →