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

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

const response = await jigsaw.validate.nsfw({
  "url": "https://images.unsplash.com/photo-1633998979521-11ca9d0e6e38?q=80&w=2787&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
})
{
  "success": true,
  "nsfw": false,
  "nudity": false,
  "gore": false,
  "nsfw_score": 0.8023452367447058,
  "nudity_score": 0.08966292440891266,
  "gore_score": 0.0016616199864074588,
  "_usage": {
        "input_tokens": 45,
        "output_tokens": 60,
        "inference_time_tokens": 609,
        "total_tokens": 714
  }
}

Params

url
string
The image url. Not required if file_store_key is specified.
file_store_key
string
The key used to store the image on Jigsawstack file Storage. Not required if url is specified.
x-api-key
string
required
Your JigsawStack API key

Response

success
boolean
Indicates whether the call was successful.
_usage
object
Usage information for the API call.
nsfw
boolean
Indicates whether NSFW content was detected in the image.
nudity
boolean
Indicates whether nudity was detected in the image.
gore
boolean
Indicates whether gore/violence was detected in the image.
nsfw_score
number
Confidence score for NSFW content detection (0-1 scale).
nudity_score
number
Confidence score for nudity detection (0-1 scale).
gore_score
number
Confidence score for gore/violence detection (0-1 scale).
import { JigsawStack } from "jigsawstack";

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

const response = await jigsaw.validate.nsfw({
  "url": "https://images.unsplash.com/photo-1633998979521-11ca9d0e6e38?q=80&w=2787&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
})
{
  "success": true,
  "nsfw": false,
  "nudity": false,
  "gore": false,
  "nsfw_score": 0.8023452367447058,
  "nudity_score": 0.08966292440891266,
  "gore_score": 0.0016616199864074588,
  "_usage": {
        "input_tokens": 45,
        "output_tokens": 60,
        "inference_time_tokens": 609,
        "total_tokens": 714
  }
}