/install longbridge-stock
Longbridge Stock Queries
Prerequisites
pip3 install longport
Scripts
Run from the skill directory:
| Script | Usage | Description |
|---|---|---|
quote.py |
python3 scripts/quote.py AAPL.US GOOGL.US |
Real-time stock quotes |
balance.py |
python3 scripts/balance.py |
Account balance and buying power |
positions.py |
python3 scripts/positions.py |
Portfolio positions |
Stock Symbol Format
| Market | Format | Examples |
|---|---|---|
| US | \x3CTICKER>.US |
AAPL.US, GOOGL.US, TSLA.US |
| Hong Kong | \x3CNUMBER>.HK |
700.HK (腾讯), 9988.HK (阿里) |
| Shanghai A-share | \x3CCODE>.SH |
600519.SH (茅台) |
| Shenzhen A-share | \x3CCODE>.SZ |
300750.SZ (宁德时代) |
See symbols.md for common stock codes.
Configuration
Create .longbridge_config in one of these locations (priority order):
- Environment variable:
LONGBRIDGE_CONFIG=/path/to/.longbridge_config \x3Cskill-dir>/.longbridge_config\x3Cskill-dir>../../../.longbridge_config(workspace root)~/.longbridge_configor~/.config/longbridge/.longbridge_config
Config file format:
LONGPORT_APP_KEY=\x3Cyour_app_key>
LONGPORT_APP_SECRET=\x3Cyour_app_secret>
LONGPORT_ACCESS_TOKEN=\x3Cyour_access_token>
LONGPORT_REGION=cn
LONGPORT_HTTP_URL=https://openapi.longportapp.cn
LONGPORT_QUOTE_WS_URL=wss://openapi-quote.longportapp.cn
LONGPORT_TRADE_WS_URL=wss://openapi-trade.longportapp.cn
Get credentials from https://open.longport.com/
For detailed setup, see config.md.
Troubleshooting
| Error | Solution |
|---|---|
配置文件不存在 |
Create .longbridge_config |
配置文件缺少: LONGPORT_ACCESS_TOKEN |
Add all required fields to config |
ModuleNotFoundError: No module named 'longport' |
Run pip3 install longport |
You do not have access to market's Open API data |
Check Longbridge subscription |
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install longbridge-stock - After installation, invoke the skill by name or use
/longbridge-stock - Provide required inputs per the skill's parameter spec and get structured output
What is longbridge-stock?
Real-time stock quotes and account queries for Longbridge (长桥证券) users. Query US/HK/China stocks, account balance, and positions. Use whenever user mentions... It is an AI Agent Skill for Claude Code / OpenClaw, with 359 downloads so far.
How do I install longbridge-stock?
Run "/install longbridge-stock" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is longbridge-stock free?
Yes, longbridge-stock is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does longbridge-stock support?
longbridge-stock is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created longbridge-stock?
It is built and maintained by weipapa (@weipapa); the current version is v1.0.0.