Options

get_option_expirations

⚠️

get_option_expirations - doesn't exist in SDK header - only get_option_expiration does and
it works with a single symbol as defined by code example

value QuoteClient::get_option_expirations(const value &symbols)

Description

Get the Expiration Date for the listed option(s)

Rate Limit

Please refer to: API Request Limits

Parameters

ParameterTypeRequiredDescription
symbolslistYesList of symbols of the underlying assets

Response

FieldTypeDescription
countintNumber of expirations
dateslistExpiration dates of the option. Date String formatted as "YYYY-MM-DD"
optionSymbolslistoption symbols
periodTagslistOption period label, "m" is the monthly option, "w" is the weekly option
symbolstringstock symbol
timestampslistExpiration times of the option

Example Call

#include "tigerapi/quote_client.h"
#include "tigerapi/trade_client.h"
#include <iostream>
#include <memory>
using namespace std;
using namespace web;
using namespace web::json;
using namespace TIGER_API;

int main(int argc, char* args[]) {
    
    ClientConfig config(false, U("tiger_openapi_config.properties"));

    std::shared_ptr<QuoteClient> quote_client = std::make_shared<QuoteClient>(config);

    value symbols = value::array();
    symbols[0] = value::string(U("TSLA"));
    
    value result = quote_client->get_option_expiration(symbols);
    wcout << result << endl;


    return 0;

Example Response

{
  "count":22,
  "dates":["2025-03-14","2025-03-21","2025-03-28","2025-04-04","2025-04-11","2025-04-17","2025-04-25","2025-05-02","2025-05-16",
    "2025-06-20","2025-07-18","2025-08-15","2025-09-19","2025-11-21","2025-12-19","2026-01-16","2026-03-20","2026-06-18",
    "2026-09-18","2026-12-18","2027-01-15","2027-06-17"],
  "optionSymbols":["TSLA","TSLA","TSLA","TSLA","TSLA","TSLA","TSLA","TSLA","TSLA","TSLA","TSLA","TSLA","TSLA","TSLA",
    "TSLA","TSLA","TSLA","TSLA","TSLA","TSLA","TSLA","TSLA"],
  "periodTags":["w","m","w","w","w","m","w","w","m","m","m","m","m","m","m","m","m","m","m","m","m","w"],
  "symbol":"TSLA",
  "timestamps":[1741924800000,1742529600000,1743134400000,1743739200000,1744344000000,1744862400000,1745553600000,
    1746158400000,1747368000000,1750392000000,1752811200000,1755230400000,1758254400000,1763701200000,1766120400000,
    1768539600000,1773979200000, 1781755200000,1789704000000,1797570000000,1799989200000,1813204800000]
}

get_option_chain

value get_option_chain(const utility::string_t symbol, time_t expiry, value option_filter= value::null());
value get_option_chain(const utility::string_t symbol, utility::string_t expiry, value option_filter= value::null());

Description

Get options chain of a selected symbol

Rate Limit

Please refer to: API Request Limits

Parameters

ParameterTypeRequiredDescription
symbolstring_tYesSymbol of the underlying asset
expirytime_t/string_tYesExpiry time of the option, Unix timestamp in millisecond (1705640400000), or a date string formatted as 'YYYY-MM-DD' ('2024-01-19')
option_filterOptionFilterNoParameters for filtering the result
default: value::null()

Response

ParameterTypeDescription
identifierstringOption Identifier
symbolstringSymbol of the underlying asset
expiryintExpiration time of the option, Unix timestamp in millisecond
strikefloatStrike price
put_callstringCall/Put
multiplierfloatMultiplier
ask_pricefloatAsk price
ask_sizeintAsk size
bid_pricefloatBid price
bid_sizeintBid size
pre_closefloatPre close price
latest_pricefloatLatest price
volumeintVolume
open_interestintOpen interest

Example Call

#include "tigerapi/quote_client.h"
#include "tigerapi/trade_client.h"
#include <iostream>
#include <memory>using namespace std;
using namespace web;
using namespace web::json;
using namespace TIGER_API;

int main(int argc, char* args[]) {
    
    ClientConfig config(false, U("tiger_openapi_config.properties"));
    
    std::shared_ptr<QuoteClient> quote_client = std::make_shared<QuoteClient>(config);
    value result = quote_client->get_option_chain("TSLA", "2023-01-20");
    cout << result << endl;
    // value result = quote_client->get_option_chain(U("TSLA"), U("2026-06-29"));
    // wcout << result << endl; VS on windows

    return 0;
}

get_option_brief

value get_option_brief(value identifiers);
value get_option_brief(const utility::string_t identifier);

Description

Get latest quote data for an option, including latest price, volume, bid/ask price and volume

Rate Limit

Please refer to: API Request Limits

Parameters

ParameterTypeRequiredDescription
identifiersstring_t/listYesA list of option identifiers. Maximum number of contracts per request is 30. Example: ['AAPL 220128C000175000']

Response

Structured as follows:

ParameterTypeDescription
expiryintExpiry time of the option, Unix timestamp in millisecond
identifierstringOption Identifier
multiplierfloatMultiplier
ratesBondsfloatInterest rate or bond yield used in pricing the option
rightstringOption type ("call" or "put")
strikefloatStrike price
symbolstringSymbol of the underlying asset
volatilitystringImplied volatility of the option, often expressed as a percentage
volumeintVolume

Example Call

#include "tigerapi/quote_client.h"
#include "tigerapi/trade_client.h"
#include <iostream>
#include <memory>using namespace std;
using namespace web;
using namespace web::json;
using namespace TIGER_API;

int main(int argc, char* args[]) {
    
    ClientConfig config(false, U("tiger_openapi_config.properties"));
    
    std::shared_ptr<QuoteClient> quote_client = std::make_shared<QuoteClient>(config);
    value result = quote_client->get_option_brief("AAPL 230224C000150000");
    cout << result << endl;
    // value result = quote_client->get_option_brief(U("AAPL 230224C000150000"));
    // wcout << result << endl; < VS on Windows
 
    return 0;
}

Example Response

{
  "expiry":1677164400000,
  "identifier":"AAPL  230223C00150000",
  "multiplier":100,
  "ratesBonds":0.041241,
  "right":"call",
  "strike":"150.0",
  "symbol":"AAPL",
  "volatility":"27.52%",
  "volume":0
}

get_option_kline

vector<Kline> get_option_kline(value identifiers, time_t begin_time, time_t end_time=4070880000000);

Description

Get daily aggregate bars for an option over a given date range.

Rate Limit

Please refer to: API Request Limits

Parameters

ParameterTypeRequiredDescription
identifierslistYesA list of option identifiers. Maximum number of contracts per request is 30. Example: ['AAPL 220128C000175000']
begin_timetime_tYesThe start time of the time window
end_timetime_tNoThe end time of the time window
default: 4070880000000

Response

Structured as follows:

ParameterTypeDescription
identifierstringOption Identifier
symbolstringSymbol of the underlying asset
expiryintOption expiration date, format: YYYY-MM-DD
put_callstringPut or call
strikefloatStrike price
timeintTimestamp of the open/start time of each bar, UNIX timestamp in millisecond
openfloatOpening price
highfloatHigh
lowfloatLow
closefloatClose
volumeintVolume
open_interestintOpen interest. Total number of option contracts that has been traded but not yet been liquified

Example Call

#include "tigerapi/quote_client.h"
#include "tigerapi/trade_client.h"
#include <iostream>
#include <memory>
using namespace std;
using namespace web;
using namespace web::json;
using namespace TIGER_API;

int main(int argc, char* args[]) {
    
    ClientConfig config(false, U("tiger_openapi_config.properties"));

    std::shared_ptr<QuoteClient> quote_client = std::make_shared<QuoteClient>(config);
    
    value identifiers = value::array();
    identifiers[0] = value::string(U("AAPL 250923C000155000")); // "U" for VS on Windows

    std::vector<Kline> result = quote_client->get_option_kline(identifiers, 1000880000000);

    for (const auto& k : result)
    {
        for (const auto& item : k.items)
        {
            std::cout << item.close << std::endl;
        }
    }

    return 0;
}

get_option_trade_tick

value get_option_trade_tick(value identifiers);

Description

Get the most recent tick data for a given option

Rate Limit

Please refer to: API Request Limits

Parameters

ParameterTypeRequiredDescription
identifierslistYesA list of option identifiers. Example: ['AAPL 220128C000175000']

Response

Structured as follows:

ParameterTypeDescription
symbolstringOption identifier
expirystringOption expiration date, format: YYYY-MM-DD
put_callstringPut or call
strikefloatStrike price
timeintTime of the
pricefloatPrice
volumeintVolume

Example Call


#include "tigerapi/quote_client.h"

using namespace std;
using namespace web;
using namespace web::json;
using namespace TIGER_API;


int main(int argc, char *args[]) {
    /************************** set config **********************/
    ClientConfig config = ClientConfig(true);

    config.private_key = "-----BEGIN RSA PRIVATE KEY-----\n"
                         "xxxxxx private key xxxxxxxx"
                         "-----END RSA PRIVATE KEY-----";
    config.tiger_id = "Tiger ID";
    config.account = "Account ID";


    /**
     * Use QuoteClient
     */
    std::shared_ptr<QuoteClient> quote_client = std::make_shared<QuoteClient>(config);
        value identifiers = value::array();  
        identifiers[0] = value::string("AAPL 230923C000155000");  
        value result = quote_client->get_option_trade_tick(identifiers);
    cout << result << endl;

    return 0;
}    

Example Response

 {"expiry":1758600000000, "items":[ ], "right":"call" "strike":"155.0", "symbol":"AAPL"}

Did this page help you?