Command Line Interface (CLI)

The Tiger OpenAPI Python SDK provides a tigeropen command-line tool that allows you to query market data, manage orders, view account information, and more directly from the terminal — no code required.


Installation

We recommend using the one-line install script, which automatically detects and uses the best available method (uv > pipx > pip):

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

If you prefer to install manually, 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 tigeropen with uv
uv pip install tigeropen

You can also install via pipx or pip:

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

# pip (installs to current environment, suitable when you also need the SDK in your code)
pip install tigeropen

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


Configuration

Before using the CLI, you need to set up your Tiger OpenAPI credentials. There are two ways to configure:

Run the following command and follow the prompts to enter your Tiger ID, Account, Private Key, etc.:

tigeropen config init

Configuration will be saved to 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 Quotes

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

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

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

# Get 5-minute K-line with 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

# Tick-by-tick data
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

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

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 supports subscribing to real-time data streams. Press Ctrl+C to stop:

# 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, switchable via the -f option. Default is json.

JSON Format (Default)

Best for programmatic processing and piping. Outputs indented JSON with non-ASCII characters displayed 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 directly in the terminal. Displays data 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 other spreadsheet tools 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

Format Option Can Be Placed 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 the Tiger OpenAPI. For details, see Request Rate Limits .