Webull CLI
Command-line trading tool for AI Agents, quant developers, and institutional clients. Full coverage of US market: stocks/ETFs, options, futures, crypto, and event contracts.
Source code: webull-inc/webull-openapi-cli
What is Webull CLI
Webull CLI (webull) is a single-binary Go tool that wraps the full Webull OpenAPI surface into a structured command-line interface. It provides complete access to all 5 asset classes with the richest feature set across all supported markets.
Capabilities
| Asset Class | Trading | Market Data |
|---|---|---|
| Stocks/ETFs | ✓ | ✓ |
| Options | ✓ | ✓ |
| Futures | ✓ | ✓ |
| Crypto | ✓ | ✓ |
| Event Contracts | ✓ | ✓ |
Architecture Overview
Prerequisites
API Credentials
- Production
- Test Environment
Apply based on your account type:
Individual users: Individual Application Process
Institutional users: Institution Application Process
No application required. Use the publicly shared test credentials to get started immediately. See SDKs and Tools.
Other Requirements
- Go 1.21+ (for
go install) or download pre-built binary - Webull App (if 2FA verification is required)
- Market Data Subscription (for real-time quotes): Subscription Guide
Setup Steps
Step 1: Install Go Environment
Check if Go is already installed:
go version
If not installed or version is below 1.21, install Go:
# macOS (Homebrew)
brew install go
# Linux
wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.22.5.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
# Windows — download installer from https://go.dev/dl/
Verify Go installation:
go version
# Expected: go version go1.21+ or higher
Step 2: Install Webull CLI
go install github.com/webull-inc/webull-openapi-cli/cmd/webull@latest
Or download pre-built binary from GitHub Releases.
Ensure $GOPATH/bin is in your PATH:
export PATH=$PATH:$(go env GOPATH)/bin
Verify:
webull version
Step 3: Authenticate
webull auth login --region us
Enter App Key: <your-app-key>
Enter App Secret: <hidden>
Checking 2FA configuration...
✓ Profile "default" created (region: us, auth: ak_sk)
Step 4: Verify Connection
webull doctor
✓ Token valid, expires: 2026-07-11 10:00:00
✓ Region: US Environment: prod
✓ API connectivity: api.webull.com → 200 (85ms)
✓ Permissions: Stocks ✓ Options ✓ Futures ✓ Crypto ✓ Event Contracts ✓
Step 5: Verify Account Access
webull account list
Usage Examples
Just talk to your AI assistant in natural language, or use the CLI directly:
Market Data:
webull data stock snapshot --symbol AAPL,TSLA
webull data stock bars --symbol AAPL --timespan D --count 200
webull data futures snapshot --symbol ESM6
webull data crypto snapshot --symbol BTC-USD,ETH-USD
webull data event snapshot --symbol FED-RATE-MAY
Trading:
webull order stock submit --account-id ACC123 --symbol AAPL \
--side BUY --qty 10 --type LIMIT --limit-price 185.00
webull order option submit --account-id ACC123 --symbol AAPL \
--side BUY --qty 1 --option-type CALL --strike 190 --expiry 2026-04-17
webull order futures submit --account-id ACC123 --symbol ESM6 \
--side BUY --qty 1 --type LIMIT --limit-price 5200.00 -y
webull order crypto submit --account-id ACC123 --symbol BTC-USD \
--side BUY --qty 0.01 --type MARKET -y
webull order event submit --account-id ACC123 --symbol FED-RATE-MAY \
--side BUY --qty 10 --type LIMIT --limit-price 0.65 -y
Order Management:
webull order open --account-id ACC123
webull order stock replace --account-id ACC123 \
--client-order-id cli_stock_123456 --limit-price 190.00
webull order cancel --account-id ACC123 --client-order-id cli_stock_123456 -y
Account:
webull account balance --account-id ACC123
webull account positions --account-id ACC123
Available Commands
Orders
| Command | Description |
|---|---|
order stock submit | Place stock order (MARKET/LIMIT/STOP_LOSS/STOP_LOSS_LIMIT/TRAILING_STOP_LOSS) |
order stock preview | Preview stock order cost |
order stock replace | Modify a stock order |
order stock combo | Combo order (OTO/OCO/OTOCO) |
order stock algo | Algo order (TWAP/VWAP/POV) |
order option submit | Place single-leg option order |
order option preview | Preview option order cost |
order option replace | Modify an option order |
order option strategy | Multi-leg option strategy |
order futures submit | Place futures order |
order futures replace | Modify futures order |
order crypto submit | Place crypto order |
order event submit | Place event contract order |
order event replace | Modify event contract order |
order cancel | Cancel any unfilled order |
order open | List open/pending orders |
order detail | Get order details |
order history | Get historical orders |
Market Data
| Command | Description |
|---|---|
data stock snapshot | Real-time stock/ETF snapshot |
data stock bars | Stock OHLCV bars (single) |
data stock batch-bars | Stock OHLCV bars (batch) |
data stock quotes | Order book depth |
data stock tick | Tick-by-tick trades |
data stock footprint | Large order footprint |
data stock noii-bars | NOII auction K-line |
data stock noii-snapshot | NOII auction snapshot |
data futures snapshot | Futures snapshot |
data futures bars | Futures OHLCV bars |
data futures tick | Futures tick-by-tick |
data futures depth | Futures order book |
data futures footprint | Futures large order footprint |
data crypto snapshot | Crypto snapshot |
data crypto bars | Crypto OHLCV bars |
data event snapshot | Event contract snapshot |
data event bars | Event contract bars |
data event tick | Event contract tick-by-tick |
data event depth | Event contract order book |
data screener gainers-losers | Top gainers/losers |
data screener actives | Most active stocks |
Configuration
Environment Endpoints
See API Environments for production and test endpoint details.
Flags
| Flag | Description |
|---|---|
--profile | Use a specific profile |
--region | Override region (us) |
--env | Environment (prod / uat) |
--csv | CSV output |
-q, --quiet | Suppress non-data output |
--verbose | Show HTTP request summary |
--debug | Show full request/response |
--timeout | HTTP timeout in seconds (default 30) |
-y, --yes | Skip confirmation prompts |
--trading-session | Trading session (CORE/ALL/NIGHT/ALL_DAY) |
Security Recommendations
- Never share App Key, App Secret, or Token in chat
- Use
--dry-runto validate parameters without network calls - Use
order previewto estimate costs before live orders - In Live mode, orders require confirmation unless
-yis passed - Use test environment for testing before production
Disclosure
Trading in securities, options, futures, crypto, and event contracts involves substantial risk of loss. All trading decisions are at your own discretion. Verify order details before execution. This software is provided "as is" without warranty.
Related Links
- GitHub: webull-inc/webull-openapi-cli