Stock News
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_stock_news
pub async fn get_stock_news(&self, req: NewsStockListRequest) -> Result<NewsPage, TigerError>
Description
Gets news for one stock using news_stock_list. Only one symbol is supported. Paginate using the page number and page size; the first page starts with the latest articles.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
req.symbol | String | Yes | One stock symbol, such as AAPL |
req.lang | Option<Language> | No | None is omitted; enum values are ZhCn / ZhTw / EnUs |
req.page_count | Option<i32> | No | None is omitted; the server defaults to 1. Explicit values must be at least 1 |
req.page_size | Option<i32> | No | None is omitted; the server defaults to 20. Explicit values must be 1–50 |
Returns
Result<NewsPage, TigerError>.
| Field | Type | Description |
|---|---|---|
items | Vec<NewsItem> | Articles on the current page |
page_count | i32 | Current page number; always 1 for market highlights |
page_size | i32 | Page size |
total_page | i32 | Total page count |
total_size | i32 | 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 |
pub_timestamp | i64 | Publication time, as a Unix timestamp in seconds |
url | String | Article URL |
Example
use tigeropen::config::ClientConfig;
use tigeropen::model::enums::Language;
use tigeropen::model::news_requests::NewsStockListRequest;
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_stock_news(NewsStockListRequest {
symbol: "AAPL".into(), lang: Some(Language::EnUs),
page_count: Some(1), page_size: Some(20),
}).await?;
for item in &page.items { println!("{} {} {}", item.pub_timestamp, item.title, item.url); }
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.
Updated 1 day ago
