Skip to main content

Webull CLI

A command-line trading tool for AI agents, quantitative developers, and individual developers. It provides structured access to US stock and ETF market data, screener rankings, fundamentals, watchlists, stock trading, account information, and order management.

Source code: webull-inc/webull-openapi-cli


What is Webull CLI​

Webull CLI (webull) is a single-binary Go application that exposes Webull OpenAPI through a consistent command-line interface. It signs REST requests with App Key and App Secret credentials, sends them to Webull OpenAPI, and writes structured results to standard output.

The CLI is suitable for interactive use, shell scripts, CI jobs, quantitative workflows, and AI coding assistants that can execute terminal commands.

Capabilities​

AreaAvailable capabilities
ProductsUS stocks and ETFs
TradingPreview, place, replace, cancel, and query stock orders
Market dataSnapshot, historical bars, batch bars, quotes, tick data, footprint data, and NOII data
ScreenerGainers/losers, most active, market sectors, high dividend, and 52-week high/low rankings
FundamentalsCompany profile, analyst ratings, financial statements, earnings/dividend calendars, and fund/ETF data
WatchlistsCreate, update, delete, and manage watchlist instruments
AccountsAccount list, balance, buying power, cash, and positions
InstrumentsStock and ETF instrument lookup
AutomationJSON output, CSV export, structured errors, and explicit exit codes

The market data and trading scope follows the current Trading API overview and Market Data API overview.

Architecture Overview​

Prerequisites​

  • App Key and App Secret obtained through the OpenAPI application process
  • Webull App access when 2FA approval is required
  • An active OpenAPI market data subscription for real-time and historical US stock/ETF data. Note that subscriptions purchased through the Webull App or desktop platform are separate and do not cover OpenAPI access
  • Go 1.26.2 or later when installing from source (pre-built binaries do not require Go)

Installation​

Pre-built Binary​

Download the binary for your platform from GitHub Releases, extract it, and add it to your PATH.

Go Install​

go install github.com/webull-inc/webull-openapi-cli/cmd/webull@latest
export PATH="$PATH:$(go env GOPATH)/bin"

Build from Source​

git clone https://github.com/webull-inc/webull-openapi-cli.git
cd webull-openapi-cli
go build ./cmd/webull/

Verify the installation:

webull version

Setup​

1. Authenticate​

webull auth login --region th

Enter the App Key and App Secret when prompted. If 2FA is enabled, approve the request in the Webull App. Sensitive credentials and tokens are stored in the operating system keychain; non-sensitive profile settings are stored in the local profile configuration.

For UAT, provide the assigned API endpoint explicitly:

webull auth login --region th --env uat \
--api-endpoint <uat-api-host> \
--name uat

2. Verify Configuration​

webull auth status
webull doctor

3. Verify Account Access​

webull account list

Use the returned account ID with account and order commands.

Usage Examples​

Market Data​

# Real-time snapshots for one or more symbols
webull data stock snapshot --symbol AAPL,TSLA --category US_STOCK

# Daily bars for a single symbol
webull data stock bars --symbol AAPL --category US_STOCK \
--timespan D --count 200

# Batch bars for multiple symbols
webull data stock batch-bars --symbol AAPL,TSLA --category US_STOCK \
--timespan M5 --count 100

# Bid/ask order book
webull data stock quotes --symbol AAPL --category US_STOCK --depth 10

# Tick-by-tick trades
webull data stock tick --symbol AAPL --category US_STOCK --count 100

# Order-flow footprint
webull data stock footprint --symbol AAPL --category US_STOCK \
--timespan M1 --count 200

Stock snapshots can request extended-hours and overnight information:

webull data stock snapshot --symbol AAPL --category US_STOCK \
--extend-hour --overnight

Supported bar intervals include minute, hourly, daily, weekly, monthly, and yearly granularities. Exact availability depends on the endpoint and the account's market data permissions.

NOII (Net Order Imbalance Indicator) data for US auction phases:

webull data stock noii-snapshot --symbol AAPL --action-type PRE_OPEN
webull data stock noii-bars --symbol AAPL --action-type PRE_CLOSE

Screener​

# Top gainers (DESC) or losers (ASC)
webull data screener gainers-losers --rank-type DAY_1 --direction DESC

# Most active stocks by volume
webull data screener actives --rank-type VOLUME

# Market sectors, high dividend, and 52-week high/low rankings
webull data screener market-sectors
webull data screener high-dividend
webull data screener 52whl

Fundamentals​

# Company profile and analyst views
webull data fundamentals company-profile --symbol AAPL
webull data fundamentals analyst-rating --symbol AAPL
webull data fundamentals analyst-price --symbol AAPL

# Financial statements (ANNUAL or QUARTERLY)
webull data fundamentals income --symbol AAPL --type ANNUAL --count 5

# Earnings calendar and ETF holdings
webull data fundamentals earnings-calendar --symbol AAPL
webull data fundamentals fund-holdings --symbol SPY --category US_ETF

Watchlists​

webull watchlist list
webull watchlist create --name "Tech"
webull watchlist get --id <watchlist-id>
webull watchlist add --id <watchlist-id> --file instruments.json

Stock Trading​

Preview an order before submission:

webull order stock preview --account-id <account-id> --symbol AAPL \
--side BUY --qty 10 --type LIMIT --limit-price 185.00 \
--market US --time-in-force DAY

Place a limit order:

webull order stock submit --account-id <account-id> --symbol AAPL \
--side BUY --qty 10 --type LIMIT --limit-price 185.00 \
--market US --time-in-force DAY

The current stock order workflow supports:

  • Order types: MARKET, LIMIT, STOP_LOSS, and STOP_LOSS_LIMIT
  • Time in force: DAY and GTC
  • Trading sessions: CORE, ALL, NIGHT, and ALL_DAY
  • Quantity-based orders with optional custom client order IDs
  • Interactive confirmation before order submission (skip with -y)
  • Dry-run output for inspecting a stock order request without sending it

Dry-run example:

webull order stock submit --account-id <account-id> --symbol AAPL \
--side BUY --qty 10 --type LIMIT --limit-price 185.00 \
--market US --dry-run

Order Management​

# View open orders
webull order open --account-id <account-id>

# View one order
webull order detail --account-id <account-id> \
--client-order-id cli_stock_123456

# Query order history
webull order history --account-id <account-id> \
--start 2026-01-01 --end 2026-01-31

# Replace an open order
webull order stock replace --account-id <account-id> \
--client-order-id cli_stock_123456 --limit-price 190.00

# Cancel an order
webull order cancel --account-id <account-id> \
--client-order-id cli_stock_123456

Open orders and history support cursor-based pagination.

Account Information​

webull account list
webull account balance --account-id <account-id>
webull account positions --account-id <account-id>

Instrument Lookup​

webull instrument stock --symbol AAPL,TSLA \
--category US_STOCK --page-size 100

Instrument lookup can filter by symbol and trading status and supports cursor-based pagination.

Available Commands​

Trading and Orders​

CommandDescription
order stock previewEstimate a stock order before submission
order stock submitPlace a stock order
order stock replaceModify an existing open stock order
order cancelCancel an open or pending order
order openList current open orders
order detailRetrieve details for one order
order historyQuery historical orders

Market Data​

CommandDescription
data stock snapshotRetrieve real-time stock/ETF snapshots
data stock barsRetrieve OHLCV bars for one symbol
data stock batch-barsRetrieve OHLCV bars for multiple symbols
data stock quotesRetrieve bid/ask depth data
data stock tickRetrieve tick-by-tick trades
data stock footprintRetrieve order-flow and volume-profile data
data stock noii-barsRetrieve NOII (Net Order Imbalance) bars
data stock noii-snapshotRetrieve the latest NOII snapshot

Screener​

CommandDescription
data screener gainers-losersTop gainers and losers
data screener activesMost active stocks
data screener market-sectorsMarket sector overview and performance rankings
data screener market-sectors-detailStock list and statistics for a specific sector
data screener high-dividendHigh dividend stocks ranking
data screener 52whl52-week high/low stocks ranking

Fundamentals​

CommandDescription
data fundamentals company-profileCompany profile information
data fundamentals analyst-ratingAnalyst rating
data fundamentals analyst-priceAnalyst target price
data fundamentals capital-flowCapital flow distribution for a stock
data fundamentals industry-comparisonIndustry peer comparison (up to 20 symbols)
data fundamentals filingsMost recent SEC filings
data fundamentals earnings-calendarEarnings calendar
data fundamentals dividend-calendarDividend calendar
data fundamentals forecast-epsForecast EPS
data fundamentals alertUpcoming earnings release alert
data fundamentals indicatorsFinancial indicators (ROA, ROE, EPS, etc.)
data fundamentals incomeIncome statement
data fundamentals balancesheetBalance sheet
data fundamentals cashflowCash flow statement
data fundamentals fund-briefFund brief information
data fundamentals fund-performanceFund performance returns
data fundamentals fund-ratingFund rating
data fundamentals fund-allocationFund asset allocation
data fundamentals fund-holdingsFund top 10 holdings
data fundamentals fund-net-valueFund net asset value (NAV) history
data fundamentals fund-dividendsFund dividend history
data fundamentals fund-splitsFund split history
data fundamentals fund-filesFund documents and files

Watchlists​

CommandDescription
watchlist listList all watchlists
watchlist createCreate a watchlist
watchlist updateUpdate a watchlist's name or sort order
watchlist deleteDelete a watchlist
watchlist getGet the instruments in a watchlist
watchlist addAdd instruments to a watchlist
watchlist removeRemove instruments from a watchlist
watchlist sortUpdate the instrument sort order in a watchlist

Accounts and Instruments​

CommandDescription
account listList trading accounts
account balanceRetrieve equity, buying power, cash, and P&L information
account positionsRetrieve current positions
instrument stockQuery stock and ETF instruments

Authentication, Profiles, and Utilities​

CommandDescription
auth loginAuthenticate with App Key, App Secret, and optional 2FA
auth statusShow the active authentication status
profile listList configured profiles
profile switch <name>Change the active profile
profile logout [name]Remove a profile and its stored credentials
profile set-endpointSet a custom API endpoint for the active profile
doctorDiagnose profile, credentials, endpoint, and environment settings
versionPrint version and build information

Supported Scope​

The CLI binary is shared across Webull services, so --help may list commands and flags that are not available for your account. Supported scope:

  • Order market is US; instrument categories are US_STOCK and US_ETF
  • Order types: MARKET, LIMIT, STOP_LOSS, STOP_LOSS_LIMIT; time in force: DAY, GTC
  • Orders are quantity-based (--entrust-type QTY); fractional (AMOUNT), trailing stop, and algo (--algo-type) orders are not supported
  • order stock combo, option, futures, crypto, and event contract commands are not supported
  • account position-detail and order executions are not supported
  • The --account-tax-type, --margin-type, --position-intent, and --close-contracts flags do not apply

Run any command with --help to inspect its complete flags:

webull order stock submit --help
webull data stock bars --help

Output and Automation​

JSON is the default output format. API data is written to stdout so scripts and agents can consume it directly:

webull account positions --account-id <account-id>

Use --csv for commands that support tabular export:

webull account positions --account-id <account-id> --csv
webull data stock bars --symbol AAPL --category US_STOCK --csv

Errors are written to stderr as JSON where possible and include an error_code and message. The process exits with code 0 on success and 1 on error.

Credentials can be supplied through environment variables after a profile has been configured:

export WEBULL_APP_KEY=<your-app-key>
export WEBULL_APP_SECRET=<your-app-secret>
webull account list

Global Flags​

FlagDescription
--profileSelect a configured profile by name
--regionOverride the profile's region (use th)
--envSelect prod or uat
--csvRequest CSV output where supported
-q, --quietSuppress non-data output and confirmation prompts
--verboseWrite request summaries to stderr
--debugWrite full request/response diagnostics to stderr
--timeoutSet the HTTP timeout in seconds; default is 30
-y, --yesSkip confirmation prompts

Security and Safety​

  • Never paste an App Key, App Secret, or token into chat, source code, or command history.
  • Use order stock preview to review estimated order details before submission.
  • Use --dry-run to inspect the generated stock order request without sending it.
  • Stock submit, replace, and cancel operations prompt for confirmation by default.
  • --yes and --quiet bypass confirmation prompts. Use them only in controlled automation after validating all order parameters.
  • Use separate named profiles for production and UAT.
  • Real-time and historical data availability depends on OpenAPI market data permissions. See the market data getting-started guide.

Disclosure​

Trading securities involves risk of loss. Verify the account, symbol, side, quantity, order type, price, time in force, and trading session before submitting an order. This software is provided as is without warranty and does not provide investment advice.