Market Highlights

Use tigeropen::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.

get_market_news

pub async fn get_market_news(&self, req: NewsHighlightListRequest) -> Result<NewsPage, TigerError>

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

ParameterTypeRequiredDescription
req.last_idOption<String>NoThe last article's id on the previous page; None starts from the latest articles
req.langOption<Language>NoNone is omitted; enum values are ZhCn / ZhTw / EnUs

Returns

Result<NewsPage, TigerError>.

FieldTypeDescription
itemsVec<NewsItem>Articles on the current page
page_counti32Current page number; always 1 for market highlights
page_sizei32Page size
total_pagei32Total page count
total_sizei32Total item count

Each news item has the following fields:

FieldTypeDescription
idStringArticle ID; can be used as the cursor for the next market-highlights page
titleStringTitle
summaryStringSummary
pub_timestampi64Publication time, as a Unix timestamp in seconds
urlStringArticle URL

Example

use tigeropen::config::ClientConfig;
use tigeropen::model::enums::Language;
use tigeropen::model::news_requests::NewsHighlightListRequest;
use tigeropen::news::NewsClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = ClientConfig::builder().build()?;
    let news_client = NewsClient::from_config(config);
    let page = news_client.get_market_news(NewsHighlightListRequest {
        lang: Some(Language::EnUs), ..Default::default()
    }).await?;
    if let Some(last) = page.items.last() {
        let next = news_client.get_market_news(NewsHighlightListRequest {
            lang: Some(Language::EnUs), last_id: Some(last.id.clone()),
        }).await?;
        println!("{}", next.items.len());
    }
    news_client.close();
    Ok(())
}

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.


Did this page help you?