Market Highlights
Use 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
getMarketNews(req?: NewsHighlightListRequest): Promise<NewsPage>
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; omit it to start from the latest articles |
req.lang | string | No | Uses the client language when omitted; supported values are zh_CN / zh_TW / en_US |
Returns
Promise<NewsPage>; the promise rejects on failure.
| Field | Type | Description |
|---|---|---|
items | NewsItem[] | Articles on the current page |
pageCount | number | undefined | Current page number; always 1 for market highlights |
pageSize | number | undefined | Page size |
totalPage | number | undefined | Total page count |
totalSize | number | undefined | Total item count |
Each news item has the following fields:
| Field | Type | Description |
|---|---|---|
id | string | undefined | Article ID; can be used as the cursor for the next market-highlights page |
title | string | undefined | Title |
summary | string | undefined | Summary |
pubTimestamp | number | undefined | Publication time, as a Unix timestamp in seconds |
url | string | undefined | Article URL |
Example
import { createClientConfig, NewsClient } from '@tigeropenapi/tigeropen';
async function main(): Promise<void> {
const config = createClientConfig();
const newsClient = NewsClient.fromConfig(config);
const page = await newsClient.getMarketNews({ lang: 'en_US' });
const cursor = page.items[page.items.length - 1]?.id;
if (cursor) {
const next = await newsClient.getMarketNews({ lang: 'en_US', lastId: cursor });
console.log(next.items);
}
}
void main();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
