Command Line Interface (CLI)
The TradeUP OpenAPI Python SDK provides a tigeropen command-line tool that allows you to query U.S. 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 | shIf 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
# Install tigeropen with uv
uv pip install tigeropenYou can also install via pipx or pip:
# pipx (creates an isolated environment automatically)
pipx install tigeropen
# pip
pip install tigeropenAfter installation, run tigeropen in your terminal to see the usage guide.
Configuration
Before using the CLI, you need to set up your TradeUP 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 initConfiguration will be saved to the ~/.tigeropen/ directory.
Global Options
The following options can be used with any subcommand:
| Option | Description |
|---|---|
-f, --format | Output format: table, json, csv. Default: json |
-c, --config-path | Path to config directory or properties file |
-l, --language | Language: en_US, zh_CN, zh_TW. Default: en_US |
-v, --verbose | Enable debug logging |
-h, --help | Show help information |
U.S. Stock Quotes
Quote permissions: Real-time market data (quotes, ticks, depth, etc.) requires a separate API quote subscription. Historical K-line data is available based on your subscription tier. See Quote Permissions for details.
# Get real-time stock quotes
tigeropen quote briefs XYZX XYZZ ABCD
# Include pre/after-market data
tigeropen quote briefs XYZX --hour-trading
# Get daily K-line data (default: last 251 bars)
tigeropen quote bars XYZX --period day
# Get 5-minute K-line with custom limit
tigeropen quote bars XYZX --period 5min --limit 50
# Specify time range
tigeropen quote bars XYZX --period day --begin-time 2025-01-01 --end-time 2025-03-01
# Get today's intraday data
tigeropen quote timeline XYZX
# Get intraday data for a specific date
tigeropen quote timeline XYZX --date 2025-03-20
# Tick-by-tick data
tigeropen quote ticks XYZX --limit 100
# Full trade ticks (including buy/sell attribution)
tigeropen quote ticks XYZX --full --limit 100
# Order book (depth)
tigeropen quote depth XYZX --market US
# U.S. market status
tigeropen quote market-status --market US
# U.S. stock symbol list
tigeropen quote symbols --market USStock Scanner
# Top gainers today
tigeropen quote scanner --filter gainers --sort acc.ChangeRate --sort-dir DESC
# Large-cap U.S. 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
# Low float, high relative volume
tigeropen quote scanner --filter acc.FloatShares::5e7 --filter acc.RelativeVolume:2: --sort acc.RelativeVolume --sort-dir DESC--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,SEMIANNUALfin.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 XYZX
# Get option chain
tigeropen quote option chain XYZX 2025-06-20
# Get option quotes (OCC 21-character identifier)
tigeropen quote option briefs "XYZX 250620C00200000"
# Get option K-line data
tigeropen quote option bars "XYZX 250620C00200000" --period dayOCC format:
{symbol padded to 6}{YYMMDD}{C or P}{8-digit strike × 1000}. Example:XYZX 250829C00150000= XYZX call, Aug 29 2025, strike $150.
Capital Flow
# Get capital flow data (inflow/outflow by period)
tigeropen quote capital flow XYZX --period day
# Get capital distribution (retail vs institutional)
tigeropen quote capital distribution XYZXOrder Management
# List orders
tigeropen trade order list
# Filter by status
tigeropen trade order list --status Filled
# Filter by symbol
tigeropen trade order list --symbol XYZX --status Submitted
# Get order details
tigeropen trade order get 12345678
# Preview an order (shows estimated commission, no actual submission)
tigeropen trade order preview --symbol XYZX --action BUY --quantity 100 --limit-price 150.00
# Place a limit order (Paper Trading by default)
tigeropen trade order place --symbol XYZX --action BUY --order-type LMT --quantity 100 --limit-price 150.00
# Place a market order
tigeropen trade order place --symbol XYZX --action BUY --order-type MKT --quantity 100
# Place a stop order
tigeropen trade order place --symbol XYZX --action SELL --order-type STP --quantity 100 --aux-price 140.00
# Extended-hours limit order (pre-market / after-hours)
tigeropen trade order place --symbol XYZX --action BUY --order-type LMT --quantity 100 --limit-price 150.00 --outside-rth
# Modify an order
tigeropen trade order modify 12345678 --limit-price 151.00
# Cancel an order
tigeropen trade order cancel 12345678Safety: By default, orders are placed against the Paper Trading account. To place a live order, specify your live account explicitly:
--account YOUR_LIVE_ACCOUNT_ID.
Positions
# List all positions
tigeropen trade position list
# Filter by security type
tigeropen trade position list --sec-type STK
# Filter by symbol
tigeropen trade position list --symbol XYZXTransaction History
# View transaction history
tigeropen trade transaction list
# Filter by symbol and date range
tigeropen trade transaction list --symbol XYZX --start-time 2025-01-01 --end-time 2025-03-01Account Information
# View account info
tigeropen account info
# View asset summary (net liquidation, buying power, cash balance)
tigeropen account assets
# View assets in USD
tigeropen account assets --currency USD
# View historical asset analytics (daily net liquidation, P&L)
tigeropen account analytics --start-date 2025-01-01 --end-date 2025-03-01Real-Time Streaming
The CLI supports subscribing to real-time data streams. Press Ctrl+C to stop:
# Subscribe to real-time quotes
tigeropen push quote XYZX XYZZ ABCD
# Subscribe to order status updates
tigeropen push order
# Subscribe to position updates
tigeropen push position
# Subscribe to asset updates
tigeropen push assetConfiguration 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 pathOther Commands
# Print SDK version
tigeropen version
# Uninstall
tigeropen uninstall
# Uninstall and remove config directory
tigeropen uninstall --remove-configOutput Formats
The CLI supports three output formats, switchable via the -f option. Default is json.
JSON Format (Default)
tigeropen quote briefs XYZX -f jsonExample output:
[
{
"symbol": "XYZX",
"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
tigeropen quote briefs XYZX -f tableExample output:
symbol open high low close pre_close latest_price latest_time volume amount status
XYZX 217.565 220.48 216.23 220.37 218.27 220.37 2025-03-21 16:00:00 34552403 7544389505 NORMAL
CSV Format
tigeropen quote briefs XYZX -f csvThe -f flag is a global option and can be placed anywhere in the command:
tigeropen -f table quote briefs XYZX
tigeropen quote bars XYZX --period day -f csvRate Limits
The CLI follows the same rate limits as the TradeUP OpenAPI. For details, see Request Rate Limits.
Updated 1 day ago