Broker Integrations
KlawTrade supports 6 brokers out of the box. Each broker is an optional dependency -- install only what you need. If no API keys are configured, KlawTrade falls back to its built-in simulation broker automatically.
# Install with all brokers
pip install klawtrade[all-brokers]
# Or install a specific broker
pip install klawtrade[ibkr]
pip install klawtrade[coinbase]
pip install klawtrade[binance]
pip install klawtrade[kraken]
pip install klawtrade[tradier]| Broker | Markets | Paper/Sandbox | Config Value |
|---|---|---|---|
| Alpaca | US Equities | Yes | alpaca |
| Interactive Brokers | Stocks, Options, Futures, Forex | Yes | ibkr |
| Coinbase | Cryptocurrency | Yes | coinbase |
| Binance | Cryptocurrency | Yes | binance |
| Kraken | Cryptocurrency | Yes | kraken |
| Tradier | US Equities, Options | Yes | tradier |
Alpaca
US Equities
Commission-free US stock trading with a free paper trading environment. Recommended for getting started.
Sign up at alpaca.markets.
Install
pip install klawtradeConfiguration (settings.yaml)
broker:
provider: alpaca
paper: trueEnvironment Variables (.env)
ALPACA_API_KEY=PKxxxxxxxxxxxxxxxx
ALPACA_SECRET_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxPaper trading is free and does not require identity verification. Generate keys from the Paper Trading section of your Alpaca dashboard.
Interactive Brokers
Stocks, Options, Futures, Forex
Professional-grade broker with access to 150+ markets worldwide. Requires TWS or IB Gateway running locally.
Sign up at interactivebrokers.com.
Install
pip install klawtrade[ibkr]Configuration (settings.yaml)
broker:
provider: ibkr
paper: trueEnvironment Variables (.env)
IBKR_HOST=127.0.0.1
IBKR_PORT=7497
IBKR_CLIENT_ID=1You must have TWS or IB Gateway running. Paper trading uses port 7497, live uses 7496. Enable API connections in TWS settings under Configuration > API > Settings.
Coinbase
Cryptocurrency
Trade crypto via Coinbase Advanced Trade API. Supports BTC, ETH, and hundreds of other pairs.
Sign up at coinbase.com.
Install
pip install klawtrade[coinbase]Configuration (settings.yaml)
broker:
provider: coinbase
paper: trueEnvironment Variables (.env)
COINBASE_API_KEY=organizations/xxxxx/apiKeys/xxxxx
COINBASE_API_SECRET=-----BEGIN EC PRIVATE KEY-----\n...Generate API keys from Coinbase Developer Platform. Set COINBASE_SANDBOX=true (default) for sandbox testing. Symbols are mapped automatically (e.g., BTC becomes BTC-USD).
Binance
Cryptocurrency
The world's largest crypto exchange by volume. Supports spot trading for hundreds of pairs.
Sign up at binance.com.
Install
pip install klawtrade[binance]Configuration (settings.yaml)
broker:
provider: binance
paper: trueEnvironment Variables (.env)
BINANCE_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BINANCE_API_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSet BINANCE_TESTNET=true (default) for testnet. Symbols are mapped automatically (e.g., BTC becomes BTCUSDT). Not available in the US; use Coinbase instead.
Kraken
Cryptocurrency
Established crypto exchange with strong security track record. Supports major crypto pairs.
Sign up at kraken.com.
Install
pip install klawtrade[kraken]Configuration (settings.yaml)
broker:
provider: kraken
paper: trueEnvironment Variables (.env)
KRAKEN_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
KRAKEN_API_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxGenerate API keys from Settings > API in your Kraken account. Enable 'Create & modify orders' and 'Query open orders & trades' permissions.
Tradier
US Equities, Options
Commission-free stock and options trading with a developer-friendly REST API and free sandbox.
Sign up at tradier.com.
Install
pip install klawtrade[tradier]Configuration (settings.yaml)
broker:
provider: tradier
paper: trueEnvironment Variables (.env)
TRADIER_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TRADIER_ACCOUNT_ID=xxxxxxxxSet TRADIER_SANDBOX=true (default) for sandbox mode. Get sandbox credentials from developer.tradier.com.
Automatic Fallback
If your chosen broker's API keys are not configured or its optional dependency is not installed, KlawTrade automatically falls back to its built-in SimBroker. SimBroker executes trades in memory with simulated slippage, so you can develop and test strategies without any external accounts.