This topic provides answers to the frequently asked questions (FAQ) about the Content Moderation API.

How can I query the statistics on the Content Moderation API?

The Content Moderation console collects statistics on the Content Moderation API. You can query the number of times that Content Moderation operations were called to moderate images, videos, text over the last year.

For more information, see Data statistics.

Which operation can I call to moderate text in Content Moderation?

You can call the /green/text/scan operation to detect whether the specified Chinese or English text contains violations.

For more information about the /green/text/scan operation, see Text Synchronous moderation.

How do I give feedback on the errors in text moderation results in Content Moderation?

If you find that the text moderation results contain errors, you can call the /green/text/feedback operation to give feedback on the errors.

For more information, see Give feedback on moderation results.

How can I view the descriptions of the parameters that are returned after a Content Moderation operation is called?

You can view the common response parameters and common HTTP status codes that are returned after Content Moderation operations are called.

For more information, see Common parameters.

Can I include the signature information of an API request in the request body?

No, the signature information must be included in the request header. You must set the signature parameter in the Authorization header of an HTTP request to specify the signature information for verification. We recommend that you use Content Moderation SDKs. Content Moderation supports SDKs for various programming languages such as Java, Python, and PHP.

For more information, see Common parameters and SDK overview.

Can illegal links in the text be detected during text moderation?

No, Content Moderation can detect violations, but not illegal links, in the text during text moderation.

How long does the moderation duration of a Content Moderation operation last?

The moderation duration of different Content Moderation operations varies.
  • Images: An image takes about 300 milliseconds to moderate, excluding the download duration.
  • Videos:
    • Video files: A video file can be moderated at a speed about one to six times the playback speed, excluding the download duration. For example, the moderation speed is six times the playback speed. In this case, a 6-minute video takes 1 minute to moderate.
    • Video streams: The moderation duration of video streams varies based on the frame rate. In general, moderation results are returned within a second after a frame is captured.
  • Text: In general, moderation results are returned within 50 milliseconds.

Can I use Composer to download Content Moderation SDK for PHP?

Yes, you can use Composer to download Content Moderation SDK for PHP, provided that your Composer supports PHP 5.3 or later. No tutorial is provided for installing Composer.

For more information about how to install Content Moderation SDK for PHP, see Installation.

Can I call the /green/text/scan operation to moderate English text in Content Moderation?

Yes, you can call the /green/text/scan operation to moderate English text.

For more information, see Text Synchronous moderation.

Can I call a video moderation operation to moderate a video whose size is larger than 2 GB in Content Moderation?

By default, the size of a single video to be moderated in Content Moderation cannot exceed 200 MB. You can contact the technical support to raise the size limit up to 2 GB as needed. If you want to moderate a video whose size is larger than 2 GB, we recommend that you segment the video into multiple video segments and then moderate them. By default, 200 frames are captured from a video. If you want to capture more frames from a large video for moderation, you must set the maxFrames parameter. By default, a maximum of 3,600 frames can be captured.

For more information, see Asynchronous moderation.

What permissions does a RAM user require to call a Content Moderation operation? How are the permissions granted?

You can use the AccessKey ID and AccessKey secret of a RAM user to call a Content Moderation operation. Before you call a Content Moderation operation as a RAM user, permissions must be granted to the RAM user.

For more information, see Call the Content Moderation API as a RAM user.

What is the size limit of an image to be moderated in Content Moderation?

Content Moderation can moderate an image of which the size does not exceed 20 MB, the height or width does not exceed 30,000 pixels, and the total resolution does not exceed 0.25 billion pixels.

For more information, see Synchronous moderation.

What is a concurrency limit for calling Content Moderation operations?

A concurrency limit specifies the total number of images, videos, or text entries that can be moderated at the same time. This limit applies to both the pay-as-you-go billing method and subscription plans.

The following table describes the concurrency limits for calling Content Moderation operations to moderate different types of objects.
Moderation object Default concurrency limit Unit Description
Image 50 N/A The maximum number of images that can be moderated per second.
Video 20 N/A The maximum number of videos that can be moderated at the same time. Files and streams are not differentiated.
Text 100 Entry The maximum number of text entries that can be moderated per second. Each text entry contains less than 200 characters.
Note
  • Images, videos, or text entries moderated within the default concurrency limit are free of charge. To adjust the default concurrency limit, submit aticket. If you raise the default concurrency limit, you will have extra charges.
  • By default, if an object is simultaneously moderated in multiple scenarios, only one object is counted. For example, if you send an API request to moderate an image for pornography and terrorist content at the same time, only one image is counted.

Can I submit the internal URLs of objects for moderation?

No, only public URLs are supported for moderation. If you worry about the risks of data leaks, we recommend that you set a short validity period for the public URLs, such as 10 minutes.

How do I moderate images that exceed the size limit?

We recommend that you compress the images before you submit them for moderation. When the resolution of an image is greater than 256 × 256 pixels, the resolution has little impact on the moderation results.

Can I create HTTP requests to call Content Moderation operations?

Yes, you can create HTTP requests to call Content Moderation operations. However, you must sign each request, which is a tedious operation. We recommend that you use the SDKs provided on the Alibaba Cloud official website to call Content Moderation operations.

Can I use the AccessKey pair of a RAM user to call Content Moderation operations?

  • You can use the AccessKey pair of a RAM user to call Content Moderation operations whose API version is V20160621 or later. For more information about the required dependencies, see SDK overview.
  • You cannot use the AccessKey pair of a RAM user to call Content Moderation operations whose API version is earlier than V20160621. Otherwise, an AccessDenied error is returned.

Does the Content Moderation API provide call examples?

Yes, the Content Moderation API provides call examples. You can download the examples in SDK Reference. For more information, see SDK overview.
Note The version date of a call example changes as the API is updated. We recommend that you check the official documentation on a regular basis.

Can I use an SDK for .NET to call Content Moderation operations?

No, Content Moderation does not provide an SDK for .NET. We recommend that you use Content Moderation SDKs for other programming languages. Alternatively, you can create HTTP requests to call Content Moderation operations.

For more information, see SDK overview and Request syntax.

Can Content Moderation moderate images in the GIF format?

Yes, Content Moderation can moderate images in the PNG, JPG, JPEG, BMP, GIF, or WEBP format.

For more information, see Synchronous moderation.

Can I extend the maximum download duration from 3 seconds to a longer period of time when I call a Content Moderation operation?

No, the maximum download duration cannot be extended. If download errors frequently occur when you call a Content Moderation operation to moderate an image, check whether the image URL is accessible or whether the image can be downloaded within 3 seconds. You can select a region nearest to the region where your server resides. This saves time for calling operations.

For more information, see Endpoints.

How many images can be moderated at most each time the /green/image/scan operation is called in Content Moderation?

A maximum of 100 images can be moderated each time. In other words, 100 images can be submitted for moderation each time. To moderate 100 images each time, you must raise the default concurrency limit for images. By default, a maximum of 50 images, 100 text entries, 20 videos, entries can be moderated each time.

For more information, see Synchronous moderation and Pricing.

Can I call a single Content Moderation operation to simultaneously moderate content in multiple scenarios, such as pornography detection and terrorist content detection?

Yes, you can call a single Content Moderation operation to simultaneously moderate content in multiple scenarios. To do this, set the scenes parameter in an API request to specify multiple scenarios. For example, you can set the scenes parameter to ["porn","terrorism"] to intelligently detect pornography and terrorist content in images. If your moderation involves multiple scenarios at a time, you are charged for all the scenarios. The cost of each scenario equals the number of images that are moderated in the scenario multiplied by the unit price of the scenario.

For more information, see Synchronous moderation and Pricing.

What domain names and ports are available for calling Content Moderation operations?

If you need to configure a network security policy, we recommend that you enable access from *.aliyuncs.com and enable ports 80 and 443.

How can I call a video moderation operation in Content Moderation to moderate a video in ApsaraVideo VOD?

To call a video moderation operation in Content Moderation to moderate a video in ApsaraVideo VOD, you cannot directly submit the ID of the video. You must submit a sequence of frames that are captured from the video or a URL that can be used to access the video.

For more information, see Asynchronous moderation.

Can Content Moderation moderate M3U8 video files?

No, Content Moderation cannot moderate M3U8 video files. Content Moderation can moderate video files in the following formats: AVI, FLV, MP4, MPG, ASF, WMV, MOV, WMA, RMVB, RM, FLASH, and TS.

For more information, see Asynchronous moderation.

How long does an asynchronous task for video moderation take?

The duration of an asynchronous task for video moderation depends on the download duration of the object to be moderated. In addition, the duration that is required to moderate different types of objects varies.
  • Video files: A video file can be moderated at a speed about one to six times the playback speed, excluding the download duration. For example, the moderation speed is six times the playback speed. In this case, a 6-minute video takes 1 minute to moderate.
  • Video streams: The moderation duration of video streams varies based on the frame rate. In general, moderation results are returned within a second after a frame is captured.

Can I call Content Moderation operations in a region of the United States to moderate videos?

No, Content Moderation operations cannot be called in a region of the United States. The following regions are supported:

  • China (Shanghai): cn-shanghai
  • China (Beijing): cn-beijing
  • China (Shenzhen): cn-shenzhen
  • Singapore (Singapore): ap-southeast-1

If you run your business outside China, we recommend that you use the endpoint of the Singapore (Singapore) region to call Content Moderation operations. For more information, see Endpoints.

What are the differences between the /green/video/syncscan and /green/video/asyncscan operations in Content Moderation?

To call the /green/video/syncscan operation, you must submit a sequence of frames that are captured from the video to be moderated. If you want to submit a video URL to specify the video to be moderated, we recommend that you call the /green/video/asyncscan operation.

The /green/video/asyncscan operation can be called to moderate video files and video streams. To moderate a video file, you can submit a sequence of frames that are captured from the video file or a URL that specifies the video file. However, you cannot obtain the moderation results of an asynchronous moderation task in real time. To obtain the moderation results, you can set the callback parameter in the API request. Alternatively, you can call the /green/video/results operation to poll the moderation results.

For more information, see Synchronous moderation and Asynchronous moderation.

Can I set the callback parameter in an API request for asynchronous image moderation by using Content Moderation SDK for Java?

Yes, you can set the callback parameter in an API request for asynchronous image moderation.

For more information, see Image moderation.

What does the BizType parameter specify in Content Moderation?

The BizType parameter specifies a business scenario. Each business scenario corresponds to a moderation policy. Before you use the Content Moderation API, we recommend that you create business scenarios based on your business requirements. After you customize a moderation policy based on a business scenario, you can specify the business scenario in an API request for content moderation. In this case, the corresponding moderation policy takes effect.

For more information, see Customize policies for machine-assisted moderation.

What is the purpose of associating a text library with multiple business scenarios in Content Moderation?

When you create a custom text or image library, we recommend that you associate the custom text or image library with the business scenario to which the library applies. For example, your text library is associated with Business scenario A, and you have specified Business scenario A in an API request for text moderation. In this case, the text library that is associated with Business scenario A is used for text moderation. Otherwise, all enabled text libraries are used for text moderation.

For more information, see Manage custom text libraries.

Why is the value of the checksum parameter in the callback notification different from the calculated value after I call the /green/video/asyncscan operation?

The value of the checksum parameter is a string in the <UID> + <Seed> + <Content> format. It is generated by using the Secure Hash Algorithm 256 (SHA-256) algorithm. UID indicates the ID of your Alibaba Cloud account. You can query the ID in the Alibaba Cloud Management Console. To prevent data in the callback notification from being tampered with, you can use the SHA-256 algorithm to generate a string when your server receives the callback notification. Then, you can verify the string against the received checksum parameter.

For more information, see Enable callback notification.

Why is no data ID returned after I call the /green/text/scan operation in Content Moderation?

If you have specified a data ID in the API request for the /green/text/scan operation, the data ID is returned after you call the operation.

For more information, see Text Synchronous moderation.

Why are different labels returned for the same image in single-scenario moderation and multi-scenario moderation?

In general, this is because the configurations in multiple scenarios are different from those in a single scenario. Therefore, the configurations conflict when the same image is moderated across scenarios. We recommend that you contact algorithm engineers to check whether the scenario configurations are different. Alternatively, you can moderate the same image separately in different scenarios.

For more information, see Synchronous moderation and Image moderation.

Why is the context parameter not returned in text moderation results?

The context parameter indicates the risky terms that the moderated text hits. The hit terms are returned. If the moderated text hits other policies such as algorithm models or text patterns, this parameter is not returned.

For more information, see Text Synchronous moderation.

Why is the filteredContent parameter returned but the context parameter not returned in text moderation results?

The filteredContent parameter indicates the text that is returned after hit terms in the moderated text are redacted with asterisks (*). If the moderated text hits specific terms or text patterns in your custom text library, this parameter is returned. The context parameter indicates the risky terms that the moderated text hits. The hit terms are returned. If the moderated text hits other policies such as algorithm models or text patterns, this parameter is not returned.

For more information, see Text Synchronous moderation.

Why do text moderation results contain no emojis?

Content Moderation cannot recognize emojis in text. Emoji characters are filtered out in the returned moderation results.

Do the accuracy rate and detection rate of synchronous image moderation differ from those of asynchronous image moderation in Content Moderation?

No, synchronous image moderation and asynchronous image moderation have the same moderation effects. The only difference is that they are implemented by different operations.

Why am I unable to download the ClientUploader utility class that is used to moderate local files and binary files for Content Moderation SDK for Java?

You must download the ClientUploader utility class for Content Moderation SDK for Java and import it to your project.

For more information about the download URL and procedure, see Installation.

Why does the aliyunsdkcore library fail to be installed for Content Moderation SDK for Python 3.5.4 and 3.8.8?

We recommend that you install Content Moderation SDK for Python 3.x of mainstream versions. In this case, if the aliyunsdkcore library still fails to be installed, you can download the aliyunsdkcore library and import it to your project.

For more information, see Installation.

How do I install the aliyunsdkgreenextension utility class of Content Moderation SDK for Python?

You must download the aliyunsdkgreenextension utility class and import it to your project.

For more information, see Installation.