Market News
Initialization
All examples on this page assume the following initialization has been completed:
from tigeropen.tiger_open_config import TigerOpenClientConfig
from tigeropen.news.news_client import NewsClient
client_config = TigerOpenClientConfig(props_path='your_config_directory_path')
news_client = NewsClient(client_config)For details, see Prerequisites.
Get Market News
NewsClient.get_market_news(lang=None, last_id=None)
Description
Retrieves the market news highlights list, corresponding to the news_highlight_list method.
- No required parameters; omitting
last_idstarts from the latest article. - Pagination uses the
last_idcursor only: pass theidof the last item from the previous page aslast_idon the next call. page_countin the response is always 1; page through withlast_idinstead of page numbers.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| lang | Language or str | No | Content language: zh_CN / zh_TW / en_US |
| last_id | str | No | Pagination cursor, the id of the last item from the previous page; omit to start from the latest article |
Return
NewsPage (tigeropen.news.domain.news_page.NewsPage) object, same structure as get_stock_news Get Stock News.
Example
# First page: omit last_id to start from the latest article
page = news_client.get_market_news(lang='en_US')
for item in page.items:
print(item.id, item.title)
# Next page: pass the id of the last item from the previous page
page = news_client.get_market_news(lang='en_US', last_id=page.items[-1].id)Example Response
{
"items": [
{
"id": "",
"title": "",
"summary": "",
"pub_timestamp": 1793880506,
"url": "https://xxxx"
}
],
"page_count": 1,
"page_size": 20,
"total_page": 8,
"total_size": 143
}Rate Limit
The base rate limit is 60 requests/minute.
Updated 1 day ago
Did this page help you?
