HotNewsRecommend - Recommend trending news

Updated at:

Recommends trending news.

Usage notes

Understands user intent and retrieves the trending topic list of the corresponding channel, for example, "Read sports news." This is a legacy API. We recommend that you use the broadcast list (trending list) question answering API RunHotTopicChat, which fully covers the capabilities of this API.

You can try it in the console.

For information about calling the API by using SDKs, see the Java and Python examples under "API" in the console.

Try it out

You can run this API directly in OpenAPI Explorer, which saves you the trouble of calculating signatures. After the API runs successfully, OpenAPI Explorer can automatically generate SDK code examples.

Try it out

Authorization information

The following table describes the authorization information of the API. You can use it in the Action element of a RAM policy statement to grant a RAM user or RAM role the permission to call the API. The details are as follows:

  • Action: a specific permission.

  • Access level: the access level of each action. Valid values: Write, Read, and List.

  • Resource type: the resource types that the action supports for authorization. The details are as follows:

    • Required resource types are marked with an asterisk (*).
    • For actions that do not support resource-level authorization, All resources is used.
  • Condition key: the condition keys defined by the cloud service itself.

  • Dependent action: the additional permissions required to successfully perform the action. The caller must also have permission to perform the dependent actions for the operation to succeed.

ActionAccess levelResource typeCondition keyDependent action
quanmiaolightapp:HotNewsRecommendcreate
*All resources
*
    None
None

Request syntax

POST /{workspaceId}/quanmiao/lightapp/hotNewsRecommend HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample
promptstringNo

The prompt for news recommendations.

Today's financial news
workspaceIdstringYesllm-xxx

Response parameters

NameTypeDescriptionExample
object

Schema of Response

requestIdstring

The unique identifier generated by Alibaba Cloud for this request.

575D5893-01DB-5C81-A899-74F67616762A
codestring

The response code. 200: success. Other values: error codes. For more information about error codes, see Error codes.

200
successboolean

Indicates whether the call is successful. true: success. false: failure.

True
messagestring

The error description.

ok
dataobject

The news recommendation results.

newsarray<object>

The list of recommended news.

newsobject

The recommended news object.

titlestring

The title.

xx
contentstring

The content.

xx
urlstring

The URL.

http://xxx
pubTimestring

The publication time.

2024-09-10 15:32:00
sourcestring

The news source.

Xinhua News Agency
searchSourcestring

The search source.

QuarkCommonNews: web search.
imageUrlsarray

The news image list.

imageUrlsstring

The image URL list.

http://www.example.com/xxx.png

Examples

Sample success response

JSON format

{
  "requestId": "575D5893-01DB-5C81-A899-74F67616762A",
  "code": 200,
  "success": true,
  "message": "ok",
  "data": {
    "news": [
      {
        "title": "xx",
        "content": "xx",
        "url": "http://xxx",
        "pubTime": "2024-09-10 15:32:00",
        "source": "新华社",
        "searchSource": "QuarkCommonNews:联网检索",
        "imageUrls": [
          "http://www.example.com/xxx.png"
        ]
      }
    ]
  }
}

Error codes

For more error codes, visit the Error Center.