Market Highlights
Use news.NewsClient to get stock news and market highlights. Follow this SDK's quickstart to configure the client. News queries use the main gateway and do not take over real-time quote device access.
GetMarketNews
func (c *NewsClient) GetMarketNews(req model.NewsHighlightListRequest) (*model.NewsPage, error)
Description
Gets market highlights using news_highlight_list. Omit the cursor to start with the latest articles. For the next page, pass the ID of the last article on the previous page. The request has no page number or page size; the response page number is always 1. An empty items list is a successful result.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
req.LastID | string | No | The last article's ID on the previous page; an empty string starts from the latest articles |
req.Lang | string | No | zh_CN / zh_TW / en_US; an empty string is omitted |
Returns
*model.NewsPage, with an error on failure.
| Field | Type | Description |
|---|---|---|
Items | []model.NewsItem | Articles on the current page |
PageCount | int | Current page number; always 1 for market highlights |
PageSize | int | Page size |
TotalPage | int | Total page count |
TotalSize | int | Total item count |
Each news item has the following fields:
| Field | Type | Description |
|---|---|---|
ID | string | Article ID; can be used as the cursor for the next market-highlights page |
Title | string | Title |
Summary | string | Summary |
PubTimestamp | int64 | Publication time, as a Unix timestamp in seconds |
URL | string | Article URL |
Example
package main
import (
"fmt"
"log"
"github.com/tigerfintech/openapi-go-sdk/config"
"github.com/tigerfintech/openapi-go-sdk/model"
"github.com/tigerfintech/openapi-go-sdk/news"
)
func main() {
cfg, err := config.NewClientConfig()
if err != nil { log.Fatal(err) }
newsClient := news.NewNewsClientFromConfig(cfg)
page, err := newsClient.GetMarketNews(model.NewsHighlightListRequest{Lang: "en_US"})
if err != nil { log.Fatal(err) }
if len(page.Items) > 0 {
cursor := page.Items[len(page.Items)-1].ID
next, err := newsClient.GetMarketNews(model.NewsHighlightListRequest{Lang: "en_US", LastID: cursor})
if err != nil { log.Fatal(err) }
fmt.Println(next.Items)
}
}Response example
This JSON example is based on fixed SDK test fixtures and illustrates the response data structure. Actual calls return the SDK objects listed above.
{
"items": [
{
"id": "123456",
"title": "Apple Q2",
"summary": "Earnings beat",
"pubTimestamp": 1729413600,
"url": "https://example.com/news/123456"
}
],
"pageCount": 1,
"pageSize": 20,
"totalPage": 1,
"totalSize": 1
}Request rate
Base limit: 60 requests/minute.
Updated 1 day ago
