Queries terms in a specified custom text library in fuzzy mode. You can use text libraries for text anti-spam. The effect of managing custom text libraries by calling API operations is the same as that of managing custom text libraries in the Alibaba Cloud Content Moderation console.

Operation description

Operation: DescribeKeyword

You can call this operation to query terms by page in a specified text library. For more information about how to construct an HTTP request, see Request structure. You can also select an existing HTTP request. For more information, see SDK overview.

Billing method: This operation is free of charge.

QPS limit

You can send up to 10 requests per second to call this operation by using your Alibaba Cloud account. If you send an excessive number of requests, throttling is implemented, and your business may be affected.

Request parameters

For more information about the common request parameters that must be included in all Content Moderation API requests, see Common parameters.

The following table describes the parameters in the request body.
Parameter Type Required Example Description
KeywordLibId Integer Yes 2147 The primary key ID of the text library. You can call the DescribeKeywordLib operation to obtain the primary key ID of a text library. For more information, see DescribeKeywordLib.
Keyword String No Hello The term to query. Fuzzy match is supported.
Note If you do not specify this parameter, all terms in the text library are returned.
TotalCount Integer No 1000 The number of terms to return.
CurrentPage String No 1 The number of the page to return.
PageSize Integer No 20 The number of entries to return on each page.

Response parameters

For more information about common response parameters that this operation returns, see Common response parameters.
Parameter Type Example Description
TotalCount Integer 1000 The number of returned terms.
CurrentPage String 1 The page number of the returned page.
PageSize Integer 20 The number of entries returned per page.
KeywordList JSONArray The list of terms. For more information about the parameter structure, see KeywordList.
Table 1. KeywordList
Parameter Type Example Description
Id Integer 1 The primary key ID of the term.
CreateTime String 2018-04-19 20:12:30 +0800 The time when the term was created.
Keyword String Hello The term.
HitCount Integer 101 The number of times that the term was hit.

Examples

Sample requests
http://[Endpoint]/green/image/scan
&<Common request parameters>
{
  "KeywordLibId": "2147",
}
Sample success responses
{
  "code": 200,
  "requestId": "@guid",
  "data": {
    "TotalCount": 1000,
    "PageSize": 20,
    "CurrentPage": 1,
    "KeywordList": [
      {
        "Keyword": "Hello",
        "HitCount": 101,
        "CreateTime": "2018-04-19 20:12:30 +0800",
        "Id": 1
      },
      {
        "Keyword": "Joe Biden",
        "HitCount": 102,
        "CreateTime": "2018-04-19 20:12:30 +0800",
        "Id": 2
      }
    ]
  }
}