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
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | str | Yes | Stock symbol, e.g. AAPL. Single symbol only; batch queries are not supported |
| lang | Language or str | No | Content language: zh_CN / zh_TW / en_US |
| page_count | int | No | Page number, starting from 1, default 1, value >= 1 |
| page_size | int | No | Page size, default 20, range 1–50 |
Return
NewsPage (tigeropen.news.domain.news_page.NewsPage) object with the following attributes:
| Attribute | Type | Description |
|---|---|---|
| items | list[NewsItem] | News article list |
| page_count | int | Current page number |
| page_size | int | Page size |
| total_page | int | Total number of pages |
| total_size | int | Total number of articles |
Each NewsItem (tigeropen.news.domain.news_item.NewsItem) has the following attributes:
| Attribute | Type | Description |
|---|---|---|
| id | str | Article ID |
| title | str | Title |
| summary | str | Summary |
| pub_timestamp | int | Publication timestamp (seconds) |
| url | str | Article 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.
Updated 1 day ago
Did this page help you?
