This topic describes how to call the DescribeKeyword operation to query 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.

Description

Operation: DescribeKeyword

You can call this operation to query terms by page in a specified text library.

Request parameters

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

The following table describes the parameters in the request body.
Parameter Type Required Description
KeywordLibId Numeric Yes The primary key ID of the text library.
Keyword String No The term to query. Fuzzy matching is supported.
Note If you do not specify this parameter, all terms in the text library are returned.
TotalCount Numeric No The number of terms to return.
CurrentPage String No The number of the page to return.
PageSize Numeric string No 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 Required Description
TotalCount Numeric No The number of returned terms.
CurrentPage String No The page number of the returned page.
PageSize Numeric string No The number of entries returned per page.
KeywordList JSON array Yes The terms. For more information about the parameter structure, see KeywordList.
Table 1. KeywordList
Parameter Type Required Description
Id Numeric Yes The primary key ID of the term.
CreateTime String Yes The time when the term was created.
Keyword String Yes The term.
HitCount Numeric Yes The number of times that the term was hit.

Examples

Sample requests
{
  "KeywordLibId": "2147",
}
Sample success responses
{
  "code": 200,
  "requestId": "@guid",
  "data": {
    "TotalCount": 1000,
    "PageSize": 20,
    "CurrentPage": 1,
    "KeywordList": [
      {
        "Keyword": "USA",
        "HitCount": 101,
        "CreateTime": "2018-04-19 20:12:30 +0800",
        "Id": 1
      },
      {
        "Keyword": "Donald Trump",
        "HitCount": 102,
        "CreateTime": "2018-04-19 20:12:30 +0800",
        "Id": 2
      }
    ]
  }
}