Webull Agent Skills (SG)
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/uat) routing for Singapore — US stocks and ETFs.
Source code: webull-inc/webull-openapi-skills
What is Webull Agent Skills
Webull Agent Skills is a set of standalone Python scripts built on the official Webull Python SDK. Any AI coding assistant that can execute shell commands can call them directly. With natural language, you can:
- Query real-time market data (US stocks, US ETFs)
- View account balances and positions
- Place, modify, and cancel stock orders
- Query order history and order details
- Authenticate via 2FA token flow
Architecture Overview
Prerequisites
API Credentials
- Production
- UAT (Test)
Apply for API access through the Webull Singapore developer portal: Individual Application Guide
No application required. Use the publicly shared test credentials to get started immediately. See SDKs and Tools.
Other Requirements
- Python 3.10+
- Webull Python SDK:
pip install webull-openapi-python-sdk - Market Data Subscription (if market data is needed)
- AI coding assistant with shell command support — e.g. Kiro, Cursor, Claude Desktop
Setup Steps
Step 1: Clone Repository
git clone https://github.com/webull-inc/webull-openapi-skills.git
cd webull-openapi-skills
Step 2: Install
pip install -e .
Step 3: Configure Credentials
cp .env.example .env
Edit .env with your credentials:
- Production
- UAT
WEBULL_APP_KEY=your_app_key
WEBULL_APP_SECRET=your_app_secret
WEBULL_ENVIRONMENT=prod
WEBULL_REGION_ID=sg
WEBULL_APP_KEY=your_app_key
WEBULL_APP_SECRET=your_app_secret
WEBULL_ENVIRONMENT=uat
WEBULL_REGION_ID=sg
Step 4: Authenticate
Complete a one-time 2FA 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 5: 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 real-time quotes for MSFT
Trading:
Show my account list
Check my account balance
Buy 10 shares of AAPL at limit price 180
Cancel my open order for TSLA
Show my open orders
Show my order history
Account:
What are my current positions?
Available Endpoints
| Endpoint | 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) |
get_instruments | Get stock/ETF instrument info |
get_account_list | Get all linked accounts |
get_account_balance | Get account balance, buying power, and cash details |
get_account_positions | Get current positions and holdings |
get_position_detail | Get position details by instrument |
place_stock_order | Place a stock order |
preview_stock_order | Preview a stock order without submitting |
replace_stock_order | Modify an existing stock order |
cancel_order | Cancel an unfilled order |
get_order_history | Get historical orders |
get_open_orders | Get all current open/pending orders |
get_order_detail | Get single order details |
SG-Specific Notes
- SG supports US stock/ETF market data and stock trading only
- No options, futures, crypto, event contracts, combo orders, or algo orders in SG region
- SG order market is
USonly; instrument categories areUS_STOCKandUS_ETF - Supported order types:
MARKET,LIMIT,STOP_LOSS,STOP_LOSS_LIMIT - Supported time in force:
DAY,GTC - Supported trading sessions:
CORE,ALL,NIGHT,ALL_DAY - Company profile, analyst ratings, NOII bars/snapshot, screener, and watchlist are not available in SG region
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 (UAT) or prod (live) |
WEBULL_REGION_ID | us | Set to sg for SG 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_TOKEN_DIR | conf/ | Token storage directory |
WEBULL_AUDIT_LOG_FILE | (stderr) | Audit log file path |
WEBULL_LOG_LEVEL | WARNING | SDK log level |
Environment Endpoints
| Environment | HTTP API |
|---|---|
| Production | api.webull.com.sg |
| UAT | sg-api.uat.webullbroker.com |
Rate Limits
| Operation | Limit |
|---|---|
| Market data | 300 req/60s |
| Order place / replace / cancel | 600 req/60s |
| Order query | 2 req/2s |
| Auth | 10 req/30s |
Output Format
All operations output formatted text directly to stdout, with a region-aware disclaimer at the top:
⚠️ 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
- SG 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
previewbefore placing orders - Use
WEBULL_SYMBOL_WHITELISTto restrict tradeable symbols - Use
WEBULL_MAX_ORDER_NOTIONAL_USDandWEBULL_MAX_ORDER_QUANTITYto limit order size
Disclosure
The information provided by this tool is for reference only and does not constitute investment advice. Trading in securities 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.sg
- Python SDK:
pip install webull-openapi-python-sdk