WhiteBIT Exchange CLI — trade, manage accounts, and query market data directly from your terminal. Built for scripting, CI/CD pipelines, and anyone who prefers the command line over a browser UI.
| 110+ commands | Full WhiteBIT API surface: spot, collateral, earn, sub-accounts, deposits, withdrawals |
| Multi-profile | Named profiles in ~/.whitebit/config.toml — switch between different API keys with --profile |
--dry-run mode |
Preview the exact request payload before it hits the API |
| JSON output | --json flag on every command — pipe directly into jq or any automation tool |
| Shell completion | Tab-completion for Bash, Zsh, and Fish |
| Rate-limit aware | Built-in token-bucket limiter per API category — no accidental bursts |
| Cross-platform | macOS (ARM + x64), Linux, and Windows binaries |
brew tap whitebit-exchange/tap
brew install whitebit# Run directly with bunx (recommended)
bunx whitebit market list
# Or install globally with npm
npm install -g whitebit
# Or run with npx
npx whitebit market listDownload pre-compiled binaries from GitHub Releases:
- macOS (ARM64):
whitebit-darwin-arm64 - macOS (x64):
whitebit-darwin-x64 - Linux (ARM64):
whitebit-linux-arm64 - Linux (x64):
whitebit-linux-x64 - Windows (x64):
whitebit-windows-x64.exe
# Example: Install on macOS ARM64
curl -L -o /usr/local/bin/whitebit https://github.com/whitebit-exchange/whitebit-cli/releases/latest/download/whitebit-darwin-arm64
chmod +x /usr/local/bin/whitebit# 1. Set credentials (required for account and trading commands)
export WHITEBIT_API_KEY="your-key"
export WHITEBIT_API_SECRET="your-secret"
# 2. Verify setup — no auth needed
whitebit market list
# 3. Check your balance
whitebit balance trade
# 4. Place a limit order
whitebit trade spot limit-order BTC_USDT buy 0.001 50000Public market data commands work without credentials. See Authentication for all credential options.
Credentials are resolved in priority order (highest first):
| Method | Best For | Persistence | Security |
|---|---|---|---|
CLI flags (--api-key, --api-secret) |
Quick testing, scripts | 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 | 0600 permissions recommended |
Create ~/.whitebit/config.toml with one or more named profiles:
[default]
api_key = "your-api-key"
api_secret = "your-api-secret"
format = "table" # or "json"
[work]
api_key = "work-api-key"
api_secret = "work-api-secret"Switch profiles with --profile:
whitebit balance trade --profile work| Module | Commands | Auth | Description |
|---|---|---|---|
market |
14 | No | Tickers, order book, trades, klines, funding rates, platform status |
mining-pool |
2 | No | Pool statistics and hashrate |
balance |
3 | Yes | Spot, main, and personal fee balances |
deposit |
4 | Yes | Crypto and fiat deposit addresses |
withdraw |
4 | Yes | Crypto and fiat withdrawals + history |
transfer |
1 | Yes | Transfer between main / spot / collateral accounts |
codes |
4 | Yes | Create, apply, and list redemption codes |
earn |
13 | Yes | Fixed and flexible staking, interest history |
trade spot |
18 | Yes | Limit, market, stop, bulk orders; cancel, modify, kill-switch |
trade collateral |
22 | Yes | Margin: leverage, positions, OCO, OTO, conditional orders |
trade convert |
3 | Yes | Estimate and execute asset conversions |
sub-account |
17 | Yes | Sub-account management, API keys, IP whitelists |
Query real-time market data without authentication.
market server-time— Server timestampmarket status— Platform operational statusmarket list— All available trading pairsmarket market-status— Market status listmarket asset-status <asset>— Asset deposit/withdrawal statusmarket futures-markets— Futures trading pairsmarket collateral-markets— Collateral marketsmarket tickers— All market tickersmarket depth <pair>— Order book depthmarket trades <pair>— Recent trades historymarket kline <pair> <interval>— Candlestick datamarket fee— Trading fee schedulemarket funding-history <pair>— Futures funding rate historymarket activity <pair>— 24h trading activity
Mining pool statistics and hashrate.
mining-pool overview— Mining pool statisticsmining-pool hashrate— Mining hashrate
View account balances and fees.
balance main— Main account balancebalance trade [asset]— Spot/trading balancebalance fee— Personal trading fee rates
Manage deposit addresses and requests.
deposit address <asset> <network>— Get deposit addressdeposit fiat-address <provider> <currency>— Fiat deposit addressdeposit create-address <asset> <network>— Create new deposit addressdeposit refund <hash>— Request deposit refund
Manage withdrawals and view history.
withdraw crypto <asset> <amount> <address>— Withdraw cryptowithdraw crypto-amount <asset> <address>— Estimate withdrawal amountwithdraw fiat <currency> <amount> <provider>— Withdraw fiatwithdraw history— Withdrawal history
Internal account transfers.
transfer internal <asset> <amount> <from> <to>— Transfer between accounts (valid accounts:main,spot,collateral)
Manage redemption codes.
codes create <asset> <amount>— Create redemption codecodes apply <code>— Redeem codecodes history— Code creation historycodes list— Active codes
Staking and yield products.
earn fixed plans— Fixed staking plansearn fixed invest <plan_id> <amount>— Create fixed stakingearn fixed investments-history— Staking historyearn fixed close-investment <id>— Close staking early
earn flex plans— Flexible staking plansearn flex invest <plan_id> <amount>— Flexible staking investearn flex investments— Active flexible stakingsearn flex investment-history— Flexible staking historyearn flex payment-history— Flexible payment historyearn flex withdraw <id> <amount>— Withdraw from flexibleearn flex close <id>— Close flexible stakingearn flex auto-reinvest <id> <enabled>— Toggle auto-reinvest
earn interest-history— Interest payment history
Account and credit information.
credit-lines— Credit linesws-token— WebSocket auth token
Place, modify, and cancel orders across spot, collateral, and convert markets.
trade spot limit-order <pair> <side> <amount> <price>— Create a limit ordertrade spot market-order <pair> <side> <amount>— Create a market ordertrade spot bulk-order <pair> --orders '<json>'— Create multiple orders in bulktrade spot stop-limit <pair> <side> <amount> <price> <activation_price>— Create a stop-limit ordertrade spot stop-market <pair> <side> <amount> <activation_price>— Create a stop-market ordertrade spot buy-stock <pair> <amount>— Create a buy stock market order (buy for fixed money amount)trade spot cancel <pair> <order_id>— Cancel a specific ordertrade spot cancel-all— Cancel all orders (optionally filtered by market)trade spot modify <pair> <order_id>— Modify an existing ordertrade spot executed— List executed orderstrade spot unexecuted— List unexecuted (open) orderstrade spot deals <order_id>— Get executed deals for a specific ordertrade spot history— Get trades historytrade spot balance— Get trade balance for all assetstrade spot fee <pair>— Get trading fee for a specific markettrade spot all-fees— Get trading fees for all marketstrade spot kill-switch-status— Get kill switch statustrade spot kill-switch-sync <pair> <timeout>— Sync kill switch timer
trade collateral balance— Fetch collateral account balancetrade collateral summary— Fetch collateral account summarytrade collateral balance-summary— Fetch collateral account balance summary with detailed asset breakdowntrade collateral hedge-mode— Get collateral account hedge mode statustrade collateral set-hedge-mode <enabled>— Update collateral account hedge modetrade collateral limit-order <pair> <side> <amount> <price>— Create a collateral limit ordertrade collateral market-order <pair> <side> <amount>— Create a collateral market ordertrade collateral bulk-order <pair> --orders '<json>'— Create multiple collateral limit orderstrade collateral stop-limit <pair> <side> <amount> <price> <activation_price>— Create a collateral stop-limit ordertrade collateral trigger-market <pair> <side> <amount> <activation_price>— Create a collateral trigger market ordertrade collateral set-leverage <pair> <leverage>— Set leverage for a collateral markettrade collateral close-position <pair>— Close a collateral positiontrade collateral open-positions— Get all open collateral positionstrade collateral position-history— Get collateral positions historytrade collateral funding-history— Get collateral funding historytrade collateral conditional-orders— Get unexecuted conditional orderstrade collateral cancel-conditional <pair> <order_id>— Cancel a conditional ordertrade collateral oco-orders— Get unexecuted OCO orderstrade collateral create-oco <pair> <side> <amount> <price> <stop_price>— Create an OCO (One-Cancels-Other) ordertrade collateral create-oto <pair> <side> <amount> <price> <trigger_price>— Create an OTO (One-Triggers-Other) ordertrade collateral cancel-oco <pair> <order_id>— Cancel an OCO ordertrade collateral cancel-oto <pair> <order_id>— Cancel an OTO order
trade convert estimate <from> <to> <amount>— Estimate conversion rate and amounttrade convert confirm <estimate_id>— Confirm and execute a conversiontrade convert history— Get conversion history
Manage sub-accounts and transfers.
sub-account list— List all sub-accountssub-account create <alias>— Create sub-accountsub-account balance <id>— Sub-account balancesub-account transfer <asset> <amount> [--fromId <id>] [--toId <id>]— Transfer funds to/from sub-accountsub-account transfer-history— Sub-account transfer historysub-account edit <id> <alias>— Edit sub-account detailssub-account delete <id>— Delete a sub-accountsub-account block <id>— Block a sub-accountsub-account unblock <id>— Unblock a sub-accountsub-account api-key-list <sub_account_id>— List all sub-account API keyssub-account api-key-create <sub_account_id> <label> <permissions>— Create API key for sub-accountsub-account api-key-edit <sub_account_id> <api_key_id>— Edit sub-account API keysub-account api-key-reset <sub_account_id> <api_key_id>— Reset sub-account API keysub-account api-key-delete <sub_account_id> <api_key_id>— Delete sub-account API keysub-account ip-list <sub_account_id> <api_key_id>— List IP addresses for API keysub-account ip-add <sub_account_id> <api_key_id> <ip>— Add IP address to API key whitelistsub-account ip-delete <sub_account_id> <api_key_id> <ip>— Remove IP address from API key whitelist
Manage CLI settings and profiles.
config show— Show resolved configuration valuesconfig set --api-key <key> --api-secret <secret>— Store API credentials
help— Show top-level CLI help and exampleslogin— Login and save API credentials (interactive or with flags)completion --shell <bash|zsh|fish>— Generate shell completion script
Generate and activate tab-completion for your shell:
# Bash — add to ~/.bashrc for permanent activation
source <(whitebit completion --shell bash)
# or append to completion file:
whitebit completion --shell bash >> ~/.bash_completion
# Zsh — save to a directory in $fpath
mkdir -p ~/.zfunc
whitebit completion --shell zsh > ~/.zfunc/_whitebit
# Add to ~/.zshrc if not already present:
# fpath=(~/.zfunc $fpath) && autoload -Uz compinit && compinit
# Fish — drop into completions directory
whitebit completion --shell fish > ~/.config/fish/completions/whitebit.fishAvailable for all commands:
--profile <name>— Use specific config profile (default:default)--api-key <key>— Override API key--api-secret <secret>— Override API secret--api-url <url>— Override API URL--format <table|json>— Output format--json— Shortcut for--format json--verbose,-V— Verbose output (show raw API responses)--dry-run— Show what would be sent without executing
Human-readable table output:
whitebit market list --format tableMachine-readable JSON output:
whitebit market list --format json
# or
whitebit market list --jsonUse with jq for filtering:
whitebit market list --json | jq '.[] | select(.name | contains("BTC"))'# Preview a large order before submitting — inspect the request payload
whitebit trade spot limit-order BTC_USDT buy 1.0 50000 --dry-run
# Monitor open orders, refreshing every 5 seconds
watch -n 5 'whitebit trade spot unexecuted --json | jq'
# Use in a CI script — fail the job if the balance check returns an error
whitebit balance trade --json
if [ $? -ne 0 ]; then echo "Balance check failed (exit $?)"; exit 1; fi
# Filter tickers to BTC pairs only
whitebit market tickers --json | jq '[.[] | select(.name | contains("BTC"))]'
# Use a dedicated profile for CI pipelines
whitebit trade spot limit-order BTC_USDT buy 0.001 50000 --profile ci --dry-run| Code | Meaning |
|---|---|
0 |
Success |
1 |
General error |
2 |
Authentication / credential error |
3 |
Network error |
4 |
Usage / bad arguments |
5 |
Rate limit (HTTP 429) |
Useful for conditional shell logic:
whitebit balance trade && echo "OK" || echo "Failed with exit $?"- Never commit credentials to version control
- Use environment variables for CI/CD pipelines
- Set restrictive permissions on config file:
chmod 600 ~/.whitebit/config.toml - Use API key restrictions in WhiteBIT dashboard (IP whitelist, read-only keys)
- Avoid
--api-keyflags in production scripts (visible in process list)
Open an issue at GitHub Issues and include:
- The exact command you ran
- The full error output from stderr
- Output of
whitebit --version
For API errors, re-run with --verbose to capture the full request and response, and include that output in the issue.
# Clone repository
git clone https://github.com/whitebit-exchange/whitebit-cli
cd cli
# Install dependencies
bun install
# Run locally
bun src/cli.ts market list
# Build binaries
bun run build
# Run tests
bun testApache 2.0 — See LICENSE for details.
| WhiteBIT API Documentation | Official API reference |
| API Platform Overview | REST, WebSocket, authentication, rate limits |
| Use with AI | Use API docs with Claude, Cursor, VS Code via MCP |
| GitHub Repository | Source code |
| Releases | Binaries and changelog |
| Contributing | Development setup and contribution guide |
| Security | Vulnerability reporting and security practices |
| Report an Issue | Bug reports and feature requests |
| WhiteBIT Exchange | The exchange |