Options

About 4 min

get_option_expirations Get Options Expiration Date

value QuoteClient::get_option_expirations(symbols)

Description

Get the Expiration date for option

Rate Limit

Refer to Rate Limit

Argument

ArgumentTypeDescription
symbolslist<str...>List of symbols of the underlying assets

Response

ColumnTypeDescription
symbolstrsymbol of the option
datestrExpiration time of the option. Date String formatted as "YYYY-MM-DD"
timestampintExpiration time of the option, Unix timestamp in millisecond

Example

#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 symbols = value::array();  
	symbols[0] = value::string("TSLA");  
	cout << "symbols " << symbols << endl;  
	value result = quote_client->get_option_expirations(symbols);
    cout << result << endl;

    return 0;
 }   

Response Example

[{"count":21,"dates":["2023-01-13","2023-01-20","2023-01-27","2023-02-03","2023-02-10","2023-02-17","2023-02-24","2023-03-03","2023-03-17","2023-04-21","2023-05-19","2023-06-16","2023-07-21","2023-09-15","2023-12-15","2024-01-19","2024-03-15","2024-06-21","2024-09-20","2025-01-17","2025-06-20"],"symbol":"TSLA","timestamps":[1673586000000,1674190800000,1674795600000,1675400400000,1676005200000,1676610000000,1677214800000,1677819600000,1679025600000,1682049600000,1684468800000,1686888000000,1689912000000,1694750400000,1702616400000,1705640400000,1710475200000,1718942400000,1726804800000,1737090000000,1750392000000]}]


get_option_chain Get Option Chain

value get_option_chain(const string symbol, long expiry, value option_filter= value::null());  
value get_option_chain(const string symbol, string expiry, value option_filter= value::null());

Description

Get option chain of a selected option

Rate Limit

Refer to Rate Limit

Argument

ArgumentTypeRequiredDescription
symbolstrSymbol of the underlying asset
expirystr/intExpiry time of the option, Unix timestamp in millisecond (1705640400000), or a date string formatted as 'YYYY-MM-DD' ('2024-01-19')
option_filtertigeropen.quote.domain.filter.OptionFilterParameters for filtering the result. Optional

Filter by parameters:

For each parameters or critera, besides 'in_the_money', use _min / _max suffix to define the upper and lower bounds of a filter criteria. Example: delta_min, theta_max. Please see below for a full example.

OptionFilter can use the following parameters to filter the result:

ParametersTypeRequiredDescription
implied_volatilityfloatNoImplied volatility
in_the_moneyboolNoIf the contract is in the money
open_interestintNoOpen interest. Total number of option contracts that has been traded but not yet been liquified
deltafloatNoDelta, ranging from -1.0 ~ 1.0
gammafloatNoGamma
thetafloatNoTheta
vegafloatNoVega
rhofloatNoRho

Response

ArgumentTypeDescription
identifierstrOption Identifier
symbolstrSymbol of the underlying asset
expiryintExpiration time of the option, Unix timestamp in millisecond
strikefloatStrike price
put_callstrCall/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

#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 result = quote_client->get_option_chain("TSLA", "2023-01-20");
    cout << result << endl;

    return 0;
}

Response Example


get_option_brief Get Options brief

QuoteClient.get_option_brief(identifiers)

Description

Get latest quote data for an option, inluding latest price, volume, bid/asd price and volume

Rate Limit

Refer to Rate Limit

Parameters

ArgumentTypeDescription
identifiersstrA list of option identifiers. Maximum number of contracts per request is 30. Example: ['AAPL 220128C000175000']

Response

Structured as follows:

ArgumentTypeDescription
identifierstrOption Identifier
symbolstrSymbol of the underlying asset
expiryintExpiry time of the option, Unix timestamp in millisecond
strikefloatStrike price
put_callstrCall/Put
multiplierfloatMultiplier
ask_pricefloatAsk price
ask_sizeintAsk size
bid_pricefloatBid price
bid_sizeintBid size
pre_closefloatPre close
latest_pricefloatLatest price
latest_timeintTime when the latest trade happened
volumeintVolume
open_interestintOpen interest. Total number of option contracts that has been traded but not yet been liquified
openfloatOpen
highfloatHigh
lowfloatLow

Example

#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 result = quote_client->get_option_brief("AAPL 220923C000155000");
    cout << result << endl;

    return 0;
}

Response Example


get_option_kline Get Option Kline

value get_option_kline(value identifiers, long begin_time=-1, long end_time=-1);

Description

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

Rate Limit

Refer to Rate Limit

Parameters

ArgumentTypeDescription
identifiersstrA list of option identifiers. Maximum number of contracts per request is 30. Example: ['AAPL 220128C000175000']
begin_timestr/intThe start time of the time window. UNIX timestamp in millisecond, or a date string. Example: 1643346000000 / '2019-01-01'
end_timestr/intThe end time of the time window. UNIX timestamp in millisecond, or a date string. Example: 1643346000000 / '2019-01-01'
periodtigeropen.common.consts.BarPeriodopen in new windowkLineType, range of values (DAY:1day, ONE_MINUTE:1min, FIVE_MINUTES:5min, HALF_HOUR. 30 minutes, ONE_HOUR:60 minutes)

Response

Structured as follows:

ArgumentTypeDescription
identifierstrOption Identifier
symbolstrSymbol of the underlying asset
expiryintOption expiration date, format: YYYY-MM-DD
put_callstrPut 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

#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";



    std::shared_ptr<QuoteClient> quote_client = std::make_shared<QuoteClient>(config);
	value identifiers = value::array();  
	identifiers[0] = value::string("AAPL 220923C000155000");  
	value result = quote_client->get_option_kline(identifiers);
    cout << result << endl;

    return 0;
    }

Response Example


get_option_trade_tick Get Option Tick Data


value get_option_trade_tick(value identifiers);

Description

Get the most recent tick data for a given option

Rate Limit

Refer to Rate Limit

Parameters

ArgumentTypeDescription
identifiersstrA list of option identifiers. Example: ['AAPL 220128C000175000']

Response

Structured as follows:

ArgumentTypeDescription
symbolstrOption identifier
expirystrOption expiration date, format: YYYY-MM-DD
put_callstrPut or call
strikefloatStrike price
timeintTime of the
pricefloatPrice
volumeintVolume

Example


#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;
}    

Response Example

Last update: