DescribeKeyword

更新时间:
复制 MD 格式

Queries keywords in a specified custom text library using fuzzy match, with support for paginated results. You can use text libraries for text anti-spam.

Operation description

Operation: DescribeKeyword

Queries keywords by page in a specified text library. Managing custom text libraries via API has the same effect as managing them in the Alibaba Cloud AI Guardrails console.

For information about constructing HTTP requests, see Request structure. For SDK support, see SDK overview.

Billing: Free of charge.

QPS limits

10 calls per second per account. Exceeding this limit triggers throttling, which may affect your service. We recommend that you take note of the limit when you call this operation.

Request parameters

For common request parameters required in all API requests, see Common parameters.

ParameterTypeRequiredExampleDescription
KeywordLibIdIntegerYes2147The primary key ID of the text library. To get the library ID, call the DescribeKeywordLib operation.
KeywordStringNoHelloThe keyword to search for. Fuzzy match is supported. If not specified, all keywords in the library are returned.
TotalCountIntegerNo1000The number of keywords to return.
CurrentPageStringNo1The page number to return.
PageSizeIntegerNo20The number of entries per page.

Response parameters

For common response parameters, see Common response parameters.

ParameterTypeExampleDescription
TotalCountInteger1000The total number of keywords returned.
CurrentPageString1The current page number.
PageSizeInteger20The number of entries per page.
KeywordListJSONArrayThe list of keywords. For the structure of each item, see the KeywordList table below.

KeywordList

ParameterTypeExampleDescription
IdInteger1The primary key ID of the keyword.
CreateTimeString2018-04-19 20:12:30 +0800The time when the keyword was created.
KeywordStringHelloThe keyword.
HitCountInteger101The number of times the keyword was matched.

Examples

Sample request

http(s)://green.cn-shanghai.aliyuncs.com/?Action=DescribeKeyword&ServiceModule=open_api
&<Common request parameters>
{
  "KeywordLibId": "2147"
}

Sample success response

{
  "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": "Test",
        "HitCount": 102,
        "CreateTime": "2018-04-19 20:12:30 +0800",
        "Id": 2
      }
    ]
  }
}