Sync API (Single Image)

Single image detection API for identifying regulatory risks and business content in images including political content, pornography, advertising, violence, faces, and logos.

Detect regulatory risks in images including political content, pornography, advertising, and violence & terrorism. Combine with your business scenarios to identify faces, logos, flora & fauna, and other content.

API Description

Single image synchronous detection API that returns recognition results directly.

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: Long images are not split by default. Contact ISHUMEI to enable splitting (may increase moderation count and billing). Animated images (gif, etc.) are split based on request parameters.

ℹ️

Image URLs should be downloaded from a CDN origin server. The origin server must not be a single point of failure, otherwise image download failures may prevent moderation.

Timeout

  • Synchronous single image: recommended timeout of 10 seconds
  • Asynchronous single image: recommended timeout of 5 seconds
  • Response time depends on image download time. Ensure the storage service is stable. ISHUMEI's connection timeout is 2 seconds, read timeout is 3 seconds (with one retry on failure). Average internal processing time is approximately 500ms, varying by request type and image size.

Request

Request URL

ClusterRequest URLSupported Products
Beijinghttp://api-img-bj.fengkongcloud.com/image/v4Chinese Image
Shanghaihttp://api-img-sh.fengkongcloud.com/image/v4Chinese Image
Silicon Valleyhttp://api-img-gg.fengkongcloud.com/image/v4Chinese Image, English Image, Arabic Image
Singaporehttp://api-img-xjp.fengkongcloud.com/image/v4Chinese Image, English Image, Arabic Image

Request Parameters

ParameterTypeRequiredMax LengthDescription
accessKeystringYes20Company key for authentication, provided by ISHUMEI when the service is activated.
eventIdstringYes64Event identifier. The value must be agreed upon with ISHUMEI in advance.
appIdstringYes64Application identifier. Strictly validated; the value must be agreed upon with ISHUMEI in advance.
typestringNo64Risk detection types. At least one of type or businessType is required. See Detection Types.
businessTypestringNo128Business detection types. At least one of type or businessType is required. See business label types for available values.
dataobjectYesRequest data content. See data Object.
acceptLangstringNoLanguage for returned labels. zh (default): Chinese. en: English.

Detection Types

Combine multiple types with underscores (e.g., POLITY_QRCODE_ADVERT).

ValueDescription
POLITYPolitical content detection
EROTICPornographic & sexually suggestive content detection
VIOLENTViolence, terrorism & prohibited content detection
QRCODEQR code detection
ADVERTAdvertising detection
IMGTEXTRISKImage text violation detection (required for detecting violations in text within images)
BOCRMulti-language OCR with automatic language detection (Singapore and Silicon Valley clusters only)

data Object

ParameterTypeRequiredMax LengthDescription
imgstringYes1024Image to be moderated. Accepts base64-encoded data or image URL.
tokenIdstringYes64User account identifier. Recommended to pass the user ID for behavioral risk detection (spam, advertising, etc.).
backupUrlstringNo1024Backup image download URL. Used when img fails to download.
dataIdstringNo128Custom data ID. Can be used for searching in the ISHUMEI SaaS dashboard.
deviceIdstringNo128ISHUMEI device fingerprint identifier, generated by the ISHUMEI SDK for user behavior analysis.
genderstringNoUser gender. male, female, or ambiguity.
imgCompareBasestringNo1024Base image for face comparison. Required when businessType includes FACECOMPARE. Accepts base64 or URL. Supported formats: jpg, jpeg, png, webp, gif, tiff, tif, heif. Recommended min: 256×256 px, max 10 MB. Long images and animated images are not supported as base images.
intervalint32NoAnimated image frame extraction frequency. Default: 1. Extracts one frame every interval frames. When interval × maxFrame is less than total frames, the interval auto-adjusts to total_frames / maxFrame.
ipstringNo64Client public IP address for IP-based user behavior analysis.
langstringNoLanguage type for text content detection in images. Default: zh. zh: Chinese. en: English. ar: Arabic. auto: automatic language detection (requires BOCR type, Singapore and Silicon Valley clusters only).
levelint32NoUser level. See User Levels.
maxFrameint32NoMaximum frame count for animated images. Max: 20 frames. Default: 3 frames. Billing is based on actual extracted frames.
nicknamestringNoUser nickname. Max 150 characters (truncated if exceeded).
receiveTokenIdstringNo64Message receiver's tokenId. Alphanumeric with underscores and hyphens, up to 64 characters.
extraobjectNoAuxiliary parameters. See extra Object.

User Levels

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

extra Object

ParameterTypeRequiredDescription
isIgnoreTlsbooleanNoWhether to ignore CA certificate verification. Default: false. true: ignore certificate trust. false: validate certificate.
isTokenSeparateint32NoWhether to separate accounts across applications. 0 (default): do not separate. 1: separate (account-related strategy features are independently tracked per application).
roomstringNoLive room / game room ID. Different strategies can be applied per room. Max 64 characters.
passThroughobjectNoClient pass-through field. Max 1024 bytes. ISHUMEI does not process this field; it is returned as-is with the result.
streamInfoobjectNoVideo stream frame deduplication parameters. Controls how many risk results are returned for the same stream. See streamInfo Object.

streamInfo Object

Controls risk return frequency for frames from the same video stream. Useful for reducing manual review costs.

ParameterTypeRequiredDescription
streamIdstringNoUnique stream identifier. Required when similarDedup is true. Max 64 characters.
similarDedupbooleanNoEnable similarity deduplication. true: enable. false: disable.
frameTimeint32NoMillisecond timestamp when the frame was captured. Required when similarDedup is true. 13 digits.
riskNumint32NoNumber of same-category risk results to return within the time window for the same streamId. Range: 1–5. Default: 1.
timeWindowint32NoTime window in seconds. Required when similarDedup is true. Default: 10.

Response

Response Parameters

ℹ️

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

ParameterTypeRequiredDescription
requestIdstringYesUnique ISHUMEI request identifier.
codeint32YesResponse code. See Response Codes.
messagestringYesResponse message corresponding to the code.
riskLevelstringYesDisposition recommendation. PASS: normal (allow), REVIEW: suspicious (manual review), REJECT: violation (block).
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". For reference only — do not use for programmatic logic.
resultTypeint32YesCurrent result type. 0: machine moderation. 1: human moderation.
finalResultint32YesWhether this is the final result. 0: not final (machine result; human review will follow). 1: final result (can be used directly). Defaults to 1 if only machine moderation is configured.
riskDetailobjectYesRisk detail information. See riskDetail Object.
auxInfoobjectYesAuxiliary information. See auxInfo Object.
allLabelsarrayYesAll risk labels. See allLabels Array.
businessLabelsarrayNoBusiness labels. See businessLabels Array.
disposalobjectNoCustom disposition and mapping result. Returned only when a custom label system is configured. See disposal Object.
tokenLabelsobjectYesAccount label information. Returned only when tokenId is provided and the feature is enabled. See tokenLabels Object.
tokenProfileLabelsarrayNoAccount attribute labels. Returned only when tokenId is provided and the labeling service is enabled. See Token Labels.
tokenRiskLabelsarrayNoAccount risk labels. Returned only when tokenId is provided and the labeling service is enabled. See Token Labels.

Response Codes

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

riskDetail Object

ParameterTypeRequiredDescription
riskSourceint32YesRisk source: 1000 (no risk), 1001 (text risk), 1002 (visual image risk).
face_numint32NoNumber of faces detected.
person_numint32NoNumber of persons detected.
facesarrayNoNames and positions of politically sensitive individuals. Up to 10 entries (highest probability selected if more than 10). See Face Object.
objectsarrayNoDetected objects/logos with names and positions. See Object Info.
ocrTextobjectNoOCR text content. Present when type includes IMGTEXTRISK or ADVERT. Contains text (string): recognized text.
matchedListsarrayNoMatched custom list information. See Matched Lists.
riskSegmentsarrayNoHigh-risk content segments. See Risk Segments.
personsarrayNoPerson names and positions. Up to 10 entries. See Person Object.

Face Object

ParameterTypeRequiredDescription
idstringNoIdentifier. Same person at the same position has the same ID across labels. If the same person appears N times, N IDs are assigned.
namestringNoPerson name.
face_ratiofloatNoFace-to-image ratio (0–1).
probabilityfloatNoConfidence score (0–1).
locationarrayNoPosition coordinates [x1, y1, x2, y2] (top-left and bottom-right corners).

Object Info

ParameterTypeRequiredDescription
idstringNoObject/logo identifier.
namestringNoObject name.
probabilityfloatNoConfidence score (0–1).
qrContentstringNoQR code URL detected in the image.
locationarrayNoPosition coordinates [x1, y1, x2, y2].

Matched Lists

ParameterTypeRequiredDescription
namestringNoName of the matched list.
wordsarrayNoSensitive word information.
words[].wordstringNoThe matched sensitive word.
words[].positionarrayNoPosition of the sensitive word.

Risk Segments

ParameterTypeRequiredDescription
segmentstringNoHigh-risk content segment.
positionarrayNoPosition of the segment (0-indexed).

Person Object

ParameterTypeRequiredDescription
idstringNoIdentifier. Same person has the same ID across labels.
person_ratiofloatNoPerson-to-image ratio (0–1).
probabilityfloatNoConfidence score (0–1).
locationarrayNoPerson position coordinates.

auxInfo Object

ParameterTypeRequiredDescription
segmentsint32YesNumber of segments actually processed.
downloadTimeintegerNoImage download time in milliseconds.
totalProcessTimeintegerNoTotal image processing time in milliseconds.
qrContentstringNoQR code URL detected in the image.
frameTimeint32NoReturned when streamInfo is provided and similarity deduplication is triggered.
streamIdstringNoReturned when streamInfo is provided and similarity deduplication is triggered.
passThroughobjectNoClient pass-through field returned as-is.

allLabels Array

Each element in the array:

ParameterTypeRequiredDescription
riskLevelstringNoRisk level: PASS, REVIEW, or REJECT.
riskLabel1stringNoLevel 1 risk label.
riskLabel2stringNoLevel 2 risk label.
riskLabel3stringNoLevel 3 risk label.
riskDescriptionstringNoRisk description. For reference only — do not use for programmatic logic.
probabilityfloatNoConfidence score (0–1).
riskDetailobjectNoRisk detail. Same structure as riskDetail Object.

businessLabels Array

Each element in the array:

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 (0–1).
confidenceLevelint32NoConfidence level (0–2). Higher values indicate greater confidence.
businessDetailobjectNoBusiness label details. May contain face_num, person_num, face_ratio, person_ratio, face_compare_num, name, probability, faces, objects, persons, and location with the same structure as riskDetail Object.

disposal Object

Returned only when a custom label system is configured with ISHUMEI. Contact your business manager to enable.

ParameterTypeRequiredDescription
riskLevelstringYesMapped disposition recommendation. Returns default recommendation if labels do not map.
riskLabel1stringYesMapped level 1 risk label. Returns normal when unmapped and riskLevel is PASS.
riskLabel2stringYesMapped level 2 risk label. Empty when unmapped and riskLevel is PASS.
riskLabel3stringYesMapped level 3 risk label. Empty when unmapped and riskLevel is PASS.
riskDescriptionstringYesMapped risk description. Returns "Normal" when riskLevel is PASS.
riskDetailobjectYesMapped risk detail. Same structure as riskDetail Object.

tokenLabels Object

Account risk profile information. Returned only when tokenId is provided and the feature is enabled.

ParameterTypeRequiredDescription
UGC_account_riskobjectNoUGC content-related risk.
UGC_account_risk.b_advertise_risk_tokenidint32NoAdvertising risk. 0: no risk found. 1: risk exists.
UGC_account_risk.b_advertise_risk_tokenid_last_tsint32NoAdvertising risk timestamp.
UGC_account_risk.b_politics_risk_tokenidint32NoPolitical risk. 0: no risk found. 1: risk exists.
UGC_account_risk.b_politics_risk_tokenid_last_tsint32NoPolitical risk timestamp.
UGC_account_risk.b_sexy_risk_tokenidint32NoPornographic risk. 0: no risk found. 1: risk exists.
UGC_account_risk.b_sexy_risk_tokenid_last_tsint32NoPornographic risk timestamp.
machine_account_riskobjectNoMachine-controlled account risk.
machine_account_risk.b_machine_control_tokenidint32NoMachine account. 0: not machine-controlled. 1: machine-controlled.
machine_account_risk.b_machine_control_tokenid_last_tsint32NoMachine account timestamp.
machine_account_risk.b_offer_wall_tokenidint32NoOffer wall account. 0: not an offer wall account. 1: offer wall account.
machine_account_risk.b_offer_wall_tokenid_last_tsint32NoOffer wall account timestamp.
scene_account_riskobjectNoScenario-specific account risk (e.g., airlines).
scene_account_risk.i_tout_risk_tokenidint32NoAirline seat-squatting account. 0: not a seat-squatter. 1: seat-squatter.
scene_account_risk.i_tout_risk_tokenid_last_tsint32NoSeat-squatting timestamp.

Token Labels

Both tokenProfileLabels and tokenRiskLabels share the same structure:

ParameterTypeRequiredDescription
label1stringNoLevel 1 label.
label2stringNoLevel 2 label.
label3stringNoLevel 3 label.
descriptionstringNoLabel description.
timestampint32NoLabel timestamp. 13-digit Unix timestamp in milliseconds.

Examples

Request Example

{
  "accessKey": "YOUR_ACCESS_KEY",
  "appId": "default",
  "eventId": "default",
  "type": "POLITY_EROTIC_VIOLENT_QRCODE_ADVERT",
  "data": {
    "img": "http://example.com/image.jpg",
    "tokenId": "username123"
  }
}

Response Example

{
  "allLabels": [
    {
      "probability": 0.922851562500734,
      "riskDescription": "Violence: Terrorism scene: Bloody",
      "riskDetail": {
        "ocrText": {
          "text": "Sample OCR text content"
        },
        "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
          }
        ],
        "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
          }
        ],
        "location": [228, 588, 256, 622],
        "name": "Example Person",
        "probability": 0.541935835649002
      },
      "businessLabel1": "face",
      "businessLabel2": "renlianleixing",
      "businessLabel3": "zhenren",
      "confidenceLevel": 2,
      "probability": 0.996093758527634
    },
    {
      "businessDescription": "Face: Face pose: Frontal face",
      "businessDetail": {},
      "businessLabel1": "face",
      "businessLabel2": "renlianzitai",
      "businessLabel3": "zhenglian",
      "confidenceLevel": 1,
      "probability": 0.450656906102068
    }
  ],
  "code": 1100,
  "finalResult": 1,
  "message": "Success",
  "requestId": "7cf340c0910b768e6904b342b908a4f0",
  "resultType": 0,
  "riskDescription": "Violence: Terrorism scene: Bloody",
  "riskDetail": {
    "ocrText": {
      "text": "Sample OCR text content"
    },
    "riskSource": 1002
  },
  "riskLabel1": "violence",
  "riskLabel2": "baokongchangjing",
  "riskLabel3": "xuexing",
  "riskLevel": "REJECT",
  "tokenLabels": {
    "UGC_account_risk": {}
  }
}