Overview

Introduction

OpenAPI platform provides interface services for both individual quant developers and institutional clients. To make the APIs easier to use, we developed this Software Development Kit (SDK). The OpenAPI SDK provides a convenient way for our users to trade, monitor, and manage their accounts through their self-designed programs, using Java or Python. Currently, OpenAPI supports all types of opened accounts, including prime accounts and paper trade accounts.

Primary Users

The OpenAPI platform is designed for quantitative investors with a basic understanding in quantitative trading strategies and a working knowledge of software development.

Major Functions

Trading

Available Trading Products – U.S. Market:

Products Prime Account Paper Account
Stocks, ETFs (Fractional Shares is only available in Prime Accounts) Yes Yes
Options Yes Yes

Supported Order Types:

Market Data

Market Quote Access Levels:

Product Type Quote Subscription
Stocks Level 1 (Nasdaq Basic)
Stocks Level 2 (Nasdaq Totalview)
Options Level 1

Market Data Permissions Overview:

We offer two types of market data permissions for US stocks:

Market Data Level Description
US Stock Level 1 Basic Market Data Level 1 data allows you to view the latest stock prices, detailed trade-by-trade data, and the best bid and ask data.
US Stock Level 2 Advanced Market Data Level 2 data provides deep market information, including 40 levels of depth data, volume-price distribution charts, and large order alerts.

Subscribing to Market Data:

To get market data via OpenAPI, you must have an active API market data subscription. This subscription is independent from the market subscription for our APP.

Currently, we offer free market data subscriptions for OpenAPI users.

Applying for API Service

To use OpenAPI, you need to first open a trading account and complete a deposit.

Users can use OpenAPI for free as long as they have an active and funded TradeUP account. OpenAPI is a free service—there are no additional fees for orders placed via OpenAPI.

For Individual Investors:

Once your account is opened and funded, you can visit the Developer Platform to complete the onboarding process.

For Institutional Investors:

Please register through the Institutional Hub. Access rights will be granted upon approval.

If you encounter any issues during the setup process, feel free to contact us at * *service@tradeup.com**

SDK Setup & API Configuration Guide (Java)

Environment Requirements

Install OpenAPI Java SDK

Method 1​: ​​Maven (Recommended)

Add this dependency to your pom.xml:


<dependency>
    <groupId>io.github.tigerbrokers</groupId>
    <artifactId>openapi-java-sdk</artifactId>
    <version>x.y.z</version>
</dependency>

Method 2: Github Code Repository

Clone the SDK from GitHub:

git clone https://github.com/tigerbrokers/openapi-java-sdk

Registered Developer Information

Before using OpenAPI, you must open and fund your TradeUP account and apply for OpenAPI permission. Personal users can register as developers on the Developer Platform , and institutional users can access OpenAPI via the Institutional Hub. Please use Chrome for this page.

In order to access OpenAPI, you need to open and fund your TradeUP account.

During the registration process, you will be asked to sign an API authorization agreement, as well as complete your developer information registration.

Upon successful registration, you will ​receive:

Developer ​Registration ​Page: ​Register using your phone and a verification code.

Developer ​Info Page: ​Tiger ID, Prime Account, Paper Account, and License Info will be used in SDK.

​Attention:​ Please​ store your privateKey in a local and secure place in order prevent unauthorized exposure or loss of personal information. Your privateKey will not be stored on TradeUP’s server, and will disappear automatically when the page is refreshed. If you fail to save your privateKey, it may be replaced by clicking the ​​re-generate​ button. ​

If you find that your information has been compromised, please update your privateKey immediately. ​

OpenAPI uses RSA encryption for authentication. The RSA bidirectional signature authentication mechanism is used to prevent interface requests from being maliciously tampered with.

After saving your privateKey, download the tiger_openapi_config.properties file. Copy the tiger_openapi_config.properties file to the directory configured by ​ClientConfig.DEFAULT_CONFIG.configFilePath​.

Attention​:

The content format of the tiger_openapi_config.properties file is as follows. ‘account’ is the default prime account number, and can be replaced with a paper account number.

private_key_pk8=MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAKh0zh3342PxJS7HFJtIwXE0czbeF+2MC5ev14rf7IWssYD+bHCj0dgSFiPEKBgAm3vzFvPDtqIq733fjk7yKXyezpQveZPn1CUIq7T4VmYXaDni17KqiKiXvXFwzT3oPeyzSgnMoa35u2+UHN1ytczr6lmpsrXgBJYYTi4ffegMBAAECgYBfmIGMVVOeDOFsMhABnvcL2qPWotzfI+pn4rIluCyR4t4yUILwNY7CcxAyOrFe0Chdl7F9Up2JP+UgbcljebpRHN9jAm3lVQP0t4hzI/G6PsSDa/GVnAnqyVPsNDoskJtR7U9QOUopdh7/ARQ0nd0Qn94USFHy83IWVbwMmP5rPQJBAOFDBhRkhyr71YNxJ6flKbmhLvrlssss2SmiRq759n8f03BPRT6NoQfKzBkwkFMMnjaJLwdXQy4Z20snsnMcCQQC/cWrUAccnVPLG1/9VYcFF/HfTg0WUNfzsmLu7K/W37TllhVPRTxDkJQ90EDdB7EwEp3WLoFdQf/E5jlpf5StnAkEApHt6Pv3ArSRCHb5MRI5Sz1bgpRd01Kg7dhXt8zka/Pdh6nHjGR1nV1xTe1I5sPNPrch95RoIKYZSdpbhB8ycFQJBAIw6wrqatst7sP2wGArtuQnPveID5QKEbUjNM64NrEZWkNVpTRUjakcDUod8nU0/jgtWsoZdI7gGj6bOPCrEDf8CQQCkDyuhQpe0pOoLatvyGzkCxwykcVSXtltV4pfXiACD1A9bGSHwFwHV2WMCyunuKsS2rhV7MPYJ/jRvnYVwer3r
tiger_id=20550001
account=12345678
license=TBUS
env=PROD
secret_key=
# secret_key is required for institutional clients only

Additional ​Configurations ​​(​Optional)

Name Description
IP White List Only IP addresses in the white list can access OpenAPI. Use “;” to divide multiple IPs
Callback URL A customized callback URL for the user’s program, used to receive updates on order and account statuses. Users can also use the callback function provided in the SDK to receive callback messages

API Configuration

Before using OpenAPI, you will need to configure the API interface call. Specific configuration information (tigerId, account, license, privateKey, and other configurations) can be found on the developer information page.

The ‘tiger_openapi_token.properties’ configuration file is required and must be placed in the path specified by configFilePath.

public static ClientConfig clientConfig = ClientConfig.DEFAULT_CONFIG;
public static TigerHttpClient client;

static {
    // set log directory. log file name: tiger_openapi.2023-02-22.log
    ApiLogger.setEnabled(true, "/data/tiger_openapi/logs/");
    // ApiLogger.setDebugEnabled(false);        // ouput debug level log
    // The tiger_openapi_config.properties file is stored in your local directory.
    clientConfig.configFilePath = "/data/tiger_config";
    // clientConfig.isSslSocket = true;         // default is true
    // clientConfig.isAutoGrabPermission = true;// default is true
    // clientConfig.failRetryCounts = 2;        // fail retry count, default is 2
    clientConfig.timeZone = TimeZoneId.NewYork;
    clientConfig.language = Language.en_US;
    // clientConfig.secretKey = "xxxxxx";// Institutional user private key
    client = TigerHttpClient.getInstance().clientConfig(clientConfig);
}

Configuration instructions:

SDK Setup & API Configuration Guide (Python)

Environment requirement

Install Python

To minimize compatibility issues, we recommend you to install the latest version of Python. Versions earlier than Python 3.4 may not work properly. You can type ‘python3 -v’ in your terminal or command prompt to check your version or verify your installation.

Install ​the ​latest ​version of Python:

  1. Visit the Download page on the Python website: https://www.python.org/downloads/
  2. Select your operating system, download the installation package, and install as prompted

Install OpenAPI Python SDK

Method 1: ​Use pip to install (​Recommended)

In Terminal or CMD, enter the following command to install the OpenAPI Python SDK:

pip3 install tigeropen

If you need to upgrade the version, you can use:

pip3 install tigeropen --upgrade

Method 2: ​Github

The source code of the OpenAPI SDK project is also available on Github. The Github address is:

https://github.com/tigerfintech/openapi-python-sdk

To install:

  1. Clone the project into your local directory
  2. Run setup.py in your directory directory using the following command: python3 setup.py install

Install IDE

We recommend using PyCharm as your IDE.

Official Download page:

https://www.jetbrains.com/pycharm/download/

Registered Developer Information

In order to access OpenAPI, you need to open and fund your TradeUP account.

During the registration process, you will be asked to sign an API authorization agreement. After that, you need to fill in your preferred account configuration and click “update”. You will need to fill in the following information:

Name Required Description
RSA public key Yes Auto generated by the API website.The RSA public key ensures the security of your account using the RSA two-way signature mechanism. The keys protect the API request from being illegally changed.
IP White List No Only IP addresses in the white list can access OpenAPI. Use “;” to divide multiple IPs
Callback URL No A customized callback URL for the user’s program, used to receive updates on order and account statuses. Users can also use the callback function provided in the SDK to receive callback messages

You can obtain the following information upon ​successful registration: ​

Only active accounts with a balance will be shown on the page. If a user has both an active prime account and a paper account, they will both be shown on the developer info page.

RSA Keys

OpenAPI uses RSA encryption for authentication. The RSA bidirectional signature authentication mechanism is used to prevent interface requests from being maliciously tampered with. Users will save their private keys locally.

Attention: ​

  1. The Java private key format is different from that used by the Python SDK. The Python private key format is PKCS#1. If any problem occurs when you use the SDK, please check whether the private key is in the correct format first.

Configuration

Using a configuration file.

Export the configuration file tiger_openapi_config.properties from the developer website and place it in an appropriate system path, such as /Users/demo/props/. Then, specify this path in the props_path parameter of TigerOpenClientConfig (or place the configuration file in the current program directory; the SDK will default to the current path).

The content format of the tiger_openapi_config.properties file is as follows.

private_key_pk1=MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAKh0zh3342PxJS7HFJtIwXE0czbeF+2MC5ev14rf7IWssYD+bHCj0dgSFiPEKBgAm3vzFvPDtqIq733fjk7yKXyezpQveZPn1CUIq7T4VmYXaDni17KqiKiXvXFwzT3oPeyzSgnMoa35u2+UHN1ytczr6lmpsrXgBJYYTi4ffegMBAAECgYBfmIGMVVOeDOFsMhABnvcL2qPWotzfI+pn4rIluCyR4t4yUILwNY7CcxAyOrFe0Chdl7F9Up2JP+UgbcljebpRHN9jAm3lVQP0t4hzI/G6PsSDa/GVnAnqyVPsNDoskJtR7U9QOUopdh7/ARQ0nd0Qn94USFHy83IWVbwMmP5rPQJBAOFDBhRkhyr71YNxJ6flKbmhLvrlssss2SmiRq759n8f03BPRT6NoQfKzBkwkFMMnjaJLwdXQy4Z20snsnMcCQQC/cWrUAccnVPLG1/9VYcFF/HfTg0WUNfzsmLu7K/W37TllhVPRTxDkJQ90EDdB7EwEp3WLoFdQf/E5jlpf5StnAkEApHt6Pv3ArSRCHb5MRI5Sz1bgpRd01Kg7dhXt8zka/Pdh6nHjGR1nV1xTe1I5sPNPrch95RoIKYZSdpbhB8ycFQJBAIw6wrqatst7sP2wGArtuQnPveID5QKEbUjNM64NrEZWkNVpTRUjakcDUod8nU0/jgtWsoZdI7gGj6bOPCrEDf8CQQCkDyuhQpe0pOoLatvyGzkCxwykcVSXtltV4pfXiACD1A9bGSHwFwHV2WMCyunuKsS2rhV7MPYJ/jRvnYVwer3r
tiger_id=20550001
account=12345678
license=TBUS
env=PROD
secret_key=
# secret_key is required for institutional clients only

Demo code:

from tigeropen.common.consts import (Language,        # Language
                                     Market,          # Market
                                     BarPeriod,       # K-line period
                                     QuoteRight)      # Adjustment type
from tigeropen.quote.quote_client import QuoteClient

from tigeropen.tiger_open_config import TigerOpenClientConfig

def get_client_config():
    client_config = TigerOpenClientConfig(props_path='/Users/demo/props/')
    return client_config

# Create the client_config object using the above-defined function
client_config = get_client_config()

# Initialize QuoteClient with the configuration object
quote_client = QuoteClient(client_config)

# Retrieve market data for ticker AAPL
stock_price = quote_client.get_stock_briefs(['AAPL'])

You can download this demo project, and replace the contents of the properties config file

Introduction to Common ClientConfig Configuration Options

After initiating client_config = TigerOpenClientConfig(), you can set configuration properties using client_config.<property>, such as client_config.timeout = 60.


# Logging level and path
client_config.log_level = logging.DEBUG  # Requires `import logging`
client_config.log_path = '/tmp/tigerapi.log'

# Language
client_config.language = 'en_US'
# Timezone (If a timezone is set, time-related string parameters will be processed as this timezone. By default, SDK does not set a timezone, and the server assumes US/Eastern time.)
client_config.timezone = 'US/Eastern'

# API timeout
client_config.timeout = 15
# Retry settings
# Maximum retry duration in seconds
client_config.retry_max_time = 60
# Maximum number of retry attempts
client_config.retry_max_tries = 5

# 2FA token refresh interval in seconds. Set to 0 to disable automatic refresh
client_config.token_refresh_duration = 24 * 60 * 60

Basic Functions (Python)

Quote APIs

General

Method Description Parameters Response
grab_quote_permission Set the current device as the primary to receive quote data when using the same ID across multiple devices. Required only when switching devices. market (enum: Market.ALL)
lang (enum, optional)
list: name (string)
expire_at (long)
get_quote_permission Retrieve the current quote permissions. Return a list of permission maps. If empty, the permission may have been taken by another device. None list: name (string)
expire_at (long)
get_kline_quota Query the used and remaining symbol historical K-line quota by user level, covering stocks, and stock-related options. with_details (boolean, optional) used (integer)
remain (integer)
method (string)
details (array)

Stock Quote

Method Description Parameters Response
get_market_status Retrieve the current trading status of specified markets, including whether they are open or closed, trading hours, and any special market conditions or holidays that may affect trading activities. market (enum: Market.ALL)
lang (enum, optional)
market (string)
trading_status (string)
status (string)
open_time (datetime)
get_trading_calendar Provide the trading calendar for specified exchanges, including market open/close dates, holidays, and special trading sessions, helping traders plan their activities around market schedules. market (enum)
begin_date (string, optional)
end_date (string, optional)
date (string)
type (string: TRADING/EARLY_CLOSE)
get_symbols Return a comprehensive list of stock symbols traded on specified exchanges, including active securities with their corresponding market identifiers and trading statuses. market (enum: Market.ALL)
include_otc (boolean, default=False)
array of strings
get_symbol_names Retrieve both the ticker symbols and full company names for stocks across multiple markets, enabling easy identification and reference of publicly traded companies. market (enum: Market.ALL)
lang (enum, optional)
include_otc (boolean, default=False)
array of tuples: (symbol, name)
get_timeline Fetch intraday price timeline data for specified securities, including open, high, low, and close values at regular intervals throughout the trading day. symbols (array)
include_hour_trading (boolean, default=False)
begin_time (string/timestamp, optional)
lang (enum, optional)
trade_session (enum, optional)
symbol (string)
time (timestamp)
price (float)
avg_price (float)
pre_close (float)
volume (integer)
trading_session (string)
get_timeline_history Access historical intraday price timeline data for securities, allowing analysis of past trading patterns and price movements at granular time intervals. symbols (array)
date (string)
right (enum: QuoteRight.BR, optional)
symbol (string)
time (timestamp)
price (float)
avg_price (float)
get_stock_briefs Provide real-time streaming quotes for stocks, including current bid/ask prices, last trade details, volume, and other essential market data with minimal latency. symbols (array)
include_hour_trading (boolean, default=False)
lang (enum, optional)
symbol (string)
ask_price (float)
ask_size (integer)
bid_price (float)
bid_size (integer)
pre_close (float)
latest_price (float)
latest_time (timestamp)
volume (integer)
open (float)
high (float)
low (float)
status (string)
adj_pre_close (string)
get_stock_delay_briefs Deliver delayed market quotes (typically 15 minutes for US markets) for stocks. Suitable for non-professional traders or analytical purposes where real-time data isn’t required. symbols (array)
lang (enum, optional)
symbol (string)
pre_close (float)
time (timestamp)
volume (integer)
open (float)
high (float)
low (float)
close (float)
halted (float)
get_bars Retrieve historical price bars (OHLC data) for securities over specified timeframes, supporting various chart intervals from minutes to months for technical analysis. symbols (array)
period (enum: BarPeriod.DAY)
begin_time (timestamp/string, optional)
end_time (timestamp/string, optional)
right (enum: QuoteRight.BR)
limit (integer, default=251)
lang (enum, optional)
page_token (string, optional)
trade_session (enum, optional)
time (timestamp)
open (float)
close (float)
high (float)
low (float)
volume (float)
amount (float)
next_page_token (string)
get_bars_by_page Enable paginated access to extensive historical price bar datasets, allowing efficient retrieval of large amounts of market data without overwhelming system resources. symbol (string)
period (enum: BarPeriod.DAY)
begin_time (timestamp/string, optional)
end_time (timestamp/string, optional)
total (integer, default=10000)
page_size (integer, default=1000)
right (enum: QuoteRight.BR)
time_interval (integer, default=2)
lang (enum, optional)
trade_session (enum, optional)
time (timestamp)
open (float)
close (float)
high (float)
low (float)
volume (float)
next_page_token (string)
get_trade_ticks Provide detailed tick-by-tick trade data for securities, including timestamps, prices, and volumes of individual transactions executed on the exchange. symbols (array)
trade_session (enum, optional)
begin_index (integer, optional)
end_index (integer, optional)
limit (integer, optional)
lang (enum, optional)
index (integer)
time (timestamp)
price (float)
volume (integer)
direction (string: +/-/*)
get_depth_quote Retrieve complete order book depth data, showing current bid/ask orders at multiple price levels to assess market liquidity and potential price movements. symbols (array)
market (enum)
symbol (string)
asks (array: price, quantity, order_count)
bids (array: price, quantity, order_count)
get_trade_metas Supply essential trading metadata including lot sizes, tick sizes, and other contract specifications required for proper order entry and risk management. symbols (array) symbol (string)
lot_size (integer)
min_tick (float)
spread_scale (float)
get_capital_flow Track capital movement patterns between sectors or individual stocks, showing inflow/outflow trends that may indicate shifting market sentiment. symbol (string)
market (string)
period (string)
begin_time (timestamp/string, optional)
end_time (timestamp/string, optional)
limit (integer, default=200)
lang (enum, optional)
symbol (string)
period (string)
time (string)
timestamp (timestamp)
net_inflow (float)
get_capital_distribution Analyze how trading capital is distributed across price levels for specific securities, revealing concentration areas and potential support/resistance zones. symbol (string)
market (string)
lang (enum, optional)
symbol (string)
net_inflow (double)
in_all (double)
in_big (double)
in_mid (double)
in_small (double)
out_all (double)
out_big (double)
out_mid (double)
out_small (double)
get_trade_rank Rank stocks based on various trading metrics (volume, price change, etc.), helping identify the most actively traded or rapidly moving securities. market (enum)
lang (enum, default=Language.en_US)
symbol (string)
market (string)
name (string)
sec_type (string)
change_rate (float)
sell_order_rate (float)
buy_order_rate (float)
hour_trading_trading_status (integer)
hour_trading_trade_session (string)
hour_trading_change_rate (float)

Option Quote

Method Description Parameters Response
get_option_expirations Access all expiration dates for options including weekly and monthly contracts symbols (array)
market (enum: Market.US)
symbol (string)
date (string)
timestamp (timestamp)
period_tag (string)
get_option_chain Retrieve complete option chains showing all available strikes and expiration months identifiers (array)
market (enum: Market.US)
identifier (string)
symbol (string)
strike (string)
bid_price (float)
bid_size (integer)
ask_price (float)
ask_size (integer)
latest_price (float)
latest_time (float)
volume (integer)
pre_close (float)
high (float)
open_interest (integer)
open (float)
multiplier (integer)
rates_bonds (float)
put_call (string)
volatility (string)
expiry (integer)
get_option_briefs Obtain current pricing data including Greeks (delta, gamma) and implied volatility symbol (string)
expiry (string/timestamp)
option_filter (object, optional)
return_greek_value (boolean, optional)
market (enum: Market.US)
timezone (string, optional)
identifier (string)
symbol (string)
expiry (timestamp)
strike (float)
put_call (string)
multiplier (float)
ask_price (float)
ask_size (integer)
bid_price (float)
bid_size (integer)
pre_close (float)
latest_price (float)
volume (integer)
open_interest (integer)
implied_vol (float)
delta (float)
gamma (float)
theta (float)
vega (float)
rho (float)
get_option_bars Access historical price data for analyzing options price movements over time identifiers (array)
begin_time (timestamp/string, default=-1)
end_time (timestamp/string, default=4070880000000)
period (enum: BarPeriod.DAY)
limit (integer, optional)
sort_dir (enum, optional)
market (enum: Market.US)
timezone (string, optional)
identifier (string)
symbol (string)
expiry (string)
put_call (string)
strike (float)
time (timestamp)
open (float)
high (float)
low (float)
close (float)
volume (integer)
open_interest (integer)
get_option_trade_ticks Receive tick-by-tick trade execution data for options contracts identifiers (array) symbol (string)
expiry (string)
put_call (string)
strike (float)
time (timestamp)
price (float)
volume (integer)
get_option_depth View complete options order book showing market depth at various strikes identifiers (array)
market (enum: Market.US)
timezone (string, optional)
identifier (string)
asks (array: price, volume, timestamp, code)
bids (array: price, volume, timestamp, code)

Trading APIs

View Account Information

Method Description Parameters Response
get_managed_accounts Retrieve list of all managed trading accounts under main account including account numbers, types, and permissions for comprehensive portfolio management account(str) AccountProfile:
- account(str)
- capability(str)
- status(str)
- accountType(str)
get_assets Access complete asset information including cash balances, stock positions, and margin details across all linked trading accounts account(str)
sub_accounts(list[str])
segment(bool)
market_value(bool)
secret_key(str)
PortfolioAccount:
- account(str)
- summary(Account)
- segments(dict)
- market_values(dict)
Account:
- available_funds(float)
- buying_power(float)
- cash(float)
- equity_with_loan(float)
- net_liquidation(float)
get_prime_assets Obtain asset details specifically for prime/paper trading accounts showing simulated balances and positions for strategy testing account(str)
base_currency(str)
consolidated(bool)
PortfolioAccount:
- account(str)
- update_timestamp(long)
- segments(dict)
Segment:
- currency(str)
- capability(str)
- cash_balance(float)
- cash_available_for_trade(float)
- gross_position_value(float)
get_positions View all current open positions across accounts including security details, quantities, average prices, and unrealized P/L calculations account(str)
sec_type(SecurityType)
currency(Currency)
market(Market)
symbol(str)
sub_accounts(list[str])
expiry(str)
strike(float)
put_call(str)
Position:
- account(str)
- contract(Contract)
- position_qty(float)
- average_cost(float)
- market_price(float)
- unrealized_pnl(float)
get_analytics_asset Access analytical asset data including performance metrics, risk assessments, and portfolio allocation breakdowns for informed decision making account(str)
start_date(str)
end_date(str)
seg_type(SegmentType)
currency(Currency)
sub_account(str)
dict:
- summary:
- pnl(float)
- pnl_percentage(float)
- history:
- date(long)
- asset(float)
- pnl(float)
get_segment_fund_available Check available funds for segment transfers between different account types or trading products with current transfer limits from_segment(str)
currency(str)
SegmentFundAvailableItem:
- from_segment(str)
- currency(str)
- amount(float)
transfer_segment_fund Execute fund transfers between account segments or product types following specified amount and destination parameters from_segment(str)
to_segment(str)
amount(float)
currency(str)
SegmentFundItem:
- id(long)
- from_segment(str)
- to_segment(str)
- amount(float)
- status(str)
cancel_segment_fund Cancel pending fund transfer requests between account segments if within allowable cancellation timeframe and status id(int) SegmentFundItem:
- id(long)
- from_segment(str)
- to_segment(str)
- amount(float)
- status(str)
get_segment_fund_history Review complete history of segment fund transfers including dates, amounts, statuses, and confirmation references limit(int) list[SegmentFundItem]:
- id(long)
- from_segment(str)
- to_segment(str)
- amount(float)
- status(str)
get_estimate_tradable_quantity Calculate maximum allowable trading quantities for securities based on current positions, margin, and risk parameters order(Order)
seg_type(str)
TradableQuantityItem:
- tradable_quantity(float)
- financing_quantity(float)
- position_quantity(float)
get_funding_history Access comprehensive funding transaction history including deposits, withdrawals, and transfers with timestamps and statuses seg_type(SegmentType) pandas.DataFrame:
- id(long)
- type(int)
- currency(str)
- amount(float)
- business_date(str)
get_fund_details Retrieve detailed information about fund products including NAV, performance history, and portfolio composition seg_types(list[str])
account(str)
fund_type(int)
currency(Currency)
start(int)
limit(int)
start_date(str)
end_date(str)
secret_key(str)
lang(str)
pandas.DataFrame:
- id(int)
- desc(str)
- currency(str)
- amount(float)
- business_date(str)

Get Contracts

Method Description Parameters Response
get_contracts Retrieve multiple contract objects simultaneously with complete specifications including symbols, expiration dates, and trading terms symbol (str)
sec_type (SecurityType)
currency (Currency)
exchange (str)
expiry (str)
strike (float)
put_call (str)
Contract Object:
- symbol (str)
- sec_type (str)
- currency (str)
- exchange (str)
- expiry (str)
- strike (float)
- put_call (str)
- multiplier (float)
- name (str)
- market (str)
- identifier (str)
- shortable (bool)
- marginable (bool)
- min_tick (float)
- tick_sizes (list)
- status (str)
- trade (bool)
- lot_size (float)
get_contract Access detailed information about specific trading contract including tick sizes, margin requirements, and settlement terms symbol (str)
sec_type (SecurityType)
currency (Currency)
exchange (str)
list[Contract]:
Each item contains same fields as Contract Object

Get Order Information

Method Description Parameters Response
get_order Retrieve complete details of specific order including status, execution prices, remaining quantity, and timestamps account(str)
id(int)
order_id(int)
is_brief(bool)
show_charges(bool)
Order:
- account(str)
- id(long)
- order_id(int)
- order_time(long)
- status(str)
- action(str)
- quantity(float)
- filled(float)
- avg_fill_price(float)
- limit_price(float)
- order_type(str)
- time_in_force(str)
- contract(Contract)
- remaining(float)
- realized_pnl(float)
- charges(list[Charge])
get_orders Access multiple order records simultaneously with filtering options by date range, status, or security type account(str)
sec_type(SecurityType)
market(Market)
symbol(str)
start_time(str/int)
end_time(str/int)
limit(int)
is_brief(bool)
states(list[OrderStatus])
sort_by(OrderSortBy)
seg_type(SegmentType)
list[Order]:
- account(str)
- id(long)
- order_id(int)
- parent_id(int)
- order_time(long)
- status(str)
- action(str)
- quantity(float)
- filled(float)
- avg_fill_price(float)
- limit_price(float)
- order_type(str)
- time_in_force(str)
- contract(Contract)
- remaining(float)
- realized_pnl(float)
get_open_orders View all currently active/unfilled orders with real-time updates on status changes and partial executions account(str)
sec_type(SecurityType)
market(Market)
symbol(str)
start_time(str/int)
end_time(str/int)
parent_id(int)
sort_by(OrderSortBy)
seg_type(SegmentType)
list[Order]:
(Same fields as get_orders response)
get_cancelled_orders Review historical record of cancelled orders including cancellation timestamps, reasons, and original order details account(str)
sec_type(SecurityType)
market(Market)
symbol(str)
start_time(str/int)
end_time(str/int)
sort_by(OrderSortBy)
seg_type(SegmentType)
list[Order]:
(Same fields as get_orders response)
get_filled_orders Access complete history of filled orders with execution prices, quantities, fees, and commission breakdowns account(str)
sec_type(SecurityType)
market(Market)
symbol(str)
start_time(str/int)
end_time(str/int)
sort_by(OrderSortBy)
seg_type(SegmentType)
list[Order]:
(Same fields as get_orders response)
get_transactions Obtain detailed transaction records specifically for prime accounts including allocations and routing details account(str)
order_id(int)
symbol(str)
sec_type(SecurityType)
start_time(str/int)
end_time(str/int)
limit(int)
expiry(str)
strike(float)
put_call(str)
list[Transaction]:
- account(str)
- order_id(int)
- exec_id(str)
- exec_time(long)
- symbol(str)
- sec_type(str)
- side(str)
- price(float)
- quantity(float)
- commission(float)
- realized_pnl(float)
- exchange(str)

Place Orders

Method Description Parameters Response
place_order Submit new trade orders with specified security, quantity, price, and order type parameters for execution Order Object:
- account(str)
- contract(Contract)
- action(str)
- order_type(str)
- quantity(float)
- limit_price(float)
- aux_price(float)
- trail_stop_price(float)
- trailing_percent(float)
- time_in_force(str)
- outside_rth(bool)
- order_legs(list)
- algo_params(dict)
Order Object:
- id(long)
- status(str)
- filled(float)
- avg_fill_price(float)
- remaining(float)
- contract(Contract)
- order_time(long)

Modify or Cancel Orders

Method Description Parameters Response
cancel_order Request cancellation of existing open orders before full or partial execution occurs in market account(str)
id(long)
order_id(int)
bool (True/False)
modify_order Adjust parameters of existing open orders including quantity, price, or order type modifications order(Order)
quantity(int)
limit_price(float)
aux_price(float)
trail_stop_price(float)
trailing_percent(float)
time_in_force(str)
outside_rth(bool)
bool (True/False)

Subscription APIs

Account Changes

Method Description Callback Method Parameters Response
subscribe_asset Receive real-time updates about all account balance changes including cash positions, margin values, buying power fluctuations, and asset valuations across multiple linked accounts with detailed breakdowns PushClient.asset_changed account (str): Tiger account number (optional - all accounts if None) account: Account ID
currency: USD/HKD/etc.
segType: S (Stocks)
availableFunds: Available trading balance
netLiquidation: Total account value
equityWithLoan: Equity including loan value
buyingPower: Purchasing power
cashBalance: Cash amount
grossPositionValue: Total positions value
timestamp: Update time (ms)
unsubscribe_asset Terminate automatic account balance updates and stop receiving notifications about cash position changes, margin requirements, or buying power adjustments across all monitored accounts None None None
subscribe_position Monitor live position changes including quantity adjustments, average price updates, unrealized profit/loss calculations, and market value fluctuations for all holdings in the portfolio PushClient.position_changed account (str): Tiger account number (optional)
symbol (str): Filter by symbol (optional)
account: Account ID
symbol: Ticker (AAPL/00700)
identifier: Unique contract ID
position: Current holdings
marketValue: Current value
avgCost: Average cost
unrealizedPnl: Unrealized P\&L
secType: STK/FUT/etc.
currency: USD/HKD/etc.
timestamp: Update time (ms)
unsubscribe_position Disable real-time position tracking and cease receiving automatic updates about portfolio holding changes, position size adjustments, or market value movements None None None
subscribe_order Get instant notifications about all order status changes, including executions, partial fills, cancellations, rejections, and amendments with complete order details PushClient.order_changed account (str): Tiger account number (optional)
order_id (int): Filter by order (optional)
id: Order ID
account: Account number
symbol: Ticker symbol
action: BUY/SELL
status: FILLED/CANCELLED/etc.
filled: Executed qty
remaining: Pending qty
avgFillPrice: Avg execution price
limitPrice: Limit price
orderType: LMT/MKT/etc.
timestamp: Update time (ms)
unsubscribe_order Stop receiving real-time order status alerts and disable automatic updates about order executions, modifications, or cancellations across all accounts None None None

Market Data Streaming

Method Description Callback Method Parameters Callback Data Fields
​​subscribe_quote​​ Stream live market data including best bid/ask prices, last trade values, trading volumes, and price change percentages for selected securities with millisecond updates PushClient.quote_changed
PushClient.quote_bbo_changed
symbols (list[str]): Ticker symbols
quote_key_type (QuoteKeyType): TRADE/QUOTE/ALL
focus_keys (list[str]): Specific fields to subscribe
​​Basic Quote​​:
symbol, type, timestamp, latestPrice, volume, open, high, low, preClose

​​BBO Quote​​:
askPrice, askSize, bidPrice, bidSize, timestamp
​​unsubscribe_quote​​ Cancel real-time market data subscription for selected securities including price updates, bid/ask spreads, and trading volume notifications None symbols (list[str]): Ticker symbols to unsubscribe None
​​subscribe_depth_quote​​ Access comprehensive order book depth showing liquidity at multiple price levels beyond the top of book, including aggregated size and individual order details when available PushClient.quote_depth_changed symbols (list[str]): Ticker symbols symbol, timestamp
ask: [price, volume, count]
bid: [price, volume, count]
​​unsubscribe_depth_quote​​ Terminate order book depth data subscription and stop receiving updates about market liquidity at different price levels None symbols (list[str]): Ticker symbols None
​​subscribe_tick​​ Receive tick-by-tick trade execution data with precise timestamps, trade prices, volumes, and exchange codes for analyzing market microstructure and trade patterns PushClient.tick_changed symbols (list[str]): Ticker symbols symbol, timestamp
ticks: [
price, volume, time,
type (+/ -/*), partCode
]
​​unsubscribe_tick​​ Disable tick-by-tick trade data streaming and cease receiving individual trade execution notifications None symbols (list[str]): Ticker symbols None
​​query_subscribed_quote​​ Check subscribed symbols. Retrieve current list of all actively subscribed market data symbols with their subscription types and status details PushClient.query_subscribed_callback None subscribed_symbols: List of symbols
limit/used: Subscription limits
subscribed_depth_symbols: Depth symbols

Specialized Subscription Types

Method Description Parameters Notes
​​subscribe_option​​ Monitor real-time options market data including contract prices, Greeks (delta, gamma), implied volatility surfaces, open interest, and volume metrics for selected options chains symbols (list[str]): Format “SYMBOL YYYYMMDD STRIKE RIGHT” (e.g. “AAPL 20240119 150.0 CALL”) Shares quote_changed callback
​​subscribe_stock_top​​ Monitor top moving stocks based on customizable ranking criteria including price change percentage and trading volume market (str): US/HK
indicators (list): [StockRankingIndicator]
Pushes top 30 stocks per indicator every 30s
​​subscribe_option_top​​ Track top performing options contracts filtered by metrics like implied volatility change and trading activity market (str): US
indicators (list): [OptionRankingIndicator]
Pushes top 50 options per indicator every 30s

Other Events

Callback Function Description
PushClient.connect_callback Connected
PushClient.disconnect_callback Disconnected
PushClient.error_callback Connection Error

Basic Function (Java)

Quote APIs

General

Method Description Parameters Response
TigerHttpRequest(MethodName.GRAB_QUOTE_PERMISSION) Request temporary access to market data feeds by specifying required data types and instruments for time-limited quoting permissions None name (string)
expireAt (long)
TigerHttpRequest(MethodName.GET_QUOTE_PERMISSION) Retrieve current list of all authorized market data subscriptions showing accessible instruments and data types for the account None name (string)
expireAt (long)
TigerHttpRequest(MethodName.USER_TOKEN_REFRESH) Generate new authentication token while maintaining existing session connections and permissions without requiring full re-login None tigerId (string)
license (string)
token (string)
createTime (long)
expiredTime (long)
KlineQuotaRequest Check remaining available K-line data requests under current subscription plan including usage limits and reset periods with_details (bool, optional) used (int)
remain (int)
method (String)
details (List)

Stocks

Method Description Parameters Response
QuoteMarketRequest Retrieve current trading status of exchanges including open/closed states, trading halts, and special market conditions affecting operations market (enum: US/HK)
lang (enum: zh_CN/zh_TW/en_US, optional)
market (string)
marketStatus (string)
status (enum)
openTime (string)
QuoteTradeCalendarRequest Obtain complete trading calendar showing market open days, holidays, early closures and special sessions for proper trade planning market (string)
begin_date (string, yyyy-MM-dd, optional)
end_date (string, yyyy-MM-dd, optional)
date (string)
type (enum: TRADING/EARLY_CLOSE)
QuoteSymbolRequest Fetch comprehensive list of stock symbols with corresponding company names organized by exchange and trading status market (string)
include_otc (boolean, optional)
lang (string, optional)
List<String> (symbols)
QuoteSymbolNameRequest Access complete symbol master list including all active and delisted instruments with their naming conventions market (string)
include_otc (boolean, optional)
lang (string, optional)
name (string)
symbol (string)
QuoteDelayRequest Receive delayed market data feeds (typically 15 minutes) compliant with exchange regulations for non-professional use symbols (array, max 50) close (double)
high (double)
low (double)
open (double)
preClose (double)
time (long)
volume (long)
QuoteTimelineRequest Stream intraday price timeline showing open, high, low and close values at regular intervals throughout trading session symbols (array)
period (enum: day/day5)
trade_session (enum: PreMarket/Regular/AfterHours, optional)
begin_time (long, optional)
lang (string, optional)
symbol (string)
period (string)
preClose (double)
intraday (object)
preMarket (object, US only)
afterHours (object, US only)
QuoteHistoryTimelineRequest Access historical intraday price movements at granular time intervals for backtesting and pattern analysis symbols (array)
date (string, yyyyMMdd)
right (enum: br/nr, optional)
symbol (string)
items (array: time, price, volume, avgPrice)
QuoteRealTimeQuoteRequest Receive real-time market data including bid/ask spreads, last trade prices, volumes and other essential trading metrics symbols (array, max 50)
includeHourTrading (boolean, optional)
lang (string, optional)
symbol (string)
open (double)
high (double)
low (double)
close (double)
preClose (double)
latestPrice (double)
latestTime (long)
askPrice (double)
askSize (long)
bidPrice (double)
bidSize (long)
volume (long)
status (string)
hourTrading (object)
QuoteKlineRequest Retrieve historical OHLC price bars across multiple timeframes from minutes to months for technical analysis symbols (array, max 50)
period (enum)
trade_session (enum, optional)
right (string, optional)
begin_time (long, optional)
end_time (long, optional)
limit (int, optional)
lang (string, optional)
pageToken (string, optional)
symbol (string)
period (string)
nextPageToken (string)
items (array: time, open, high, low, close, volume, amount)
QuoteDepthRequest Access complete order book depth showing liquidity at various price levels beyond best bid/ask symbols (array, max 50)
market (string)
symbol (string)
asks (array: price, volume, count)
bids (array: price, volume, count)
QuoteTradeTickRequest Obtain tick-by-tick trade execution data with precise timestamps for microstructure analysis symbols (array)
trade_session (enum, optional)
beginIndex (long)
endIndex (long)
limit (int, optional)
lang (string, optional)
beginIndex (long)
endIndex (long)
symbol (string)
items (array: time, price, volume, type)
QuoteStockTradeRequest Check essential trading requirements including lot sizes, tick sizes and other contract specifications symbols (array, max 50) symbol (string)
lotSize (int)
spreadScale (int)
minTick (double)
QuoteCapitalFlowRequest Track money movement patterns between sectors showing fund inflows/outflows indicating sentiment shifts symbol (string)
period (enum)
market (string)
symbol (string)
period (string)
items (array: netInflow, time, timestamp)
QuoteCapitalDistributionRequest Analyze capital allocation across price levels revealing concentration zones and potential support/resistance areas symbol (string)
market (string)
lang (string, optional)
symbol (string)
netInflow (double)
inAll (double)
inBig (double)
inMid (double)
inSmall (double)
outAll (double)
outBig (double)
outMid (double)
outSmall (double)
QuoteTradeRankRequest Rank stocks based on trading activity metrics to identify most actively traded securities market (enum: US/HK)
lang (string, optional)
symbol (string)
name (string)
market (string)
changeRate (double)
sellOrderRate (double)
buyOrderRate (double)
hourTrading (object)

Options

Method Description Parameters Response
OptionExpirationQueryRequest List all available expiration dates for options on specified underlying assets symbols (array, max 30)
market (enum: US/HK, optional)
symbol (string)
dates (array)
timestamps (array)
periodTags (array)
optionSymbols (array)
count (int)
OptionChainQueryV3Request Retrieve complete option chain showing all strikes and months for given underlying items (array: symbol, expiry)
filter (object: inTheMoney, implied_volatility, open_interest, greeks)
market (enum: US/HK)
symbol (string)
expiry (long)
items (array: put/call objects with option details)
OptionBriefQueryV2Request Obtain current pricing data including Greeks and implied volatility for options items (array: symbol, right, strike, expiry)
market (string, optional)
identifier (string)
symbol (string)
strike (string)
bidPrice (double)
bidSize (int)
askPrice (double)
askSize (int)
latestPrice (double)
volume (int)
high (double)
low (double)
open (double)
preClose (double)
openInterest (int)
change (double)
multiplier (int)
right (string)
volatility (string)
expiry (long)
ratesBonds (double)
timestamp (long)
OptionKlineQueryV2Request Access historical price movements of options contracts for performance analysis items (array: symbol, right, strike, expiry, beginTime, endTime, period, limit, sortDir)
market (enum: US/HK, optional)
symbol (string)
period (string)
nextPageToken (string)
items (array: open, close, high, low, time, volume, amount, openInterest)
OptionTradeTickQueryRequest Receive tick-by-tick trade executions showing exact transaction details items (array: symbol, right, strike, expiry) symbol (string)
expiry (long)
strike (string)
right (string)
items (array: price, time, volume)
OptionDepthQueryRequest View complete options order book with market depth at various strike prices market (enum: HK)
lang (enum: zh_CN/zh_TW/en_US, optional)
symbol (string)
expiry (long)
strike (string)
right (string)
timestamp (long)
ask (array: price, code, timestamp, volume, count)
bid (array: price, code, timestamp, volume, count)
OptionFundamentals Calculate essential option pricing indicators and risk parameters client (TigerHttpClient)
symbol (string)
right (string: CALL/PUT)
strike (string)
expiry (string, yyyy-MM-dd)
underlyingSymbol (string, optional)
delta (double)
gamma (double)
theta (double)
vega (double)
rho (double)
predictedValue (double)
timeValue (double)
premiumRate (double)
profitRate (double)
volatility (double)
leverage (double)
insideValue (double)
historyVolatility (double)
openInterest (integer)
metricParam (string)

Trading APIs

Get Account Information

Method Description Parameters Response
TigerHttpRequest(MethodName.ACCOUNTS) Retrieve complete list of all trading accounts under main account including account numbers, types, and permissions for portfolio management account (string, optional) account (string)
capability (string)
status (string)
accountType (string)
PositionsRequest Access all current open positions across accounts including security details, quantities, average prices, and unrealized P/L calculations account (string, required)
sec_type (string, optional: STK/OPT/FUT/FUND)
currency (string, optional)
market (string, optional)
symbol (string, optional)
secret_key (string, optional)
expiry (string, optional)
strike (double, optional)
right (string, optional)
asset_quote_type (string, optional)
account (string)
positionQty (double)
salableQty (double)
averageCost (double)
latestPrice (double)
marketValue (double)
realizedPnl (double)
unrealizedPnl (double)
multiplier (double)
market (string)
currency (string)
secType (string)
identifier (string)
symbol (string)
strike (double)
expiry (string)
right (string)
updateTimestamp (long)
mmPercent (double)
mmValue (double)
todayPnl (double)
yesterdayPnl (double)
lastClosePrice (double)
categories (list)
PrimeAssetRequest View detailed asset breakdown specifically for prime/paper trading accounts with simulated balances account (string, required)
base_currency (string, optional)
secret_key (string, optional)
consolidated (boolean, optional)
account (string)
currency (string)
category (string)
capability (string)
buyingPower (double)
cashAvailableForTrade (double)
cashAvailableForWithdrawal (double)
cashBalance (double)
grossPositionValue (double)
initMargin (double)
maintainMargin (double)
overnightMargin (double)
excessLiquidation (double)
overnightLiquidation (double)
netLiquidation (double)
equityWithLoan (double)
realizedPL (double)
totalTodayPL (double)
unrealizedPL (double)
leverage (double)
currencyAssets (object)
consolidatedSegTypes (string)
lockedFunds (double)
uncollected (double)
PrimeAnalyticsAssetRequest Access historical asset performance analytics including risk metrics, allocation trends, and portfolio comparisons account (string, required)
start_date (string, optional)
end_date (string, optional)
seg_type (enum, optional)
currency (enum, optional)
sub_account (string, optional)
secret_key (string, optional)
pnl (double)
pnlPercentage (double)
annualizedReturn (double)
overUserPercentage (double)
date (long)
asset (double)
cashBalance (double)
grossPositionValue (double)
deposit (double)
withdrawal (double)
SegmentFundAvailableRequest Check available funds eligible for transfer between different account segments or product types account (string, required)
from_segment (string, required: FUT/SEC)
currency (string, optional)
fromSegment (string)
currency (string)
amount (double)
SegmentFundTransferRequest Execute fund transfers between account segments following specified amount and destination parameters account (string, required)
from_segment (string, required: FUT/SEC)
to_segment (string, required: FUT/SEC)
currency (string, required)
amount (double, required)
id (long)
fromSegment (string)
toSegment (string)
currency (string)
amount (double)
status (string)
statusDesc (string)
message (string)
settledAt (long)
updatedAt (long)
createdAt (long)
SegmentFundCancelRequest Cancel pending fund transfer requests if within allowable cancellation timeframe and status account (string, required)
id (long, required)
id (long)
fromSegment (string)
toSegment (string)
currency (string)
amount (double)
status (string)
statusDesc (string)
message (string)
settledAt (long)
updatedAt (long)
createdAt (long)
SegmentFundHistoryRequest Review complete history of segment fund transfers including dates, amounts, and statuses account (string, required)
limit (integer, optional, default=100)
items (array):
id (long)
fromSegment (string)
toSegment (string)
currency (string)
amount (double)
status (string)
statusDesc (string)
settledAt (long)
updatedAt (long)
EstimateTradableQuantityRequest Calculate maximum allowable trading quantities based on current positions, margin, and risk limits account (string, required)
symbol (string, required)
expiry (string, optional)
right (string, optional)
strike (string, optional)
seg_type (enum, optional)
sec_type (enum, optional)
action (enum, required)
order_type (enum, required)
limit_price (double, optional)
stop_price (double, optional)
secretKey (string, optional)
tradableQuantity (double)
financingQuantity (double)
positionQuantity (double)
tradablePositionQuantity (double)
DepositWithdrawRequest Access comprehensive history of all deposits and withdrawals with timestamps and statuses account (string, required)
secretKey (string, optional)
lang (enum, optional)
items (array):
id (long)
refId (string)
type (int)
typeDesc (string)
currency (string)
amount (double)
businessDate (string)
completedStatus (bool)
createdAt (long)
FundDetailRequest Retrieve information about fund details including NAV, performance, and portfolio composition segTypes (array, required)
account (string, required)
fundType (enum, optional)
currency (string, optional)
startDate (string, optional)
endDate (string, optional)
start (long, optional)
limit (long, optional)
secretKey (string, optional)
lang (enum, optional)
id (long)
desc (string)
currency (string)
segType (string)
type (string)
amount (double)
businessDate (string)
updatedAt (long)
page (int)
limit (int)
itemCount (int)
pageCount (int)
contractName (string)

Get Contract Information

Method Description Parameters Response
ContractRequest Access detailed specifications for single trading contract including symbols, terms, and trading rules account(string)
symbol(string)
sec_type(string)
currency(string)
expiry(string)
strike(double)
right(string)
exchange(string)
secret_key(string)
identifier(string)
name(string)
contractId(int)
symbol(string)
secType(string)
expiry(string)
contractMonth(string)
strike(double)
right(string)
type(string)
multiplier(double)
lotSize(int)
exchange(string)
primaryExchange(string)
market(string)
currency(string)
localSymbol(string)
tradingClass(string)
minTick(double)
tickSizes(array)
marginable(boolean)
longInitialMargin(double)
longMaintenanceMargin(double)
shortInitialMargin(double)
shortMaintenanceMargin(double)
shortable(boolean)
shortableCount(int)
shortFeeRate(double)
tradeable(boolean)
closeOnly(boolean)
continuous(boolean)
lastTradingDate(string)
firstNoticeDate(string)
lastBiddingCloseTime(long)
isEtf(boolean)
etfLeverage(int)
discountedDayInitialMargin(double)
discountedDayMaintenanceMargin(double)
discountedTimeZoneCode(string)
discountedStartAt(string)
discountedEndAt(string)
supportOvernightTrading(boolean)
ContractsRequest Retrieve multiple contract objects simultaneously with complete trading specifications and identifiers account(string)
symbols(List)
sec_type(string)
currency(string)
secret_key(string)
identifier(string)
name(string)
contractId(int)
symbol(string)
secType(string)
expiry(string)
contractMonth(string)
strike(double)
right(string)
type(string)
multiplier(double)
exchange(string)
primaryExchange(string)
market(string)
currency(string)
localSymbol(string)
tradingClass(string)
minTick(double)
tickSizes(array)
marginable(boolean)
longInitialMargin(double)
longMaintenanceMargin(double)
shortInitialMargin(double)
shortMaintenanceMargin(double)
shortable(boolean)
shortableCount(int)
shortFeeRate(double)
tradeable(boolean)
closeOnly(boolean)
continuous(boolean)
lastTradingDate(string)
firstNoticeDate(string)
lastBiddingCloseTime(long)
isEtf(boolean)
etfLeverage(int)
supportOvernightTrading(boolean)
QuoteContractRequest Obtain contract details specifically for options including strike prices and expiration dates symbols(string)
sec_type(string)
expiry(string)
lang(string)
symbol(string)
name(string)
exchange(string)
market(string)
secType(string)
currency(string)
expiry(string)
right(string)
strike(string)
multiplier(double)

Get Order Information

Method Description Parameters Response
QueryOrderRequest(MethodName.ORDERS) Access multiple order records simultaneously with filtering by date range, status, or security type Get a single order:
account(string)
id(int)
secret_key(string)
show_charges(bool)

Get a list of orders:
account(string)
seg_type(SegmentType)
sec_type(string)
market(string)
symbol(string)
expiry(string)
strike(string)
right(string)
start_date(string)
end_date(string)
states(array)
isBrief(boolean)
limit(integer)
sort_by(OrderSortBy)
secret_key(string)
lang(string)
page_token(string)
id(long)
orderId(long)
externalId(long)
parentId(long)
account(string)
action(string)
orderType(string)
limitPrice(double)
auxPrice(double)
trailingPercent(double)
totalQuantity(int)
totalQuantityScale(int)
timeInForce(string)
expireTime(long)
outsideRth(boolean)
filledQuantity(int)
filledQuantityScale(int)
totalCashAmount(double)
filledCashAmount(double)
refundCashAmount(double)
avgFillPrice(double)
liquidation(boolean)
remark(string)
status(string)
attrDesc(string)
commission(double)
commissionCurrency(string)
gst(double)
realizedPnl(double)
percentOffset(double)
openTime(long)
updateTime(long)
latestTime(long)
symbol(string)
currency(string)
market(string)
multiplier(double)
secType(string)
userMark(string)
canModify(boolean)
canCancel(boolean)
isOpen(boolean)
replaceStatus(string)
cancelStatus(string)
charges(array)
commissionDiscountAmount(double)
orderDiscountAmount(double)
orderDiscount(int)
TigerHttpRequest(MethodName.ORDER_TRANSACTIONS) Retrieve detailed transaction records including executions, allocations, and routing details See get orders See get orders
QueryOrderRequest(MethodName.ACTIVE_ORDERS) View all currently open/unfilled orders with real-time status updates and partial execution details See get orders See get orders
QueryOrderRequest(MethodName.FILLED_ORDERS) Access complete history of filled orders with execution prices, quantities, and commission breakdowns See get orders See get orders
QueryOrderRequest(MethodName.INACTIVE_ORDERS) Review historical record of cancelled orders including timestamps and cancellation reasons account(string)
order_id(long)
symbol(string)
sec_type(string)
expiry(string)
right(string)
start_date(long)
end_date(long)
limit(int)
secretKey(string)
id(long)
accountId(long)
orderId(long)
secType(string)
symbol(string)
currency(string)
market(string)
action(string)
filledQuantity(int)
filledPrice(double)
filledAmount(double)
transactedAt(string)
transactionTime(long)

Place Order

Method Description Parameters Response
TradeOrderRequest Submit new trade orders with specified security, quantity, price, and order type parameters Common attributes:
account(string)
order_id(int)
symbol(string)
sec_type(string)
action(string)
order_type(string)
total_quantity(long)
total_quantity_scale(int)
cash_amount(double)
limit_price(float)
aux_price(float)
trailing_percent(float)
outside_rth(boolean)
trading_session_type(TradingSessionType)
adjust_limit(float)
market(string)
currency(string)
time_in_force(string)
expire_time(long)
exchange(string)
expiry(string)
strike(string)
right(string)
multiplier(float)
local_symbol(string)
secret_key(string)
user_mark(string)
attached order parameter:
attach_type(string)
profit_taker_order_id(int)
profit_taker_price(float)
profit_taker_tif(string)
profit_taker_rth(boolean)
stop_loss_order_id(int)
stop_loss_price(float)
stop_loss_limit_price(float)
stop_loss_tif(string)
stop_loss_trailing_percent(float)
stop_loss_trailing_amount(float)
TWAP/VWAP order parameter:
attach_type(string)
profit_taker_price(float)
stop_loss_price(float)
stop_loss_trailing_percent(float)
algo_params(List)
id(long)
subIds(List)
orders(List)

Cancel or Modify

Method Description Parameters Response
TigerHttpRequest(MethodName.MODIFY_ORDER) Adjust parameters of existing open orders including quantity, price, or order type modifications account(string)
id(long)
total_quantity(long)
total_quantity_scale(int)
limit_price(double)
aux_price(double)
trailing_percent(double)
secret_key(string)
id(long)
TigerHttpRequest(MethodName.CANCEL_ORDER) Request cancellation of open orders before full or partial execution occurs in market account(string)
id(long)
secret_key(string)
id(long)

Subscription APIs

Account Change

Method Description Callback Method Parameters Response Callback Data
subscribe Track real-time account changes including order status updates, position adjustments, asset movements, and transaction activities across all linked accounts subscribeEnd, orderStatusChange, positionChange, assetChange, orderTransactionChange account(string)
subject(Subject)
id(string) ​​Asset Data​​
account(string)
currency(string)
segType(string)
availableFunds(double)
excessLiquidity(double)
netLiquidation(double)
equityWithLoan(double)
buyingPower(double)
cashBalance(double)
grossPositionValue(double)
initMarginReq(double)
maintMarginReq(double)
timestamp(long)
​​Position Data​​
account(string)
symbol(string)
expiry(string)
strike(string)
right(string)
identifier(string)
multiplier(int)
market(string)
currency(string)
segType(string)
secType(string)
positionQty(double)
salableQty(double)
averageCost(double)
latestPrice(double)
marketValue(double)
unrealizedPnl(double)
name(string)
timestamp(long)
Order Status Data
id(long)
account(string)
symbol(string)
expiry(string)
strike(string)
right(string)
identifier(string)
multiplier(int)
action(string)
market(string)
currency(string)
segType(string)
secType(string)
orderType(string)
isLong(boolean)
totalQuantity(long)
totalQuantityScale(int)
filledQuantity(long)
filledQuantityScale(int)
avgFillPrice(double)
limitPrice(double)
stopPrice(double)
realizedPnl(double)
status(string)
replaceStatus(string)
cancelStatus(string)
outsideRth(boolean)
canModify(boolean)
canCancel(boolean)
liquidation(boolean)
name(string)
source(string)
errorMsg(string)
attrDesc(string)
commissionAndFee(float)
openTime(long)
timestamp(long)
userMark(string)
totalCashAmount(double)
filledCashAmount(double)
Order Transaction Data
id(long)
orderId(long)
account(string)
symbol(string)
identifier(string)
multiplier(int)
action(string)
market(string)
currency(string)
segType(string)
secType(string)
filledPrice(double)
filledQuantity(long)
createTime(long)
updateTime(long)
transactTime(long)
timestamp(long)
cancelSubscribe Terminate all account change notifications and stop receiving updates about order status, positions, assets, and transactions cancelSubscribeEnd subject(Subject) None None

Subscription

Method Description Callback Method Parameters Response
subscribeQuote Stream real-time stock quotes including last price, bid/ask spreads, and trading volume updates for selected securities subscribeEnd, quoteChange, quoteAskBidChange symbols(Set) id(string)
cancelSubscribeQuoteopen in new window Disable real-time stock quote streaming and cease receiving price updates for previously subscribed symbols cancelSubscribeEnd symbols(Set) None
subscribeOption Monitor live options pricing data including contract values, Greeks, and implied volatility for selected contracts subscribeEnd, optionChange, optionAskBidChange symbols(Set) id(string)
cancelSubscribeOption Stop receiving real-time options pricing updates and terminate streaming for specified option contracts cancelSubscribeEnd symbols(Set) None
subscribeDepthQuote Access full order book depth data showing liquidity at multiple price levels beyond best bid/ask subscribeEnd, depthQuoteChange symbols(Set) id(string)
cancelSubscribeDepthQuote Terminate order book depth updates and stop receiving market depth information cancelSubscribeEnd symbols(Set) None
subscribeTradeTick Receive tick-by-tick trade execution data with precise timestamps and transaction details subscribeEnd, tradeTickChange symbols(Set) id(string)
cancelSubscribeTradeTick Disable tick-by-tick trade data streaming and cease receiving individual trade notifications cancelSubscribeEnd symbols(Set) None
subscribeStockTop Monitor top moving stocks based on customizable ranking criteria including price change and volume subscribeEnd, stockTopPush market(Market)
indicators(Set)
id(string)
cancelSubscribeStockTop Stop receiving updates about top moving stocks and terminate the ranking data stream cancelSubscribeEnd market(Market)
indicators(Set)
None
subscribeOptionTop Track top performing options contracts filtered by metrics like implied volatility and activity subscribeEnd, optionTopPush market(Market)
indicators(Set)
id(string)
cancelSubscribeOptionTop Disable top options data streaming and cease receiving ranking updates cancelSubscribeEnd market(Market)
indicators(Set)
None
subscribeTradeTick Receive complete tick-by-tick trade execution data including all market transactions with precise timestamps, prices, and volumes for detailed market microstructure analysis subscribeEnd, fullTickChange symbols(Set) id(string)
cancelSubscribeTradeTick Terminate full tick data streaming and stop receiving granular trade execution updates for previously subscribed securities cancelFullSubscribeEnd symbols(Set) None
subscribeKline Receive minute-level OHLC price bar updates for technical analysis and charting purposes subscribeEnd, klineChange symbols(Set) id(string)
cancelSubscribeKline Terminate minute bar updates and stop receiving OHLC price data streams cancelSubscribeEnd symbols(Set) None
getSubscribedSymbols Retrieve current list of all actively subscribed market data symbols with their subscription status getSubscribedSymbolEnd None limit(int)
used(int)
subscribedSymbols(array)
askBidLimit(int)
askBidUsed(int)
subscribedAskBidSymbols(array)
tradeTickLimit(int)
tradeTickUsed(int)
subscribedTradeTickSymbols(array)
Callback Type Data Structure
​​Quote Basic Data​​ symbol(string)
type(string)
timestamp(long)
avgPrice(double)
latestPrice(double)
latestPriceTimestamp(long)
preClose(double)
volume(long)
amount(double)
open(double)
high(double)
low(double)
marketStatus(string)
​​Quote BBO Data​​ symbol(string)
type(string)
timestamp(long)
askPrice(double)
askSize(long)
bidPrice(double)
bidSize(long)
​​Option Quote Data​​ symbol(string)
type(string)
timestamp(long)
latestPrice(double)
preClose(double)
volume(long)
amount(double)
open(double)
high(double)
low(double)
identifier(string)
openInt(long)
​​Depth Quote Data​​ symbol(string)
timestamp(long)
ask(List<OrderBook>)
bid(List<OrderBook>)
OrderBook: price(double), volume(long), orderCount(int)
​​Trade Tick Data​​ symbol(string)
secType(string)
timestamp(long)
ticks(List<Tick>)
Tick: sn(long), time(long), price(double), volume(long), type(string), cond(string)
​​Stock Top Data​​ market(string
timestamp(long)
topData(List<TopData>)
TopData: targetName(string), item(List<StockItem>)
StockItem: symbol(string), latestPrice(double), targetValue(double)
​​Option Top Data​​ market(string)
timestamp(long)
topData(List<TopData>)
TopData: targetName(string), bigOrder(List<BigOrder>), item(List<OptionItem>)
BigOrder: symbol(string), expiry(string), strike(string), right(string), dir(string), volume(double), price(double), amount(double)
OptionItem: symbol(string), expiry(string), strike(string), right(string), totalAmount(double), totalVolume(double), totalOpenInt(double)
​​Full Tick Data​​ symbol(string)
timestamp(long)
ticks(List<Tick>)
Tick: sn(long), time(long), price(float), volume(long), type(string), cond(string), partCode(string)
​​K-line Data​​ symbol(string)
time(long)
open(float)
high(float)
low(float)
close(float)
avg(float)
volume(long)
count(int)
amount(double)
serverTimestamp(long)

Other Events

Events Description
void connectAck() Connection established
void connectionClosed() Connection closed
void error(String errorMsg) Error
void error(int id, int errorCode, String errorMsg) Error
void connectionKickout(int errorCode, String errorMsg) Kicked by another connection. The SDK will close the local TCP connection. Please do not implement reconnection in this method, it will cause constant kicks and affect data push
void hearBeat(String s) Connection heartbeat callback