Command Line Interface (CLI)

The Tiger OpenAPI Python SDK includes the tigeropen command-line tool for querying market data, managing orders, viewing account information, and performing other operations directly from a terminal without writing code.


Installation

We recommend the one-line installation script, which automatically selects the first available installer in this order: uv, pipx, then pip.

curl -fsSL https://raw.githubusercontent.com/tigerfintech/openapi-python-sdk/master/install.sh | sh

For manual installation, we recommend uv, a fast Python package manager:

# Install uv (if not already installed)
# macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or via pip:
pip install uv

# Install the standalone CLI with uv
uv tool install tigeropen

You can also install via pipx or pip:

# pipx (creates an isolated environment automatically)
pipx install tigeropen

# pip (run inside an activated virtual environment when you also need the SDK in code)
pip install tigeropen

After installation, run tigeropen in your terminal to see the usage guide.


Upgrading

Re-run the one-line installation script to upgrade to the latest version; it overwrites the existing install:

curl -fsSL https://raw.githubusercontent.com/tigerfintech/openapi-python-sdk/master/install.sh | sh

If you installed manually, upgrade with the same tool you used to install:

# uv
uv tool upgrade tigeropen

# pipx
pipx upgrade tigeropen

# pip
pip install --upgrade tigeropen

Run tigeropen version afterward to confirm the new version.


Configuration

Before using the CLI, configure your Tiger OpenAPI credentials using either of the following methods:

Run the following command and follow the prompts to enter your Tiger ID, account, private key, and other required values:

tigeropen config init

The configuration is saved in the ~/.tigeropen/ directory.


Global Options

The following options can be used with any subcommand:

OptionDescription
-f, --formatOutput format: table, json, csv. Default: json
-c, --config-pathPath to config directory or properties file
-l, --languageLanguage: en_US, zh_CN, zh_TW. Default: en_US
-v, --verboseEnable debug logging
-h, --helpShow help information

Stock Market Data

Market data access: Access to real-time quotes, trade ticks, and market depth must be purchased separately for Tiger OpenAPI and is independent of access in the Tiger Trade app. Historical data, such as candlestick bars (K-line data), is available according to your historical market data quota tier. See Market Data Access for details.

# Get real-time stock quotes
tigeropen quote briefs AAPL TSLA

# Include pre/after market data
tigeropen quote briefs AAPL --hour-trading

# Get daily candlestick bars (K-line data; default: last 251 bars)
tigeropen quote bars AAPL --period day

# Get 5-minute bars with a custom limit
tigeropen quote bars AAPL --period 5min --limit 50

# Specify time range
tigeropen quote bars AAPL --period day --begin-time 2025-01-01 --end-time 2025-03-01

# Get today's intraday data
tigeropen quote timeline AAPL

# Get intraday data for a specific date
tigeropen quote timeline AAPL --date 2025-03-20

# Trade ticks
tigeropen quote ticks AAPL --limit 100

# Order book (depth)
tigeropen quote depth AAPL --market US

# Market status
tigeropen quote market-status --market US

# Stock symbol list
tigeropen quote symbols --market US

Stock Scanner

# Top gainers today (preset)
tigeropen quote scanner --filter gainers --sort acc.ChangeRate --sort-dir DESC

# Large-cap US stocks with P/E under 20
tigeropen quote scanner --filter MarketValue:1e10: --filter PeTTM::20 --sort MarketValue

# High annual ROE stocks
tigeropen quote scanner --filter acc.ROE:0.15::ANNUAL --sort acc.ROE:ANNUAL --sort-dir DESC

# Stocks with options available
tigeropen quote scanner --filter tag.OptionsAvailable:1

# HK market scan
tigeropen quote scanner --market HK --filter MarketValue:1e9: --sort MarketValue

--filter format:

  • FIELD:min:max — numeric range, e.g. PeTTM::20 (P/E below 20), MarketValue:1e9: (market cap above 1B)
  • acc.FIELD:min:max:PERIOD — accumulate field, PERIOD: ANNUAL, QUARTERLY, SEMIANNUAL
  • fin.FIELD:min:max — financial field (LTM)
  • tag.FIELD:tag1,tag2 — tag filter, e.g. tag.OptionsAvailable:1
  • Presets: gainers (intraday change > 5%), losers (intraday change < -5%)

Options Data

# Get option expiration dates
tigeropen quote option expirations AAPL

# Get option chain
tigeropen quote option chain AAPL 2025-06-20

# Get option quotes
tigeropen quote option briefs "AAPL  250620C00200000"

# Get option K-line data
tigeropen quote option bars "AAPL  250620C00200000" --period day
⚠️

Option-chain Greeks are deprecated

Greek-related option-chain request flags, filters/models, and response fields delta, gamma, theta, vega, and rho are Deprecated. Their values are updated daily and are not timely enough for intraday use. Do not use them for real-time trading decisions. Use Option Calculation Tools with current market inputs instead.


Futures Data

# List available futures exchanges
tigeropen quote future exchanges

# List futures contracts for an exchange
tigeropen quote future contracts CME

# Get futures quotes
tigeropen quote future briefs CL2509

# Get futures K-line data
tigeropen quote future bars CL2509 --period day

Capital Flow

# Get capital flow data
tigeropen quote capital flow AAPL --market US --period day

# Get capital distribution
tigeropen quote capital distribution AAPL --market US

Fundamental Data

# Get financial reports
tigeropen quote fundamental financial AAPL --fields total_revenue,net_income --period-type ANNUAL

# Get dividend data
tigeropen quote fundamental dividend AAPL --begin-date 2024-01-01 --end-date 2025-01-01

# Get earnings calendar
tigeropen quote fundamental earnings --begin-date 2025-03-01 --end-date 2025-03-31

Order Management

# List orders
tigeropen trade order list

# Filter by status (Filled/Cancelled/Submitted)
tigeropen trade order list --status Filled --market US

# Get order details
tigeropen trade order get 12345678

# Preview an order
tigeropen trade order preview --symbol AAPL --action BUY --quantity 100 --limit-price 150.00

# Place an order
tigeropen trade order place --symbol AAPL --action BUY --order-type LMT --quantity 100 --limit-price 150.00

# Modify an order
tigeropen trade order modify 12345678 --limit-price 151.00

# Cancel an order
tigeropen trade order cancel 12345678

Positions

# List all positions
tigeropen trade position list

# Filter by security type and market
tigeropen trade position list --sec-type STK --market US

# Filter by symbol
tigeropen trade position list --symbol AAPL

Transaction History

tigeropen trade transaction list --symbol AAPL --start-time 2025-01-01 --end-time 2025-03-01

Account Information

# View account info
tigeropen account info

# View asset summary
tigeropen account assets

# View assets in a specific currency
tigeropen account assets --currency USD

# View asset analytics
tigeropen account analytics --start-date 2025-01-01 --end-date 2025-03-01

Real-Time Streaming

The CLI can subscribe to real-time data streams. Press Ctrl+C to stop a subscription:

# Subscribe to real-time quotes
tigeropen push quote AAPL TSLA

# Subscribe to order status updates
tigeropen push order

# Subscribe to position updates
tigeropen push position

# Subscribe to asset updates
tigeropen push asset

Configuration Management

# View current config (private key is masked)
tigeropen config show

# Set a configuration value
tigeropen config set tiger_id your_new_tiger_id

# Print config directory path
tigeropen config path

Other Commands

# Print SDK version
tigeropen version

# Uninstall
tigeropen uninstall

# Uninstall and remove config directory
tigeropen uninstall --remove-config

Output Formats

The CLI supports three output formats, selected with the -f option. The default is json.

JSON Format (Default)

Best for programmatic processing and pipelines. The CLI outputs indented JSON and displays non-ASCII characters directly.

tigeropen quote briefs AAPL -f json

Example output:

[
  {
    "symbol": "AAPL",
    "open": 217.565,
    "high": 220.48,
    "low": 216.23,
    "close": 220.37,
    "pre_close": 218.27,
    "latest_price": 220.37,
    "latest_time": "2025-03-21 16:00:00",
    "volume": 34552403,
    "amount": 7544389505,
    "status": "NORMAL"
  }
]

Table Format

Best for reading in a terminal. Data is displayed in aligned columns.

tigeropen quote briefs AAPL -f table

Example output:

symbol    open     high      low    close  pre_close  latest_price         latest_time    volume       amount  status
  AAPL  217.565  220.48  216.23   220.37     218.27        220.37  2025-03-21 16:00:00  34552403  7544389505  NORMAL

CSV Format

Best for importing into Excel or another spreadsheet application for further analysis.

tigeropen quote briefs AAPL -f csv

Example output:

symbol,open,high,low,close,pre_close,latest_price,latest_time,volume,amount,status
AAPL,217.565,220.48,216.23,220.37,218.27,220.37,2025-03-21 16:00:00,34552403,7544389505,NORMAL

Place the Format Option Anywhere

-f is a global option and can be placed anywhere in the command line:

# These are equivalent
tigeropen quote briefs AAPL -f table
tigeropen -f table quote briefs AAPL
tigeropen quote briefs AAPL TSLA -f csv

Rate Limits

The CLI follows the same rate limits as Tiger OpenAPI. For details, see Request Rate Limits.


Did this page help you?