POST
/
v1
/
validate
/
profanity
import { JigsawStack } from "jigsawstack";

const jigsaw = JigsawStack({ apiKey: "your-api-key" });

const response = await jigsaw.validate.profanity({
  "text": "This is a sample text that might contain inappropriate language."
})
{
  "success": true,
  "profanities_found": false,
  "profanities": [],
  "clean_text": "This is a sample text that might contain inappropriate language.",
  "_usage": {
        "input_tokens": 20,
        "output_tokens": 35,
        "inference_time_tokens": 192,
        "total_tokens": 247
  }
}

Params

text
string
required

The text to validate.

censor_replacement
string
default:"*"
required

The character to replace profanity with.

x-api-key
string
required

Your JigsawStack API key

Response

success
boolean

Indicates whether the call was successful.

message
string

The message returned by the API.

clean_text
string

The text with profanity replaced by the censor_replacement character.

profanities
array

An array of profanities found in the text.

profanities_found
integer

The number of profanities found in the text.

import { JigsawStack } from "jigsawstack";

const jigsaw = JigsawStack({ apiKey: "your-api-key" });

const response = await jigsaw.validate.profanity({
  "text": "This is a sample text that might contain inappropriate language."
})
{
  "success": true,
  "profanities_found": false,
  "profanities": [],
  "clean_text": "This is a sample text that might contain inappropriate language.",
  "_usage": {
        "input_tokens": 20,
        "output_tokens": 35,
        "inference_time_tokens": 192,
        "total_tokens": 247
  }
}