Options
get_option_expirations Get Options Expiration Date
value QuoteClient::get_option_expirations(const value &symbols)
Description
Get the Expiration date for option
Rate Limit
Refer to Rate Limit
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
symbols | list<string> | Yes | List of symbols of the underlying assets |
Response
Field | Type | Description |
---|---|---|
count | int | Number of expirations |
dates | list<string> | Expiration dates of the option. Date String formatted as "YYYY-MM-DD" |
optionSymbols | list<string> | option symbols |
periodTags | list<string> | Option period label, "m" is the monthly option, "w" is the weekly option |
symbol | string | stock symbol |
timestamps | list<int> | Expiration times of the option |
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":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 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 option chain of a selected option
Rate Limit
Refer to Rate Limit
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
symbol | string_t | Yes | Symbol of the underlying asset |
expiry | time_t/string_t | Yes | Expiry time of the option, Unix timestamp in millisecond (1705640400000), or a date string formatted as 'YYYY-MM-DD' ('2024-01-19') |
option_filter | OptionFilter | No | Parameters for filtering the result default: value::null() |
Response
Parameter | Type | Description |
---|---|---|
identifier | string | Option Identifier |
symbol | string | Symbol of the underlying asset |
expiry | int | Expiration time of the option, Unix timestamp in millisecond |
strike | float | Strike price |
put_call | string | 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
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/asd price and volume
Rate Limit
Refer to Rate Limit
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
identifiers | string_t/list<string> | Yes | A list of option identifiers. Maximum number of contracts per request is 30. Example: ['AAPL 220128C000175000'] |
Response
Structured as follows:
Parameter | Type | Description |
---|---|---|
expiry | int | Expiry time of the option, Unix timestamp in millisecond |
identifier | string | Option Identifier |
multiplier | float | Multiplier |
ratesBonds | float | Interest rate or bond yield used in pricing the option |
right | string | Option type ("call" or "put") |
strike | float | Strike price |
symbol | string | Symbol of the underlying asset |
volatility | string | Implied volatility of the option, often expressed as a percentage |
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 result = quote_client->get_option_brief("AAPL 230224C000150000");
cout << result << endl;
return 0;
}
Response Example
{
"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 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
Refer to Rate Limit
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
identifiers | list<string> | Yes | A list of option identifiers. Maximum number of contracts per request is 30. Example: ['AAPL 220128C000175000'] |
begin_time | time_t | Yes | The start time of the time window |
end_time | time_t | No | The end time of the time window default: 4070880000000 |
Response
Structured as follows:
Parameter | Type | Description |
---|---|---|
identifier | string | Option Identifier |
symbol | string | Symbol of the underlying asset |
expiry | int | Option expiration date, format: YYYY-MM-DD |
put_call | string | 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,1000880000000);
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
Parameter | Type | Required | Description |
---|---|---|---|
identifiers | list<string> | Yes | A list of option identifiers. Example: ['AAPL 220128C000175000'] |
Response
Structured as follows:
Parameter | Type | Description |
---|---|---|
symbol | string | Option identifier |
expiry | string | Option expiration date, format: YYYY-MM-DD |
put_call | string | 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;
}