Content Moderation-Plus provides enhanced detection to identify risks such as fraud, sexual content, and gambling in third-party URLs, safeguarding your platform's content ecosystem. This topic describes the services available in Content Moderation-Plus for URL risk detection and how to use them.
Features
Content Moderation-Plus provides the following moderation services to support URL risk detection. Choose the service that best fits your business needs based on its distinct use cases and features.
Use case | Supported service | Description |
Ideal for user chat or comment scenarios that require identifying risks in both text and embedded URLs. | Service name: Comment Detection Service: comment_detection |
|
Suitable for scenarios where you need to detect risks in standalone URLs, such as in-app browsers, URL publishing or sharing features, and URLs within SMS messages. | Service name: URL risk detection Service: url_detection |
|
Detection capabilities
The Content Moderation-Plus URL detection service uses the following label structure to identify URL risks and return basic information about the URL.
Capability | Description |
Risk labels |
|
Basic information |
|
Supported URL format
The Content Moderation-Plus URL detection service supports URLs that conform to the following format: http(s)://{IP or domain name}{:port}{/path}
The URL can be provided with or without the http:// or https:// prefix.
The domain name consists of letters and numbers separated by periods (.). The top-level domain must be 2 to 6 letters long.
The port number can be 1 to 4 digits.
The path can contain letters, numbers, and common characters such as
_!~*'().;?:@&=+$,%#-), but not Chinese characters.
If an input URL does not conform to this format, the API returns the BAD_REQUEST (400) error code.
Billing
Content Moderation-Plus supports pay-as-you-go and resource plan billing.
Pay-as-you-go
After you enable Content Moderation-Plus, the service defaults to pay-as-you-go billing. You are charged daily based on actual usage, and no fees are incurred if you do not use the service.
Moderation type | Supported service | Unit price |
Text Moderation Standard (text_standard) | URL risk detection: url_detection | CNY 7.50 per 10,000 requests |
Resource plan
If you have a large or consistent volume of moderation tasks, we recommend that you purchase a resource plan in advance. Larger resource plans offer greater discounts. You can purchase and use multiple resource plans. For more information, see Purchase a resource plan for Content Moderation-Plus.
This resource plan covers usage of Content Moderation-Plus and cannot be shared with resource plans for Content Security. The specific deduction factors are as follows:
Moderation type | Supported service | Deduction factor |
Text Moderation Standard (text_standard) | URL risk detection: url_detection | A deduction factor of 1 means that each successful API call consumes 1 call from your resource plan. For example, if you purchase a resource plan with a capacity of 10 calls, one successful API call consumes 1 call, leaving a remaining balance of 9 calls. |
Get started
Step 1: Enable the service
Visit the Enable Service page to enable Content Moderation-Plus.
After you enable Content Moderation-Plus, the default billing method is pay-as-you-go. You are charged based on your actual usage, and fees are settled daily. No fees are incurred if you do not use the service. After you integrate the API, the system automatically generates bills based on your usage. For more information, see Billing. You can also purchase resource plans, which offer tiered discounts and are ideal for users with predictable or high-volume usage.
Step 2: Grant permissions to a RAM user
Before you integrate an SDK or API, you must grant permissions to a RAM user. You can create an AccessKey for your Alibaba Cloud account or a RAM user. You must use the AccessKey for authentication when you call Alibaba Cloud APIs. For more information, see Obtain an AccessKey.
Procedure
Log on to the RAM console with your Alibaba Cloud account.
Create a RAM user.
For details, see Create a RAM user.
Grant the
AliyunYundunGreenWebFullAccesssystem policy to the RAM user.For details, see Grant permissions to a RAM user.
After completing these steps, you can call the Content Moderation API as the RAM user.
Step 3: Install and integrate an SDK
The service is available in the regions listed below. For SDK integration, refer to Get started and the Content Moderation-Plus 2.0 SDK and integration guide.
Region | Public endpoint | Internal endpoint |
China (Shanghai) | green-cip.cn-shanghai.aliyuncs.com | green-cip-vpc.cn-shanghai.aliyuncs.com |
China (Beijing) | green-cip.cn-beijing.aliyuncs.com | green-cip-vpc.cn-beijing.aliyuncs.com |
China (Hangzhou) | green-cip.cn-hangzhou.aliyuncs.com | green-cip-vpc.cn-hangzhou.aliyuncs.com |
China (Shenzhen) | green-cip.cn-shenzhen.aliyuncs.com | green-cip-vpc.cn-shenzhen.aliyuncs.com |
China (Chengdu) | green-cip.cn-chengdu.aliyuncs.com | Not available |
API
Usage
Service endpoint: https://green-cip.{region}.aliyuncs.com.
Call this API to create a text content detection task. For information about how to construct an HTTP request, see Request structure. You can also use a pre-constructed HTTP request. For more information, see Get started.
Billing:
This pay-as-you-go API bills only for successful requests that return an HTTP 200 status code. Requests that result in other status codes are not billed. For more information about billing, see Billing.
QPS limit
The QPS limit for this API is 100 queries per second (QPS) per user. If this limit is exceeded, API calls are throttled, which may affect your business.
Request parameters
Parameter | Type | Required | Example | Description |
Service | String | Yes | url_detection | The type of moderation service. Valid value:
|
ServiceParameters | JSONString | Yes | A JSON string that contains the parameters required for the service. For field descriptions, see the following table. |
Table 1. ServiceParameters
Parameter | Type | Required | Example | Description |
content | String | Yes | http://example.com | The URL to be moderated. Maximum length: 600 characters. |
accountId | String | No | 10123**** | The unique ID of an account. |
deviceId | String | No | 20240307**** | The unique ID of a device. |
deviceToken | String | No | MzQvo1d7scyZ3tl_RcJ****** | The device token obtained from the Risk Control SDK. |
Response parameters
Parameter | Type | Example | Description |
Code | Integer | 200 | The status code. For more information, see Status codes. |
Data | JSONObject | {"labels":"sexual_url","reason":"..."} | The moderation result data. For more information, see Data. |
Message | String | OK | The response message. |
RequestId | String | AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE**** | The request ID. |
Table 2. Data
Parameter | Type | Example | Description |
Labels | String | sexual_url | The risk labels. Multiple labels are separated by commas (,). Valid values:
|
Reason | String | {\"icpType\":\"Enterprise\",\"icpNo\":\"ICP123XXXX789\",\"score\":\"90\"} | A JSON string that contains the following additional information:
|
AccountId | String | 10123**** | The account ID. Note This parameter is returned if you specified |
DeviceId | String | 20240307**** | The device ID. Note This parameter is returned if you specified |
Examples
Sample request
{
"Service": "url_detection",
"ServiceParameters": {
"content": "http://aliyun.com/abc",
"accountId": "10123****"
}
}Sample success response
{
"Code": 200,
"Data": {
"Labels": "unmarked_url",
"Reason": "{\"icpType\":\"Enterprise\",\"icpNo\":\"ICP123XXXX789\",\"score\":\"60\"}"
},
"Message": "OK",
"RequestId": "AAAAAA-BBBB-CCCCC-DDDD-EEEEEEEE****"
}Status codes
Code | Status code | Description |
200 | OK | The request was successful. |
400 | BAD_REQUEST | The request is invalid, likely due to incorrect request parameters. Check the parameters and retry. |
407 | NOT_SUPPORT | The language is not recognized or supported. |
408 | PERMISSION_DENY | Permission denied. This can occur if your account is unauthorized, has an overdue payment, has not enabled the service, or is suspended. |
500 | GENERAL_ERROR | An internal server error occurred. We recommend that you retry the request. If the error persists, contact us through Online Support. |
581 | TIMEOUT | The request timed out. We recommend that you retry the request. If the error persists, contact us through Online Support. |
588 | EXCEED_QUOTA | The request rate exceeds the specified limit. |