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_id starts from the latest article.
  • Pagination uses the last_id cursor only: pass the id of the last item from the previous page as last_id on the next call.
  • page_count in the response is always 1; page through with last_id instead of page numbers.

Parameters

ParameterTypeRequiredDescription
langLanguage or strNoContent language: zh_CN / zh_TW / en_US
last_idstrNoPagination 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.


Did this page help you?