All Products
Document Center


Last Updated: May 09, 2018

This document describes how to use the Content Moderation API SDK of Alibaba Cloud Content Security service. Before using the SDK, you need to read the Content Moderation API documentation to learn about each interface’s functions.

Preparations for the SDK dependency development environment in each language

Follow the procedure in Alibaba Cloud SDK to prepare Alibaba Cloud SDK dependency environment for further development.

Download the SDK sample code

SDK description

  • We provide an interface in the SDK, the Image Moderation SDK API, to implement the smart pornography identification function. The API can be called by either of the following methods:
  1. Synchronous Image Moderation API: One image can be called at a time to ensure high moderation performance. The image moderation result is returned in real time.
  2. Asynchronous Image Moderation API: It can check multiple images in a batch and return a unique taskId for each image. You can obtain the moderation result of a certain image based on its taskId after 1 minute.
  • The Image Moderation API supports multiple scenes simultaneously. For example, for the smart pornography identification purpose, you can set two or more values for the “scenes” parameter when calling the API to apply this API to the corresponding scenes simultaneously.

Additional information

  1. The image link protocol can be either HTTP or HTTPS.
  2. The image format can be PNG, JPG, JPEG, BMP, or GIF.
  3. The maximum image size for synchronous calls is 5 MB and that for asynchronous calls is 20 MB. The download time-out period is 3 seconds.
  4. The recommended image pixel is not smaller than 256 x 256. If the pixel is excessively small, the identification performance may be adversely affected.
  5. The response period of the Image Moderation API is determined by the image download period. Make sure that the storage service of the images is stable. It is recommended to store the images in OSS or cache them in CDN.

Languages or environments supported by the Content Moderation API SDK