What it does
The Detect Text Toxicity API is a toxicity detection API that checks whether a comment or message is toxic or harmful. Send a piece of text and get back a clear verdict, toxic or non-toxic, with a score showing how confident the model is.
It is one POST endpoint with a single text field, and the answer comes back in the same request. The response includes toxic as true or false, a label such as non-toxic, a score between 0 and 1, and the text that was checked. Use toxic for a simple allow or block decision, or apply your own threshold to score: auto-hide the most confident cases and send borderline ones to a human moderator. Input is limited to 512 characters, which covers comments, chat messages, reviews, bios and support tickets.
Unlike a word list, a toxicity model reads the whole message, so it can flag insults, harassment and hostile comments that contain no swear words at all. Common uses include moderating comment sections and forums, screening chat in communities and games, flagging abusive support tickets, reviewing profile bios at sign-up, and checking AI chatbot replies before they reach users.
Google's Perspective API, the most widely used free toxicity API, is shutting down on 31 December 2026 with no migration path. If you are moving off it, note that this API returns one toxicity verdict and score rather than separate scores for insults, threats and identity attacks, which keeps the integration simple.
To catch explicit swear words with an exact list of matches, pair it with the CheckText Profanity API. For broader content moderation, use the AI Text Moderation API, and to measure whether feedback is positive or negative instead of harmful, use the Analyze Multiple Text Sentiment API.
You can try it right here in the playground. Start for free with 5 API calls a day, no card required, and check your own text before you commit.
The API is also available through ApyHub MCP, so AI agents can check text for toxicity directly before they publish or reply.