Market Highlights

Use TIGER_API::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.

get_market_news

NewsPage get_market_news(const utility::string_t &lang = U(""), const utility::string_t &last_id = U(""))

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

ParameterTypeRequiredDescription
last_idutility::string_tNoThe last article's id on the previous page; an empty string starts from the latest articles
langutility::string_t or LanguageNoAn empty string is omitted by default; a nonempty config.lang takes precedence

Returns

TIGER_API::NewsPage; throws an exception on failure.

FieldTypeDescription
itemsstd::vector<NewsItem>Articles on the current page
page_countintCurrent page number; always 1 for market highlights
page_sizeintPage size
total_pageintTotal page count
total_sizeintTotal item count

Each news item has the following fields:

FieldTypeDescription
idutility::string_tArticle ID; can be used as the cursor for the next market-highlights page
titleutility::string_tTitle
summaryutility::string_tSummary
pub_timestamplong longPublication time, as a Unix timestamp in seconds
urlutility::string_tArticle URL

Example

#include <iostream>
#include "tigerapi/client_config.h"
#include "tigerapi/news_client.h"

int main() {
    using namespace TIGER_API;
    ClientConfig config(false, U("your_config_directory_path"));
    config.lang = U("en_US");
    NewsClient news_client(config);
    const auto page = news_client.get_market_news();
    if (!page.items.empty()) {
        const auto next = news_client.get_market_news(U("en_US"), page.items.back().id);
        std::cout << next.items.size() << std::endl;
    }
}

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.


Did this page help you?