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.
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| KeywordLibId | Integer | Yes | 2147 | The primary key ID of the text library. To get the library ID, call the DescribeKeywordLib operation. |
| Keyword | String | No | Hello | The keyword to search for. Fuzzy match is supported. If not specified, all keywords in the library are returned. |
| TotalCount | Integer | No | 1000 | The number of keywords to return. |
| CurrentPage | String | No | 1 | The page number to return. |
| PageSize | Integer | No | 20 | The number of entries per page. |
Response parameters
For common response parameters, see Common response parameters.
| Parameter | Type | Example | Description |
|---|---|---|---|
| TotalCount | Integer | 1000 | The total number of keywords returned. |
| CurrentPage | String | 1 | The current page number. |
| PageSize | Integer | 20 | The number of entries per page. |
| KeywordList | JSONArray | — | The list of keywords. For the structure of each item, see the KeywordList table below. |
KeywordList
| Parameter | Type | Example | Description |
|---|---|---|---|
| Id | Integer | 1 | The primary key ID of the keyword. |
| CreateTime | String | 2018-04-19 20:12:30 +0800 | The time when the keyword was created. |
| Keyword | String | Hello | The keyword. |
| HitCount | Integer | 101 | The 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
}
]
}
}