Options
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
Argument | Type | Description |
---|---|---|
symbols | list<str...> | List of symbols of the underlying assets |
Response
Column | Type | Description |
---|---|---|
symbol | str | symbol of the option |
date | str | Expiration time of the option. Date String formatted as "YYYY-MM-DD" |
timestamp | int | Expiration 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
Argument | Type | Required | Description |
---|---|---|---|
symbol | str | Symbol of the underlying asset | |
expiry | str/int | Expiry time of the option, Unix timestamp in millisecond (1705640400000), or a date string formatted as 'YYYY-MM-DD' ('2024-01-19') | |
option_filter | tigeropen.quote.domain.filter.OptionFilter | Parameters 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:
Parameters | Type | Required | Description |
---|---|---|---|
implied_volatility | float | No | Implied volatility |
in_the_money | bool | No | If the contract is in the money |
open_interest | int | No | Open interest. Total number of option contracts that has been traded but not yet been liquified |
delta | float | No | Delta, ranging from -1.0 ~ 1.0 |
gamma | float | No | Gamma |
theta | float | No | Theta |
vega | float | No | Vega |
rho | float | No | Rho |
Response
Argument | Type | Description |
---|---|---|
identifier | str | Option Identifier |
symbol | str | Symbol of the underlying asset |
expiry | int | Expiration time of the option, Unix timestamp in millisecond |
strike | float | Strike price |
put_call | str | Call/Put |
multiplier | float | Multiplier |
ask_price | float | Ask price |
ask_size | int | Ask size |
bid_price | float | Bid price |
bid_size | int | Bid size |
pre_close | float | Pre close price |
latest_price | float | Latest price |
volume | int | Volume |
open_interest | int | Open 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
Argument | Type | Description |
---|---|---|
identifiers | str | A list of option identifiers. Maximum number of contracts per request is 30. Example: ['AAPL 220128C000175000'] |
Response
Structured as follows:
Argument | Type | Description |
---|---|---|
identifier | str | Option Identifier |
symbol | str | Symbol of the underlying asset |
expiry | int | Expiry time of the option, Unix timestamp in millisecond |
strike | float | Strike price |
put_call | str | Call/Put |
multiplier | float | Multiplier |
ask_price | float | Ask price |
ask_size | int | Ask size |
bid_price | float | Bid price |
bid_size | int | Bid size |
pre_close | float | Pre close |
latest_price | float | Latest price |
latest_time | int | Time when the latest trade happened |
volume | int | Volume |
open_interest | int | Open interest. Total number of option contracts that has been traded but not yet been liquified |
open | float | Open |
high | float | High |
low | float | Low |
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
Argument | Type | Description |
---|---|---|
identifiers | str | A list of option identifiers. Maximum number of contracts per request is 30. Example: ['AAPL 220128C000175000'] |
begin_time | str/int | The start time of the time window. UNIX timestamp in millisecond, or a date string. Example: 1643346000000 / '2019-01-01' |
end_time | str/int | The end time of the time window. UNIX timestamp in millisecond, or a date string. Example: 1643346000000 / '2019-01-01' |
period | tigeropen.common.consts.BarPeriod | kLineType, range of values (DAY:1day, ONE_MINUTE:1min, FIVE_MINUTES:5min, HALF_HOUR. 30 minutes, ONE_HOUR:60 minutes) |
Response
Structured as follows:
Argument | Type | Description |
---|---|---|
identifier | str | Option Identifier |
symbol | str | Symbol of the underlying asset |
expiry | int | Option expiration date, format: YYYY-MM-DD |
put_call | str | Put or call |
strike | float | Strike price |
time | int | Timestamp of the open/start time of each bar, UNIX timestamp in millisecond |
open | float | Opening price |
high | float | High |
low | float | Low |
close | float | Close |
volume | int | Volume |
open_interest | int | Open 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
Argument | Type | Description |
---|---|---|
identifiers | str | A list of option identifiers. Example: ['AAPL 220128C000175000'] |
Response
Structured as follows:
Argument | Type | Description |
---|---|---|
symbol | str | Option identifier |
expiry | str | Option expiration date, format: YYYY-MM-DD |
put_call | str | Put or call |
strike | float | Strike price |
time | int | Time of the |
price | float | Price |
volume | int | Volume |
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