Content Table

Prism Endpoint:

Profanity Censor


Usage

Description

The profanity censor endpoint lets you input a text, and then returns a censored version of the original text. Multiple optional personalization options are available like a strictness level, censor style, a custom list of blacklisted words, and a custom list of whitelisted words.


Method & Path

Use https://prism.optical-labs.ca/text/profanity to access this endpoint. The method must be POST and the header should contain your secret API key, as shown below:


Body Fields

Field Name Type Description
text String (required) Text with a length between 1 and 5000 characters
strictness Integer (optional) Level of strictness from 1 to 3
mask_style String (optional) One of: "full" "partial" "vowels" "redact" "comic"
blacklist Array (optional) From 0 to 50 elements
whitelist Array (optional) From 0 to 50 elements

Valid Response

Each successful request to this endpoint costs 1 credit. Your usage and remaining credits are always returned in the meta object of the response.


Interactive Preview

Send a real request to the endpoint for free, directly from your browser!


Examples

Basic Request

Assuming that the word "bad" is a profanity:

The response includes the full configuration used for the request, including default values for any undefined parameters:


Strictness Level

Assuming that the word "bad" is a level 2 profanity:

Since the request strictness (1) is lower than the word's profanity level (2), the text remains uncensored:


Mask Style

Assuming that the word "bad" is a profanity:

Profanity is now censored differently:


Custom Lists

Assuming that the word "bad" is a profanity and "banana" isn't:

Blacklist forbids "banana" and whitelist allows "bad":


All at Once

Of course, any combination of fields can be used in the same request: