Single Image Synchronous Moderation

API Overview

POSThttps://isafe.ilivedata.com/api/v2/image/check

Image requirements
Supported types: URL, BASE64
Supported formats: jpg, png, bmp, gif, webp, tiff, heic, avif
Supported image size: < 10M
Description of gif/long image: Automatically cut gif/long image (ratio of length and width greater than 5) into frames and check, up to 5 images. Gif/long images are billed according to the actual number of screenshots.

Request Parameters

Request Headers

Header Value Description
Content-Type application/json;charset=UTF-8 Request body type
Accept application/json;charset=UTF-8 Return type accepted
X-AppId — The unique identifier of the project, from Console - Service Configuration
X-TimeStamp — UTC time when the request is sent, in W3C format.
Example: 2026-09-30T02:30:00Z. Use the current time for actual requests.
Authorization — Signature value

Request Body

Parameter Type Required Description
type Number Required Image content type: 1: image URL; 2: image BASE64 value.
Note: If the image resource and the moderation service are not in the same region, BASE64 is recommended. Image URL may cause slow download or download failure under poor network.
image String Required Image content. When type=1 it is the image URL; when type=2 it is the image BASE64 value.
strategyId String Optional Strategy ID; uses default strategy DEFAULT when not provided
checkTags List<Number> Optional Restrict detection categories. Supports first-level categories enabled in the strategy; categories not enabled in the strategy are ignored
referImage String Optional Reference image for face comparison. The type must match image (if image is a URL, referImage must also be a URL). Supported formats: jpg, png; size < 10M
userId String Optional Unique end user ID, no more than 32 characters
extra Object Optional Extension fields transparently passed through, multiple key/value pairs. e.g. "extra": {"server": "123", "version": "456"}. No more than 20 key/value pairs; a single key must not be nested more than 3 levels deep. If exceeded, the audit log will not record the extra value for this task, but extra transparent passthrough in the response is unaffected

Request Example

{
  "type": 1,
  "image": "http://abc.com/a.jpg",
  "strategyId": "DEFAULT",
  "userId": "testUser",
  "checkTags": [100, 200],
  "extra": { "server": "123", "version": "456" }
}

Request Signature

See Request Signature in Help Center. Use these values for this endpoint:

Signing Parameter Value
HTTPMethod POST
HostHeaderInLowercase isafe.ilivedata.com
HTTPRequestURI /api/v2/image/check

HTTP Response

Content-Type: application/json;charset=UTF-8

The result is in JSON format.

Response Fields

Parameter Type Description
errorCode Number Error code: 0 success; 100001: image download failed; 100002: image format error
errorMessage String Error message
result Number Moderation result: 0: pass; 1: review; 2: reject
taskId String Task ID
mediaType String Image media type, e.g. image/jpeg, image/png, image/gif, image/webp, image/bmp, image/heic, image/avif
imageSize Number Image size in bytes
snapshotUrl String Image snapshot address generated by this audit
imageSpams Object Violation detection details, see imageSpams (omitted when no violation is detected)
ocr Object Recognized text content, see ocr (not returned by default; enable the switch in console to return)
personInfo Object Human/face/gender detection result, see personInfo
labels Array Label info, see labels
extra Object Extension fields passed through from the request

imageSpams

Parameter Type Description
tags Array Hit category list, see tags

tags

Field path: imageSpams.tags[]

Parameter Type Description
tag Number First-level category code; see Detection Categories.
level Number Category level: 0: normal; 1: suspected; 2: abnormal
confidence Number Confidence score, 0-100. 100 is the highest. When level is suspected/abnormal, higher confidence means more likely hit
nameZh String First-level category name (Chinese)
nameEn String First-level category name (English)
wordList List<String> Violating text returned when text-image is hit (tag=400)
subTags Array Second-level categories, see subTags

Detection Categories

Code Category
100 politics
110 violence
120 contraband
130 porn
140 sexy
150 ad
160 values
180 minors
200 qrcode
230 no-face-idle
232 image-quality
300 icon
400 text-image
666 disgusting
800 label
888 face-compare
900 other
999 user-defined

subTags

Field path: imageSpams.tags[].subTags[]

Parameter Type Description
subTag Number Second-level category code, see Category Code Table
level Number Category level: 0: normal; 1: suspected; 2: abnormal
confidence Number Confidence score, 0-100
nameZh String Second-level category name (Chinese)
nameEn String Second-level category name (English)
wordList List<String> Violating text returned when text-image is hit (tag=400)
terTags Array Third-level categories, see terTags (returned when the third-level tag switch is enabled in the console)

terTags

Field path: imageSpams.tags[].subTags[].terTags[]

Parameter Type Description
terTag Number Third-level category code
level Number Category level: 0: normal; 1: suspected; 2: abnormal
confidence Number Confidence score, 0-100
nameZh String Third-level category name (Chinese)
nameEn String Third-level category name (English)
wordList List<String> Violating text returned when text-image is hit (tag=400)

ocr

Parameter Type Description
text List<String> OCR recognized text list

personInfo

Parameter Type Description
genders Array Face gender and confidence, see genders
human Object Human count result, example: {"number": 12}
face Object Face count result, example: {"number": 7}

genders

Field path: personInfo.genders[]

Parameter Type Description
gender String Gender: male / female
confidence Number Gender confidence, 0-100

labels

Parameter Type Description
id String Unique label ID
score Number Model score, higher means higher confidence
nameZh String Label name (Chinese)
nameEn String Label name (English)

Response Example

{
  "errorCode": 0,
  "result": 2,
  "taskId": "ap_634e686ef7e54447af7463f4dd060d6d_1783514588456",
  "mediaType": "image/jpeg",
  "imageSize": 102400,
  "snapshotUrl": "https://cos.example.com/path/to/dumped-image.jpg",
  "imageSpams": {
    "tags": [
      {
        "tag": 100,
        "level": 2,
        "confidence": 90,
        "nameZh": "涉政",
        "nameEn": "politics",
        "subTags": [
          {
            "subTag": 100001,
            "level": 2,
            "confidence": 90,
            "nameZh": "政治人物",
            "nameEn": "political_figure",
            "terTags": [
              {
                "terTag": 100001001,
                "level": 2,
                "confidence": 90,
                "nameZh": "具体政治人物",
                "nameEn": "specific_political_figure"
              }
            ]
          }
        ]
      }
    ]
  },
  "ocr": {
    "text": [
      "苗华",
      "赵四"
    ]
  },
  "personInfo": {
    "genders": [
      {
        "gender": "male",
        "confidence": 90
      }
    ],
    "human": {
      "number": 12
    },
    "face": {
      "number": 7
    }
  },
  "labels": [
    {
      "id": "800001007",
      "score": 31,
      "nameZh": "人脸数",
      "nameEn": "face_num"
    }
  ],
  "extra": {}
}

Error Codes

See Common Error Codes in Help Center