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

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

const result = await jigsawstack.validate.profanity({
  text: "All the world's a stage, and all the men and women merely players. They have their exits and their entrances; And one man in his time plays many parts.",
  censor_replacement: "*",
});
{
  "success": true,
  "message": "Validated successfully",
  "clean_text": "",
  "profanities": [],
  "profanities_found": 0
}

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 jigsawstack = JigsawStack({
  apiKey: "your-api-key",
});

const result = await jigsawstack.validate.profanity({
  text: "All the world's a stage, and all the men and women merely players. They have their exits and their entrances; And one man in his time plays many parts.",
  censor_replacement: "*",
});
{
  "success": true,
  "message": "Validated successfully",
  "clean_text": "",
  "profanities": [],
  "profanities_found": 0
}