Sync API (Bulk Images)

Submit multiple images in a single synchronous request for content moderation to detect regulatory risks and business content.

The Image Moderation API detects risks such as political sensitivity, pornography, advertising, and terrorism in images, and can additionally identify faces, logos, animals, plants, and other content based on the business scenarios enabled on your account.

API Description

Synchronous bulk-image moderation API. Submits multiple images for a single user in one request and returns a moderation result for each image directly in the response. Use this endpoint when you need low-latency, in-line decisions on a batch of images attributed to the same tokenId (for example, an album upload, a product listing with multiple photos, or a chat message containing several attachments).

The Image Moderation API detects risks such as political sensitivity, pornography, advertising, and terrorism in images, and can additionally identify faces, logos, animals, plants, and other content based on the business scenarios enabled on your account.

Requirements

ItemSpecification
ProtocolHTTP or HTTPS
MethodPOST
EncodingUTF-8
FormatAll request and response parameters use JSON

Image Requirements

ItemSpecification
Image typesURL, BASE64
Supported formatsjpg, jpeg, png, webp, gif, tiff, tif, heif, heic, avif, apng, bmp, svg (static only)
Resolution20×20 px to 6000×6000 px. Recommended minimum: 256×256 px
Size limitSynchronous: ≤ 10 MB. Asynchronous: ≤ 30 MB

Frame extraction: Tall, scrolling images (long-form screenshots, product detail pages, comic-style posts) are submitted as a single frame by default. Contact DeepCleer to enable automatic splitting into multiple frames — note that this increases the number of billable moderation units per request. Animated images such as GIFs are always split into frames, according to the parameters you pass in the request.

ℹ️

Host images on a highly available CDN before submitting their URLs. DeepCleer fetches each image directly from the origin server you provide, so any outage or single point of failure on your side will cause fetch failures — and an image that can't be fetched can't be moderated.

Timeout Suggestion

  • Synchronous single image: recommended timeout of 10 seconds
  • Asynchronous single image: recommended timeout of 5 seconds
ℹ️

End-to-end response time is dominated by how long DeepCleer takes to fetch your image — keep your hosting fast and reliable. Fetch timeouts are 2 seconds to connect and 3 seconds to read, with one automatic retry on failure. Once the image is in hand, DeepCleer's own processing averages about 500 ms, with the exact figure varying by detection type and image size.


Request

Request URL

ClusterRequest URL
Silicon Valleyhttp://api-img-gg.fengkongcloud.com/images/v4
Singaporehttp://api-img-xjp.fengkongcloud.com/images/v4

Request Parameters

ParameterTypeRequiredMax LengthDescription
accessKeystringYes64API access key issued by DeepCleer. Identifies the calling account.
appIdstringYes64Application identifier issued by DeepCleer for the product or app sending the request.
eventIdstringYes64Business event identifier (for example, post, comment, message). Used to apply event-specific moderation strategies.
typestringYesComma-separated list of detection types to apply. Supported values: POLITY, EROTIC, VIOLENT, QRCODE, ADVERT, IMGTEXTRISK, BOCR.
businessTypestringNo64Custom business label. Required only when business-label moderation is enabled on your account.
acceptLangstringNoLanguage of the labels and descriptions in the response. Defaults to en. Accepted values: en (English), zh (Chinese).
dataobjectYesRequest payload. See data Object Parameters.

data Object Parameters

ParameterTypeRequiredMax LengthDescription
imgsarrayYesImages to be moderated, supplied as a list of image objects. See imgs Request Array.
tokenIdstringYes64User account identifier. Strongly recommended — used for behavior-based risk profiling (spam, advertising, etc.). Pass the stable user ID from your system.
deviceIdstringNo128DeepCleer device fingerprint, generated by the DeepCleer SDK. Used to attribute behavior across sessions on the same device.
genderint32NoUser gender. 0: male. 1: female. 2: unknown.
intervalint32NoFrame-extraction frequency for animated images. Defaults to 1 (every frame). When interval × maxFrame is smaller than the image's total frame count, interval is automatically raised to total_frames / maxFrame so the sampled frames span the full animation.
ipstringNo64Client public IP address. Used for IP-based behavior analysis.
langstringNoLanguage of any text embedded inside the images, used by the OCR-based text detectors. Defaults to en. Accepted values: en (English), zh (Chinese), ar (Arabic), auto (automatic language detection — requires the BOCR detector and is currently available only in the Singapore and Silicon Valley clusters).
levelint32NoUser tier, used to apply tier-specific interception strategies. See User Levels.
maxFrameint32NoMaximum number of frames to sample from animated images (GIF and similar). Up to 20; defaults to 3. Billing is based on the number of frames actually sampled.
nicknamestringNo150User nickname. Truncated if it exceeds 150 characters.
receiveTokenIdstringConditional64tokenId of the message recipient. Required when eventId is message. Alphanumeric plus underscore and hyphen, up to 64 characters.
extraobjectNoAuxiliary parameters. See sub-fields below.
extra.isIgnoreTlsint32NoWhether to skip TLS certificate verification when DeepCleer fetches images from URLs. 0 (default): verify. 1: skip verification.
extra.isTokenSeparateint32NoWhether to scope account profiles per application. 0 (default): share across applications. 1: keep account state independent per application.
extra.roomstringNo64Live-room or game-room ID. Lets you configure room-specific strategies.
extra.passThroughobjectNo1024Client pass-through field. DeepCleer does not inspect or modify it; the same value is returned in the response.

imgs Request Array

Each element of imgs describes one image to be moderated:

ParameterTypeRequiredDescription
btIdstringYesClient-side unique identifier for this image. Echoed back in the per-image result so you can correlate inputs and outputs.
imgstringYesThe image itself, supplied either as a base64-encoded payload or as a publicly fetchable URL.

User Levels

ValueDescription
0Lowest tier (e.g. newly registered, completely inactive, or level-0 users)
1Lower tier (e.g. low-activity or low-level users)
2Mid tier (e.g. moderately active or mid-level users)
3Higher tier (e.g. highly active or high-level users)
4Highest tier (e.g. paying or VIP users)

Response

Response Parameters

ℹ️

Fields other than code, message, and requestId are guaranteed to be returned only when code is 1100.

ParameterTypeRequiredDescription
requestIdstringYesUnique DeepCleer request identifier. Strongly recommended to save for troubleshooting and optimization.
codeint32YesResponse code. See Response Codes.
messagestringYesHuman-readable message corresponding to code.
imgsarrayYesPer-image moderation results, in the same order as the request. See imgs Response Array.
auxInfoobjectNoAuxiliary information.
auxInfo.passThroughobjectNoClient pass-through field, returned as-is.

Response Codes

CodeMessage
1100Success
1901QPS limit exceeded
1902Invalid parameters
1903Service failure
1911Image download failure
9101Unauthorized operation

imgs Response Array

Each element is the moderation result for one input image:

ParameterTypeRequiredDescription
btIdstringYesClient-side unique image identifier, echoed from the request.
requestIdstringYesUnique DeepCleer request identifier for this image. Strongly recommended to save for troubleshooting and optimization.
codeint32YesPer-image response code. See Response Codes.
messagestringYesPer-image response message.
riskLevelstringYesDisposition recommendation. PASS: normal (allow). REVIEW: suspicious (manual review recommended). REJECT: violation (reject).
riskLabel1stringYesLevel-1 risk label. Returns normal when riskLevel is PASS.
riskLabel2stringYesLevel-2 risk label. Empty when riskLevel is PASS.
riskLabel3stringYesLevel-3 risk label. Empty when riskLevel is PASS.
riskDescriptionstringYesRisk description. Returns Normal when riskLevel is PASS. Format: "Level 1: Level 2: Level 3". Human-readable summary intended for display only — do not parse for programmatic logic; branch on riskLabel1 / riskLabel2 / riskLabel3 instead.
resultTypeint32YesSource of this result. 0: machine moderation. 1: human moderation.
finalResultint32YesWhether this is the final result. 0: not final (human review pending). 1: final (safe to act on). Defaults to 1 when only machine moderation is configured.
allLabelsarrayYesAll risk labels detected on this image. See allLabels Array.
riskDetailobjectYesDetail backing the top-level risk decision (positions, names, OCR text, matched lists, etc.). See riskDetail Object.
auxInfoobjectYesPer-image auxiliary information. See Image auxInfo.
businessLabelsarrayNoBusiness label results. See businessLabels Array.
tokenLabelsobjectConditionalAccount label information. Returned only when tokenId is provided and the service is enabled on your account. See tokenLabels Object.
disposalobjectNoCustom disposition and label-mapping result. Returned only when a custom label system is configured. See disposal Object.
tokenProfileLabelsarrayConditionalAccount profile labels. Returned only when tokenId is provided and the labeling service is enabled. See Token Labels.
tokenRiskLabelsarrayConditionalAccount risk labels. Returned only when tokenId is provided and the labeling service is enabled. See Token Labels.

allLabels Array

Each element:

ParameterTypeRequiredDescription
riskLevelstringNoDisposition for this label: PASS, REVIEW, or REJECT.
riskLabel1stringNoLevel-1 risk label.
riskLabel2stringNoLevel-2 risk label.
riskLabel3stringNoLevel-3 risk label.
riskDescriptionstringNoRisk description. Display only — do not parse for programmatic logic.
probabilityfloatNoConfidence score in the range 01. Higher values indicate greater confidence.
riskDetailobjectNoDetail backing this label. See riskDetail Object.

riskDetail Object

Detail object backing a risk decision. Most fields are populated only when the corresponding detector contributes to the result.

ParameterTypeRequiredDescription
riskSourceint32YesWhere the risk was identified. 1000: no risk. 1001: text risk (text inside the image). 1002: visual risk (image content).
face_numint32ConditionalNumber of faces detected. Present when face-related detectors run.
person_numint32ConditionalNumber of persons detected. Present when person-related detectors run.
facesarrayConditionalNames and positions of politically sensitive individuals identified in the image. Up to 10 entries (the highest-confidence ones are kept if more were detected). See Face Object.
objectsarrayConditionalDetected objects and logos with names and positions. See Object Info.
ocrTextobjectConditionalOCR-recognized text from the image. Returned when an image-text or advertising detector contributes to this label. Contains text (string): the recognized text.
matchedListsarrayConditionalCustom-list match information. Returned only when a custom keyword or image list is hit. See Matched Lists.
riskSegmentsarrayConditionalHigh-risk text segments. Returned for political, terrorism, prohibited, competitive, or advertising-law content. See Risk Segments.
personsarrayConditionalPerson names and positions. Up to 10 entries (highest-confidence kept). See Person Object.

Face Object

ParameterTypeRequiredDescription
idstringNoFace identifier. The same person at the same position carries the same id across different labels. If a person appears N times, N distinct ids are assigned.
namestringNoPerson name.
face_ratiofloatNoFace area as a fraction of the image, in the range 01.
probabilityfloatNoConfidence score in the range 01.
locationarrayNoBounding box [x1, y1, x2, y2] (top-left and bottom-right corners).

Object Info

ParameterTypeRequiredDescription
idstringNoObject or logo identifier.
namestringNoObject name.
probabilityfloatNoConfidence score in the range 01.
qrContentstringNoURL decoded from a QR code in the image (for QR-related detections).
locationarrayNoBounding box [x1, y1, x2, y2].

Matched Lists

ParameterTypeRequiredDescription
namestringNoName of the matched custom list.
wordsarrayNoSensitive-word matches within the list.
words[].wordstringNoThe matched sensitive word.
words[].positionarrayNoPosition of the matched word.

Risk Segments

ParameterTypeRequiredDescription
segmentstringNoThe high-risk text segment.
positionarrayNoPosition of the segment in the source text (0-indexed).

Person Object

ParameterTypeRequiredDescription
idstringNoPerson identifier. The same person carries the same id across different labels.
person_ratiofloatNoPerson area as a fraction of the image, in the range 01.
probabilityfloatNoConfidence score in the range 01.
locationarrayNoBounding box of the person.

Image auxInfo

ParameterTypeRequiredDescription
segmentsint32YesNumber of frames or segments actually processed (relevant for animated images).
downloadTimeintegerNoImage download time, in milliseconds.
qrContentstringNoURL decoded from a QR code in the image.
totalProcessTimeintegerNoTotal processing time for this image, in milliseconds.

businessLabels Array

Each element:

ParameterTypeRequiredDescription
businessLabel1stringYesLevel-1 business label.
businessLabel2stringYesLevel-2 business label.
businessLabel3stringYesLevel-3 business label.
businessDescriptionstringYesBusiness label description. Format: "Level 1: Level 2: Level 3".
probabilityfloatYesConfidence score in the range 01.
confidenceLevelint32NoCoarse confidence bucket in the range 02. Higher values indicate greater confidence.
businessDetailobjectNoDetail backing the business label. May contain face_compare_num, face_num, face_ratio, name, person_num, person_ratio, probability, faces, objects, persons, and location, with the same shapes documented in riskDetail.

tokenLabels Object

Returned only when tokenId is provided and the account-labeling service is enabled with DeepCleer.

ParameterTypeRequiredDescription
UGC_account_riskobjectNoUGC content risk for this account.
UGC_account_risk.b_advertise_risk_tokenidint32NoAdvertising risk. 0: no risk detected. 1: risk detected.
UGC_account_risk.b_advertise_risk_tokenid_last_tsint64NoTimestamp at which the advertising risk was last observed. 13-digit Unix timestamp in milliseconds (UTC).
UGC_account_risk.b_politics_risk_tokenidint32NoPolitical risk. 0: no risk detected. 1: risk detected.
UGC_account_risk.b_politics_risk_tokenid_last_tsint64NoTimestamp at which the political risk was last observed. 13-digit Unix timestamp in milliseconds (UTC).
UGC_account_risk.b_sexy_risk_tokenidint32NoPornographic risk. 0: no risk detected. 1: risk detected.
UGC_account_risk.b_sexy_risk_tokenid_last_tsint64NoTimestamp at which the pornographic risk was last observed. 13-digit Unix timestamp in milliseconds (UTC).
machine_account_riskobjectNoAutomation / bot-control risk for this account.
machine_account_risk.b_machine_control_tokenidint32NoMachine-controlled account. 0: not machine-controlled. 1: machine-controlled.
machine_account_risk.b_machine_control_tokenid_last_tsint64NoTimestamp at which machine control was last observed. 13-digit Unix timestamp in milliseconds (UTC).
machine_account_risk.b_offer_wall_tokenidint32NoOffer-wall (incentivized signup) account. 0: not an offer-wall account. 1: offer-wall account.
machine_account_risk.b_offer_wall_tokenid_last_tsint64NoTimestamp at which the offer-wall behavior was last observed. 13-digit Unix timestamp in milliseconds (UTC).
scene_account_riskobjectNoScene-specific account risk. Available only for vertical scenarios such as airline ticketing.
scene_account_risk.i_tout_risk_tokenidint32NoAirline seat-blocking risk — accounts that hold seat reservations to resell. 0: not a seat-blocking account. 1: seat-blocking account.
scene_account_risk.i_tout_risk_tokenid_last_tsint64NoTimestamp at which the seat-blocking behavior was last observed. 13-digit Unix timestamp in milliseconds (UTC).

disposal Object

Returned only when a custom label system is configured with DeepCleer. Note: in the asynchronous bulk-image API, enabling disposition mapping switches the callback delivery model from a single aggregate callback to one callback per image.

ParameterTypeRequiredDescription
riskLevelstringYesMapped disposition recommendation. Falls back to the default recommendation when no mapping is configured for the underlying labels.
riskLabel1stringYesMapped Level-1 risk label. Returns normal when unmapped or when riskLevel is PASS.
riskLabel2stringYesMapped Level-2 risk label. Empty when unmapped or when riskLevel is PASS.
riskLabel3stringYesMapped Level-3 risk label. Empty when unmapped or when riskLevel is PASS.
riskDescriptionstringYesMapped risk description. Returns Normal when riskLevel is PASS.
riskDetailobjectYesMapped risk detail. Same structure as the riskDetail Object.

Token Labels

tokenProfileLabels and tokenRiskLabels share the same element schema:

ParameterTypeRequiredDescription
label1stringNoLevel-1 label.
label2stringNoLevel-2 label.
label3stringNoLevel-3 label.
descriptionstringNoHuman-readable label description.
timestampint64NoWhen the label was assigned. 13-digit Unix timestamp in milliseconds (UTC).

Examples

Request Example

{
  "accessKey": "YOUR_ACCESS_KEY",
  "appId": "default",
  "eventId": "default",
  "type": "POLITY_EROTIC_VIOLENT",
  "data": {
    "imgs": [
      {
        "btId": "123",
        "img": "http://example.com/image1.jpg"
      },
      {
        "btId": "456",
        "img": "http://example.com/image2.jpg"
      }
    ],
    "tokenId": "username123"
  }
}

Response Example

{
  "auxInfo": {},
  "code": 1100,
  "message": "Success",
  "requestId": "faf10b672ddae5e5e51ea719c44ca94b",
  "imgs": [
    {
      "btId": "123",
      "code": 1100,
      "message": "Success",
      "requestId": "faf10b672ddae5e5e51ea719c44ca94b_123",
      "finalResult": 1,
      "resultType": 0,
      "riskLevel": "REJECT",
      "riskLabel1": "violence",
      "riskLabel2": "baokongchangjing",
      "riskLabel3": "xuexing",
      "riskDescription": "Violence: Violence scene: Bloody",
      "riskDetail": {
        "ocrText": {
          "text": "Sample OCR text"
        },
        "riskSource": 1002
      },
      "allLabels": [
        {
          "probability": 0.922851562500734,
          "riskDescription": "Violence: Violence scene: Bloody",
          "riskDetail": {
            "ocrText": {
              "text": "Sample OCR text"
            },
            "riskSource": 1002
          },
          "riskLabel1": "violence",
          "riskLabel2": "baokongchangjing",
          "riskLabel3": "xuexing",
          "riskLevel": "REJECT"
        }
      ],
      "auxInfo": {
        "segments": 1
      },
      "businessLabels": [
        {
          "businessDescription": "Face: Gender: Male",
          "businessDetail": {
            "face_ratio": 0.00106996833346784,
            "faces": [
              {
                "face_ratio": 0.00106996833346784,
                "id": "35da33429897372017bb7ad7c7302693",
                "location": [228, 588, 256, 622],
                "name": "",
                "probability": 0.967536687850952
              }
            ]
          },
          "businessLabel1": "face",
          "businessLabel2": "gender",
          "businessLabel3": "male",
          "confidenceLevel": 2,
          "probability": 0.967536687850952
        },
        {
          "businessDescription": "Face: Face type: Real person",
          "businessDetail": {
            "face_num": 1,
            "face_ratio": 0.00106996833346784,
            "faces": [
              {
                "face_ratio": 0.00106996833346784,
                "id": "35da33429897372017bb7ad7c7302693",
                "location": [228, 588, 256, 622],
                "name": "Example Person",
                "probability": 0.541935835649002
              }
            ]
          },
          "businessLabel1": "face",
          "businessLabel2": "renlianleixing",
          "businessLabel3": "zhenren",
          "confidenceLevel": 2,
          "probability": 0.996093758527634
        }
      ],
      "tokenLabels": {
        "UGC_account_risk": {}
      }
    },
    {
      "btId": "456",
      "code": 1100,
      "message": "Success",
      "requestId": "faf10b672ddae5e5e51ea719c44ca94b_456",
      "riskLevel": "PASS",
      "riskLabel1": "normal",
      "riskLabel2": "",
      "riskLabel3": "",
      "riskDescription": "Normal",
      "riskDetail": {
        "riskSource": 1000
      },
      "allLabels": [],
      "tokenLabels": {
        "UGC_account_risk": {}
      }
    }
  ]
}