Trade, manage accounts, and query market data from the terminal using the WhiteBIT CLI. Built for scripting, CI/CD pipelines, and automated workflows.
The WhiteBIT CLI provides 110+ commands covering the full WhiteBIT API surface — market data, spot trading, collateral trading, lending, sub-accounts, deposits, and withdrawals — directly from the terminal.
Prerequisites
A WhiteBIT account with an API key for authenticated commands — see Authentication
Public market data commands (market, server) require no account or API key.
Feature
Detail
110+ commands
Full API surface: spot, collateral, lending, sub-accounts, deposits, withdrawals
Multi-profile
Named profiles in ~/.whitebit/config.toml, switch with --profile
--dry-run mode
Preview the exact request payload before sending
JSON output
--json flag on every command — pipe into jq or any automation tool
# 1. Set credentials (required for account and trading commands)export WHITEBIT_API_KEY="YOUR_API_KEY"export WHITEBIT_API_SECRET="YOUR_SECRET"# 2. Verify setup — no authentication requiredwhitebit market info# 3. Check the spot balancewhitebit spot balance# 4. Place a limit orderwhitebit spot limit-order --market BTC_USDT --side buy --amount 0.001 --price 50000
Authentication
Credentials are resolved in priority order (highest first):
Method
Best for
Persistence
Security note
CLI flags (--api-key, --api-secret)
Quick testing
None
Visible in process list
Environment variables
CI/CD, Docker, one-off scripts
Per-session
Depends on environment
Config file (~/.whitebit/config.toml)
Daily use, multiple profiles
Permanent
Set chmod 600 on the file
Store API keys securely. Do not commit ~/.whitebit/config.toml to version control. Avoid --api-key flags in production scripts — the value is visible in the process list.
Config file
Create ~/.whitebit/config.toml with one or more named profiles:
# List all available marketswhitebit market info# Get 24h pricing and volume for all marketswhitebit market activity# Get order bookwhitebit market orderbook --market BTC_USDT# Get recent tradeswhitebit market trades --market BTC_USDT
Account and balance
# Check spot balancewhitebit spot balance# Check Main balancewhitebit account main-balance# Transfer 100 USDT from main to spotwhitebit account transfer --from main --to spot --ticker USDT --amount 100
Spot trading
# Place a limit buy orderwhitebit spot limit-order --market BTC_USDT --side buy --amount 0.001 --price 50000# Place a market sell orderwhitebit spot market-order --market BTC_USDT --side sell --amount 0.001# List open orderswhitebit spot active-orders --market BTC_USDT# Cancel an orderwhitebit spot cancel --market BTC_USDT --order-id ORDER_ID
JSON output and scripting
# Output as JSONwhitebit spot balance --json# Pipe into jqwhitebit spot balance --json | jq '.[] | {currency: .currency, balance: .available}'# Dry run — preview the request without sendingwhitebit spot limit-order --market BTC_USDT --side buy --amount 0.001 --price 50000 --dry-run