Webull Agent Skills
Webull Agent Skills enable AI coding assistants (Cursor, Claude Desktop, Copilot, Kiro, etc.) to securely access Webull OpenAPI trading and market data capabilities via local Python scripts, with multi-environment (production/test) routing for US markets — stocks, options, futures, crypto, and event contracts.
Source code: webull-inc/webull-openapi-skills
What is Webull Agent Skills
Webull Agent Skills is a Python command-line toolkit (webull-skill) built on the official Webull Python SDK. Any AI coding assistant that can execute shell commands can call it directly. With natural language, you can:
- Query real-time and historical market data (stocks, options, futures, crypto, event contracts)
- Look up instruments, fundamentals, financial statements, and institution/insider data
- Search market news, use screeners, and manage watchlists
- Browse and publish community posts and comments
- View account balances and positions
- Place, modify, and cancel orders (stocks, ETFs, options, futures, crypto, event contracts)
- Execute combo orders (OTO/OCO/OTOCO) and algo orders (TWAP/VWAP/POV)
- Query order history and order details
- Authenticate via 2FA token flow
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
- Python 3.10 – 3.12
- Git (to clone the Skills repository)
- Market Data Subscription (if market data is needed): Subscription Guide
- AI coding assistant with shell command support — e.g. Kiro, Cursor, Claude Desktop
Setup Steps
Step 1: Install Dependencies
git clone https://github.com/webull-inc/webull-openapi-skills.git
cd webull-openapi-skills
# Create and activate a virtual environment (recommended)
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install the package (also installs the Webull Python SDK and the webull-skill command)
pip install -e .
Step 2: Configure Credentials
Create a .env file in the project root (the webull-openapi-skills directory) with your credentials:
- Production
- Test Environment
WEBULL_APP_KEY=your_app_key
WEBULL_APP_SECRET=your_app_secret
WEBULL_ENVIRONMENT=prod
WEBULL_REGION_ID=us
WEBULL_APP_KEY=your_app_key
WEBULL_APP_SECRET=your_app_secret
WEBULL_ENVIRONMENT=uat
WEBULL_REGION_ID=us
Step 3: Authenticate (Optional)
This step is only required if your account has Two-Factor Authentication enabled.
If your account has 2FA enabled, complete a one-time authentication before first use:
webull-skill auth
Authentication flow:
After approving the 2FA request in the Webull App, the token is cached locally and auto-refreshes on use.
Step 4: Verify Connection
webull-skill trading --action account-list
If account information is returned, the setup is successful.
Integration with Different AI Tools
- Cursor
- Claude Desktop
- GitHub Copilot
- Kiro
Create .cursor/rules/webull.mdc in your project root with script paths and usage instructions:
# Webull OpenAPI
When the user needs to query market data or execute trades, use the following commands:
- Trading: webull-skill trading --action <ACTION> [args...]
- Market data: webull-skill market-data --action <ACTION> [args...]
- Auth: webull-skill auth
Add the project as a working directory in Claude Desktop. Claude can execute shell commands directly in conversation to run the scripts.
In Agent Mode, directly request script command execution. Copilot will execute via terminal and return results.
Place scripts in the .kiro/skills/ directory. Kiro will automatically load SKILL.md and recognize all available operations. Just use natural language:
Get AAPL latest price
Usage Examples
Just talk to your AI assistant in natural language:
Market Data:
Get AAPL latest price
Show me TSLA's daily bars for the last 5 days
Get Bitcoin real-time price
Show ES futures snapshot
Trading:
Show my account list
Check my account balance
Buy 10 shares of AAPL at limit price 180
Buy 1 AAPL call option, strike 220, expiring June 2026
Buy 1 ES futures contract at limit 4500
Cancel my open order for TSLA
Show my open orders
Account:
What are my current positions?
Available Endpoints
Actions are invoked as webull-skill <module> --action <action> [options]. Run webull-skill <module> --help for all options.
trading module
Instruments
| Action | Description |
|---|---|
instrument-stock | Get stock/ETF instrument info. |
instrument-crypto | Get cryptocurrency instrument info. |
instrument-option-contracts | List option contracts by underlying symbol, expiry, strike, etc. |
instrument-futures-products | Get all futures products and codes. |
instrument-futures-product-class | Get futures product classification groups. |
instrument-futures-list | Get futures instruments by symbol. |
instrument-futures-by-code | Get futures contracts by product code. |
instrument-event-series | Get event contract series. |
instrument-event-list | Get event contract instruments by series. |
instrument-event-categories | Get event contract categories. |
instrument-event-events | Get events within a series. |
instrument-company-profile | Get company profile (CEO, sector, employees, etc.). |
instrument-analyst-rating | Get analyst buy/hold/sell rating counts. |
instrument-analyst-target-price | Get analyst target price (mean/high/low/median). |
Account
| Action | Description |
|---|---|
account-list | Get all linked accounts. |
balance | Get account balance, buying power, and cash details. |
position | Get current positions and holdings. |
Orders
| Action | Description |
|---|---|
place | Place a stock/ETF order. |
preview | Preview a stock order without submitting. |
replace | Modify an existing stock order. |
batch-place | Place a combo stock order (OTO/OCO/OTOCO). |
algo-place | Place an algorithmic order (TWAP/VWAP/POV). |
option-place | Place a single-leg option order. |
option-preview | Preview an option order without submitting. |
option-replace | Modify an existing option order. |
option-strategy-place | Place a multi-leg option strategy order. |
futures-place | Place a futures order. |
futures-preview | Preview a futures order without submitting. |
futures-replace | Modify an existing futures order. |
crypto-place | Place a cryptocurrency order. |
event-place | Place an event contract order. |
event-replace | Modify an existing event contract order. |
cancel | Cancel an unfilled order. |
open | Get all current open/pending orders. |
history | Get historical orders. |
detail | Get single order details. |
local-check | Run local risk checks on an order without sending a request. |
market-data module
Stock
| Action | Description |
|---|---|
stock-snapshot | Get real-time stock/ETF snapshot. |
stock-bars | Get single stock OHLCV candlestick data. |
stock-batch-bars | Get OHLCV bars for multiple stocks. |
stock-tick | Get stock tick-by-tick trade data. |
stock-quotes | Get real-time bid/ask quotes with depth. |
stock-footprint | Get stock large order footprint (order flow). |
stock-noii-bars | Get NOII OHLCV bars (auction imbalance). |
stock-noii-snapshot | Get NOII real-time snapshot. |
Options
| Action | Description |
|---|---|
option-snapshot | Get real-time option snapshot (requires option market data subscription). |
option-bars | Get option OHLCV bars. |
option-tick | Get option tick-by-tick trade data. |
Futures, Crypto, and Event Contracts
| Action | Description |
|---|---|
futures-snapshot | Get futures real-time snapshot. |
futures-bars | Get futures OHLCV candlestick data. |
futures-tick | Get futures tick-by-tick trade data. |
futures-depth | Get futures order book depth. |
futures-footprint | Get futures large order footprint. |
crypto-snapshot | Get cryptocurrency real-time snapshot. |
crypto-bars | Get cryptocurrency OHLCV bars. |
event-snapshot | Get event contract real-time snapshot. |
event-depth | Get event contract order book depth. |
event-bars | Get event contract OHLCV bars. |
event-tick | Get event contract tick-by-tick data. |
Screener
| Action | Description |
|---|---|
stock-gainers-losers | Top gainers or losers by price change. |
stock-most-active | Most actively traded stocks. |
stock-market-sectors | Get a market-wide sector overview ranking with aggregate statistics by market value or volume. |
stock-market-sectors-detail | Get the constituent stock list and statistics for a specific market sector. |
stock-high-dividend | Get a ranking of high dividend yield stocks in a market. |
stock-52-week-high-low | Get a ranking of stocks at or near their 52-week highs or lows. |
market-sentiment | Get the US market fear & greed sentiment index with historical comparison points. |
stock-unusual-activities | Get recent unusual activity alerts (volume surge, price spike) for US stocks. |
Fundamentals
| Action | Description |
|---|---|
fundamentals-capital-flow | Get capital flow distribution for a stock, broken down by order-size tier. |
fundamentals-sec-filings | Get recent SEC filings for a US stock (last 3 years). |
fundamentals-earnings-calendar | Get a stock's earnings calendar around the current date. |
fundamentals-dividend-calendar | Get a stock's dividend calendar around the current date. |
fundamentals-forecast-eps | Get a stock's recent actual EPS plus the latest analyst consensus estimate. |
fundamentals-industry-comparison | Get industry peer comparison for a stock (up to 20 peers), with a selectable sort metric. |
fundamentals-fund-rating | Get rating history for a fund or ETF. |
fundamentals-fund-performance | Get fund performance returns over multiple horizons. |
fundamentals-fund-allocation | Get a fund's asset allocation breakdown. |
fundamentals-fund-holdings | Get a fund's top 10 holdings. |
fundamentals-fund-brief | Get brief profile information for a fund or ETF. |
fundamentals-fund-dividends | Get a fund's dividend distribution history. |
fundamentals-fund-splits | Get a fund's split history. |
fundamentals-fund-net-value | Get a fund's net asset value (NAV) history, paged by date. |
fundamentals-fund-files | Get documents and files published for a fund. |
fundamentals-financials-alert | Get a stock's earnings alert, comparing next-report estimates against the prior-year period. |
fundamentals-financials-indicators | Get key financial indicators and ratios for a stock, annual or quarterly. |
fundamentals-financials-income | Get a stock's income statement across reporting periods, annual or quarterly. |
fundamentals-financials-balance-sheet | Get a stock's balance sheet across reporting periods, annual or quarterly. |
fundamentals-financials-cashflow | Get a stock's cash flow statement across reporting periods, annual or quarterly. |
institution-search | Search US institutional investors by name or SEC CIK. |
institution-holdings | Get a US institution's 13F holdings. |
institution-holding-changes | Get a US institution's holding changes by position type (OPEN/CLOSE/CHANGE). |
insider-transactions | Get insider transaction records for a US stock (optional BUY/SELL filter). |
insider-holdings-overview | Get insider ownership statistics overview for a US stock. |
economic-calendar | Get the US macroeconomic event calendar for a date range. |
News
| Action | Description |
|---|---|
news-search | Search US market news by keyword. |
news-detail | Get the full content of a news article by ID. |
stock-news | Get news related to a US stock, with optional sentiment filter. |
Watchlist
| Action | Description |
|---|---|
watchlist-list | Get all watchlists. |
watchlist-create | Create a new watchlist. |
watchlist-delete | Delete a watchlist. |
watchlist-update | Update watchlist name or sort. |
watchlist-instruments-list | Get instruments in a watchlist. |
watchlist-instruments-add | Add instruments to a watchlist. |
watchlist-instruments-remove | Remove instruments from a watchlist. |
watchlist-instruments-update | Update instrument sort order. |
Community
| Action | Description |
|---|---|
community-create-post | Create a plain-text post, optionally tagged with a symbol (write operation, requires confirmation). |
community-create-comment | Comment on a community post (write operation, requires confirmation). |
community-hot-stocks | List stocks ranked by community activity. |
community-posts-by-symbol | List community posts for a symbol, with optional keyword and pagination. |
community-post-detail | Get detailed information for a community post. |
community-my-posts | List the current user's posts. |
Configuration
Via .env file or environment variables. Required:
WEBULL_APP_KEY=<your_app_key>
WEBULL_APP_SECRET=<your_app_secret>
Optional:
| Variable | Default | Description |
|---|---|---|
WEBULL_ENVIRONMENT | uat | uat (test) or prod (live) |
WEBULL_REGION_ID | us | us for US region |
WEBULL_MAX_ORDER_NOTIONAL_USD | 10000 | Max order value (USD) |
WEBULL_MAX_ORDER_QUANTITY | 1000 | Max shares per order |
WEBULL_SYMBOL_WHITELIST | (none) | Comma-separated allowed symbols |
WEBULL_CONFIG_DIR | (none) | System environment variable only (has no effect inside .env). Moves .env lookup and token storage to this directory |
WEBULL_TOKEN_DIR | <project_root>/conf/ | Token storage directory ($WEBULL_CONFIG_DIR/conf/ if WEBULL_CONFIG_DIR is set) |
WEBULL_AUDIT_LOG_FILE | (stderr) | Audit log file path |
WEBULL_LOG_LEVEL | WARNING | SDK log level |
Environment Endpoints
| Environment | HTTP API | Trade Events (gRPC) | Market Streaming (MQTT) |
|---|---|---|---|
| Production | api.webull.com | events-api.webull.com | data-api.webull.com |
| Sandbox (test) | api.sandbox.webull.com | events-api.sandbox.webull.com | data-api.sandbox.webull.com |
Output Format
All operations output formatted text directly to stdout, with a region-aware disclaimer:
⚠️ Disclaimer: The information provided by this tool is for reference only ...
=== Stock Snapshot: AAPL ===
Symbol: AAPL
Price: 255.92
Pre Close: 255.63
Change: 0.29
...
- Success: disclaimer + formatted data to stdout, exit code 0
- Error: error message to stderr, exit code 1
- US region: English disclaimer only
Security Recommendations
- Never share your App Key, App Secret, or Token in chat. Credentials should only be passed via
.envfile or environment variables - Use
preview,option-preview, orfutures-previewbefore placing orders community-create-postandcommunity-create-commentpublish content under your account; the AI must show the full text and get your confirmation first- Use
WEBULL_SYMBOL_WHITELISTto restrict tradeable symbols - Use
WEBULL_MAX_ORDER_NOTIONAL_USDandWEBULL_MAX_ORDER_QUANTITYto limit order size - Use
local-checkto validate order parameters without sending requests
Troubleshooting
| Error Message | Cause | Solution |
|---|---|---|
Insufficient permission / subscribe to stock quotes | Insufficient data permissions | Subscribe to market data |
HTTP Status: 401 / UNAUTHORIZED | Credential/environment mismatch | Check .env configuration |
HTTP Status: 417 / INVALID_TOKEN | Token expired or cache issue | Re-run webull-skill auth |
Failed to resolve / NameResolutionError | DNS/network issue | Check network/proxy/firewall settings |
Disclosure
The information provided by this tool is for reference only and does not constitute investment advice. Trading in securities, options, futures, crypto, and other financial instruments involves substantial risk of loss. All trading decisions are made at your own discretion and risk. You are solely responsible for verifying order details before execution. This software is provided "as is" without warranty of any kind.
Related Links
- Webull OpenAPI Docs: developer.webull.com
- Webull MCP Server: Webull MCP
- Python SDK:
pip install webull-openapi-python-sdk