API Documentation

Comprehensive Guide and Technical Details for Seamless Integration

1. NSFW Detection API

Method: POST

Endpoint: https://api.cloudants.io/nsfw/v1

Note: Ensure the URL does not have a trailing slash and include the header X-Domain in your request.

Request Parameters:

For a Single Image:
  {
    "image_urls": [
      "https://image-path.com"
    ]
  }
          
For Multiple Images:
  {
    "image_urls": [
      "https://image-path.com",
      "https://image-path2.com"
    ]
  }
          

Response Examples:

For a Single Image:
  [
    {"image_url":"https://image-path.com","is_nsfw":true}
  ]
          
For Multiple Images:
  [
    {"image_url":"https://image-path.com","is_nsfw":true},
    {"image_url":"https://image-path2.com","is_nsfw":false}
  ]
          

Usage: Use the is_nsfw field in the response to determine if an image is NSFW.

2. Face Detection API

Method: POST

Endpoint: https://api.cloudants.io/face-detect/v1

Note: Ensure the URL does not have a trailing slash and include the header X-Domain in your request.

Request Parameters:

For a Single Image:
  {
    "image_urls": [
      "https://image-path.com"
    ]
  }
          
For Multiple Images:
  {
    "image_urls": [
      "https://image-path.com",
      "https://image-path2.com"
    ]
  }
          

Response Examples:

For a Single Image:
  [
    {"image_url":"https://image-path.com","is_face":true,"is_nsfw":true}
  ]
          
For Multiple Images:
  [
    {"image_url":"https://image-path.com","is_face":true,"is_nsfw":true},
    {"image_url":"https://image-path2.com","is_face":true,"is_nsfw":false}
  ]
          

Usage: This API detects whether an image contains a face and whether the image is NSFW. The is_face field indicates the presence of a face, while is_nsfw determines if the image is NSFW.

3. Nudity Detection API

Method: POST

Endpoint: https://api.cloudants.io/nudity-detect/v1

Note: Ensure the URL does not have a trailing slash and include the header X-Domain in your request.

Request Parameters:

For a Single Image:
  {
    "image_urls": [
      "https://image-path.com"
    ]
  }
          
For Multiple Images:
  {
    "image_urls": [
      "https://image-path.com",
      "https://image-path2.com"
    ]
  }
          

Response Examples:

For a Single Image:
  [
    {"image_url":"https://image-path.com","is_nude":true,"total_nudity_score":1.3375419974327087}
  ]
          
For Multiple Images:
  [
    {"image_url":"https://image-path.com","is_nude":true,"total_nudity_score":1.3375419974327087},
    {"image_url":"https://image-path2.com","is_nude":false,"total_nudity_score":0}
  ]
          

Usage: The is_nude field indicates whether the image contains nudity. The total_nudity_score provides a numeric score representing the degree of nudity, which can be used to implement custom logic based on the score.

4. Image Properties API

Method: POST

Endpoint: https://api.cloudants.io/img-prop/v1

Note: Ensure the URL does not have a trailing slash and include the header X-Domain in your request.

Request Parameters:

For a Single Image:
  {
    "image_urls": [
      "https://image-path.com"
    ]
  }
          
For Multiple Images:
  {
    "image_urls": [
      "https://image-path.com",
      "https://image-path2.com"
    ]
  }
          

Response Examples:

For a Single Image:
  [
    [
      {"class":"FACE_FEMALE","score":0.8654655814170837,"box":[267,25,127,120]},
      {"class":"FEMALE_BREAST_EXPOSED","score":0.7974921464920044,"box":[340,199,139,102]},
      {"class":"ARMPITS_EXPOSED","score":0.7133167386054993,"box":[460,196,55,60]},
      {"class":"BELLY_EXPOSED","score":0.6663662195205688,"box":[251,316,156,133]},
      {"class":"FEMALE_BREAST_EXPOSED","score":0.5400498509407043,"box":[226,223,114,100]}
    ]
  ]
          
For Multiple Images:
  [
    [
      {"class":"FACE_FEMALE","score":0.8654655814170837,"box":[267,25,127,120]},
      {"class":"FEMALE_BREAST_EXPOSED","score":0.7974921464920044,"box":[340,199,139,102]},
      {"class":"ARMPITS_EXPOSED","score":0.7133167386054993,"box":[460,196,55,60]},
      {"class":"BELLY_EXPOSED","score":0.6663662195205688,"box":[251,316,156,133]},
      {"class":"FEMALE_BREAST_EXPOSED","score":0.5400498509407043,"box":[226,223,114,100]}
    ],
    [
      {"class":"FACE_FEMALE","score":0.8708316683769226,"box":[203,164,207,226]}
    ]
  ]
          

Usage: This API returns visual properties detected within an image along with their respective scores. The box parameter indicates the area of the image where a specific property has been detected, enabling you to censor the image as needed. The following properties may be returned if detected:

  • FEMALE_GENITALIA_COVERED
  • FACE_FEMALE
  • BUTTOCKS_EXPOSED
  • FEMALE_BREAST_EXPOSED
  • FEMALE_GENITALIA_EXPOSED
  • MALE_BREAST_EXPOSED
  • ANUS_EXPOSED
  • FEET_EXPOSED
  • BELLY_EXPOSED
  • ARMPITS_EXPOSED
  • FACE_MALE
  • MALE_GENITALIA_EXPOSED

Required Headers:

  • X-Domain: The domain you are using to access the API (e.g., example.com).