All Products
Search
Document Center

AI Guardrails:Synchronous detection

Last Updated:Mar 31, 2026

Moderates video content by analyzing uploaded video frames for pornographic, terrorist and political, undesirable, logo, and text violation content.

Operation description

Endpoint: POST /green/video/syncscan

This operation accepts up to 100 detection tasks per request, each containing up to 200 video frames. Submit frames as HTTP or HTTPS URLs — the operation downloads and analyzes each frame synchronously and returns results in the same response.

To moderate a video by URL instead of individual frames, use the asynchronous video detection operation.

For details on constructing HTTP requests, see Request structure. To use a pre-built client, see SDK overview.

Detection scenarios

Scenarioscenes valueResult labels
Pornography detectionpornnormal, porn
Terrorism and political contentterrorismnormal, terrorism
Inappropriate video contentlivenormal, live
Logo detectionlogonormal, logo
Violations in video, images, and textadnormal, ad
Video and Audio Content Violations is available only through the asynchronous video detection operation. This scenario detects non-compliant information in the audio of a video and returns the following result categories: Normal, Spam, Ad, Political, Terrorism, Abuse, Pornographic, Flooding, Contraband, Custom (such as hits on custom keywords). By default, the supported language is Chinese. To detect English content, contact your account manager.

Billing

Charges apply per scenario per frame analyzed. When multiple scenarios are specified, each scenario is billed separately:

Total fee = Number of frames analyzed per scenario × Unit price per scenario

Usage notes

Video frame requirements

  • URLs must use HTTP or HTTPS.

  • Supported formats: PNG, JPG, JPEG, BMP, GIF, WEBP.

  • Maximum frame size: 10 MB.

  • Minimum recommended resolution: 256 × 256 pixels (smaller frames may reduce moderation accuracy).

  • Use a reliable storage service such as Object Storage Service (OSS) or Content Delivery Network (CDN) to minimize download latency. Response time varies based on frame download speed.

QPS limits

50 calls per second per account. Exceeding this limit triggers throttling.

Request parameters

ParameterTypeRequiredExampleDescription
bizTypeStringNodefaultThe business scenario. Create and manage scenarios in the Content Moderation console. For details, see Customize policies for machine-assisted moderation.
scenesStringArrayYes["porn"]The moderation scenarios to run. Valid values: porn, terrorism, live, logo, ad. Multiple values are allowed.
tasksJSONArrayYesThe detection tasks. Maximum: 100 elements per request. Each element follows the task structure below. To submit 100 concurrent tasks, set the concurrency limit to more than 100.

task

ParameterTypeRequiredExampleDescription
dataIdStringNovideoId****An identifier for the moderation object. Accepted characters: letters, digits, underscores (_), hyphens (-), and periods (.). Maximum length: 128 characters. The value is echoed in the response.
framesJSONArrayYesThe video frames to moderate. Maximum: 200 frames per task. Each element follows the frame structure below.
framePrefixStringNoA URL prefix prepended to each frame.url value. The complete frame URL is constructed as framePrefix + frame.url.
clientInfoJSONObjectNo{"userId":"12023****","userNick":"Mike","userType":"others"}Client metadata. For the full structure, see the "Common request parameters" section of Common parameters. When set, this value takes priority over the global clientInfo parameter.

frame (request)

ParameterTypeRequiredExampleDescription
urlStringYeshttp://www.aliyundoc.com/test0001.jpgThe publicly accessible HTTP or HTTPS URL of the video frame. Maximum length: 2,048 characters.
offsetIntegerNo10The timestamp of the frame within the video, relative to the start. Unit: seconds.

Response elements

ParameterTypeExampleDescription
codeInteger200The HTTP status code for the overall request. For details, see Common error codes.
msgStringOKThe response message for the overall request.
requestIdStringrequestID****The request ID.
dataJSONArrayThe per-task moderation results. Each element follows the per-task structure below.

Per-task response

ParameterTypeExampleDescription
codeInteger200The HTTP status code for this task.
msgStringOKThe response message for this task.
dataIdStringvideoId****The identifier from the request. Returned only if dataId was set in the request.
taskIdStringtaskId****The detection task ID.
resultsJSONArrayThe moderation results, one element per scenario. Each element follows the result structure below. Populated when code is 200.

result

ParameterTypeExampleDescription
sceneStringpornThe detection scenario. Matches the value specified in the request. Valid values: porn, terrorism, live, logo, ad.
labelStringpornThe result category for this scenario. See Detection scenarios for the full list of labels per scenario.
sublabelStringpornA subcategory of the result. Returned only for porn and terrorism scenarios, and only when available. Not returned by default.
suggestionStringblockThe recommended action. Valid values: pass (content is normal; no action required), review (uncertain; manual review required), block (non-compliant; delete or restrict the content).
rateFloat99.2The confidence score for the result. Range: 0–100. A higher score with suggestion: pass indicates higher confidence that the content is normal. A higher score with suggestion: review or block indicates higher confidence that the content contains violations. Use suggestion, label, and sublabel to determine the moderation outcome — do not use rate alone.
framesJSONArrayThe frames that triggered a non-compliant result. Each element follows the frame (response) structure below.
extrasJSONObjectAdditional context. In the ad scenario, may contain hitLibInfo if the content matches a custom text library.
hintWordsInfoJSONArrayThe risk keywords that were matched. Returned only in the ad scenario. Each element follows the hintWordsInfo structure below.
logoDataJSONArrayThe detected logo details. Returned only in the logo scenario. Each element follows the logoData structure below.
sfaceDataJSONArrayThe detected face details from terrorism and political content. Returned only in the terrorism scenario. Each element follows the sfaceData structure below.

frame (response)

ParameterTypeExampleDescription
urlStringhttp://www.aliyundoc.com/test0001.jpgThe HTTP or HTTPS URL of the frame. Maximum length: 2,048 characters.
offsetInteger50The timestamp of the frame within the video. Unit: seconds.
labelStringpornThe result category for this frame.
rateFloat99.1The confidence score for this frame. Range: 0–100. Do not use this score in your moderation logic.

logoData

ParameterTypeExampleDescription
typeStringTVThe type of the detected logo. Valid value: TV (TV station logo).
nameStringxxx unitsThe name of the detected logo.
xFloat140The x-coordinate of the upper-left corner of the logo region. Origin: upper-left corner of the frame. Unit: pixels.
yFloat68The y-coordinate of the upper-left corner of the logo region. Unit: pixels.
wFloat106The width of the logo region. Unit: pixels.
hFloat106The height of the logo region. Unit: pixels.

sfaceData

ParameterTypeExampleDescription
xFloat49The x-coordinate of the upper-left corner of the detected face region. Origin: upper-left corner of the frame. Unit: pixels.
yFloat39The y-coordinate of the upper-left corner of the face region. Unit: pixels.
wFloat97The width of the face region. Unit: pixels.
hFloat131The height of the face region. Unit: pixels.
facesJSONArray[{"name":"Hit Person Name","rate":91.54,"id":"AliFace_0123****"}]Details of the detected faces. Each element contains: name (String, the name of the matched person), rate (Float, confidence score from 0 to 100), and id (String, the face ID).

hitLibInfo

ParameterTypeExampleDescription
contextStringHaokan VideoThe text from the custom library that was matched.
libCodeString123456The code of the custom library that contains the matched text.
libNameStringabcThe name of the custom library that contains the matched text.

hintWordsInfo

ParameterTypeExampleDescription
contextStringGood videoThe risk keyword that was matched.

Examples

Request

POST http(s)://[Endpoint]/green/video/syncscan
<Common request parameters>
{
    "scenes": [
        "porn"
    ],
    "tasks": [
        {
            "dataId": "videoId****",
            "frames": [
                {
                    "offset": 10,
                    "url": "http://www.aliyundoc.com/0B860000586C0A0300038A0460000"
                },
                {
                    "offset": 20,
                    "url": "http://www.aliyundoc.com/0B860000586C0A0300038A0460001"
                },
                {
                    "offset": 30,
                    "url": "http://www.aliyundoc.com/0B860000586C0A0300038A0460002"
                },
                {
                    "offset": 40,
                    "url": "http://www.aliyundoc.com/0B860000586C0A0300038A0460003"
                },
                {
                    "offset": 50,
                    "url": "http://www.aliyundoc.com/0B860000586C0A0300038A0460003"
                },
                {
                    "offset": 60,
                    "url": "http://www.aliyundoc.com/0B860000586C0A0300038A046000x"
                }
            ]
        }
    ]
}

Response

{
    "code": 200,
    "msg": "OK",
    "requestId": "requestID****",
    "data": [
        {
            "code": 200,
            "msg": "OK",
            "dataId": "videoId****",
            "taskId": "taskId****",
            "results": [
                {
                    "label": "porn",
                    "rate": 99.2,
                    "scene": "porn",
                    "suggestion": "block",
                    "frames": [
                        {
                            "offset": 50,
                            "url": "http://www.aliyundoc.comm/0B860000586C0A0300038A0460003",
                            "label": "porn",
                            "rate": 99.1
                        }
                    ]
                }
            ]
        }
    ]
}

In this example, the operation analyzed 6 frames from one video in the porn scenario. One frame (at the 50-second offset) triggered a block recommendation with a confidence score of 99.2.