Stock 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 Stock News

NewsClient.get_stock_news(symbol, lang=None, page_count=None, page_size=None)

Description

Retrieves the news list of a single stock, corresponding to the news_stock_list method.

  • Only a single symbol is supported; batch queries are not supported. Query multiple stocks one at a time.
  • Paginated by page_count / page_size; the first page (page_count=1) contains the latest articles.

Parameters

ParameterTypeRequiredDescription
symbolstrYesStock symbol, e.g. AAPL. Single symbol only; batch queries are not supported
langLanguage or strNoContent language: zh_CN / zh_TW / en_US
page_countintNoPage number, starting from 1, default 1, value >= 1
page_sizeintNoPage size, default 20, range 1–50

Return

NewsPage (tigeropen.news.domain.news_page.NewsPage) object with the following attributes:

AttributeTypeDescription
itemslist[NewsItem]News article list
page_countintCurrent page number
page_sizeintPage size
total_pageintTotal number of pages
total_sizeintTotal number of articles

Each NewsItem (tigeropen.news.domain.news_item.NewsItem) has the following attributes:

AttributeTypeDescription
idstrArticle ID
titlestrTitle
summarystrSummary
pub_timestampintPublication timestamp (seconds)
urlstrArticle URL

Example

page = news_client.get_stock_news('AAPL', lang='en_US', page_count=1, page_size=10)
for item in page.items:
    print(item.pub_timestamp, item.title, item.url)

Example Response

{
  "items": [
    {
      "id": "",
      "title": "",
      "summary": "",
      "pub_timestamp": 1793906282,
      "url": "https://xxxx"
    }
  ],
  "page_count": 1,
  "page_size": 10,
  "total_page": 27,
  "total_size": 265
}

Rate Limit

The base rate limit is 60 requests/minute.


Did this page help you?