Access Hong Kong, US, and A-share stock trading, real-time market data, order management, and account info via Longbridge Securities OpenAPI.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install longbridge-openapi或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install longbridge-openapi⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/longbridge-openapi/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
Longbridge Securities OpenAPI SDK, supporting Hong Kong and US stock trading, real-time market data subscription, and account management.
Longbridge OpenAPI Skill is an AI skill package integrated with Longbridge Securities Open API, allowing you to interact with OpenClaw using natural language to easily complete stock market queries, trade orders, account management, and other operations.
| Market | Code Format | Examples | |--------|------------|----------| | 🇭🇰 Hong Kong | XXX.HK | 700.HK (Tencent), 9988.HK (Alibaba) | | 🇺🇸 US Stocks | XXX.US | AAPL.US (Apple), TSLA.US (Tesla) | | 🇨🇳 A-Shares | XXX.SH/SZ | 000001.SZ (Ping An Bank), 600519.SH (Moutai) |
Visit Longbridge Open Platform to register an account and create an application to obtain:
Before using this skill, you must set the following environment variables:
export LONGBRIDGE_APP_KEY="your_app_key_here"
export LONGBRIDGE_APP_SECRET="your_app_secret_here"
export LONGBRIDGE_ACCESS_TOKEN="your_access_token_here"
Persistent Configuration (Recommended):
Add to ~/.bashrc or ~/.zshrc:
# Longbridge OpenAPI Configuration
export LONGBRIDGE_APP_KEY="your_app_key_here"
export LONGBRIDGE_APP_SECRET="your_app_secret_here"
export LONGBRIDGE_ACCESS_TOKEN="your_access_token_here"
Then execute source ~/.bashrc or source ~/.zshrc to apply the configuration.
User Input:
Query the latest stock prices of Tencent and Alibaba
OpenClaw Operation:
get_realtime_quote toolsymbols=['700.HK', '9988.HK']Response:
Tencent Holdings (700.HK)
Latest: 320.40 HKD | Change: +2.40 (+0.75%)
Open: 318.00 | High: 322.80 | Low: 317.60
Volume: 1,234,567 shares | Turnover: 395M HKD
Alibaba-SW (9988.HK)
Latest: 78.50 HKD | Change: -1.20 (-1.51%)
Open: 79.20 | High: 80.00 | Low: 78.00
Volume: 2,345,678 shares | Turnover: 184M HKD
User Input:
Get the last 7 days of daily candlestick data for Apple stock
OpenClaw Operation:
get_candlesticks toolsymbol='AAPL.US', period='day', count=7Response: Contains 7 candlesticks with data including open, high, low, close, volume, etc.
User Input:
Buy 100 shares of Tencent at 320 HKD
OpenClaw Operation:
submit_order tool```python symbol='700.HK' order_type='LO' # Limit order side='Buy' quantity=100 price=320.0 time_in_force='Day' ```
Response:
✅ Order submitted successfully
Order ID: 123456789
Stock: Tencent Holdings (700.HK)
Side: Buy
Quantity: 100 shares
Price: 320.00 HKD
Type: Limit Order (Day)
User Input:
What is my account balance?
OpenClaw Operation:
get_account_balance toolResponse:
💰 Account Fund Status
HKD Account
Cash: 50,000.00 HKD
Buying Power: 100,000.00 HKD
Net Assets: 150,000.00 HKD
USD Account
Cash: 10,000.00 USD
Buying Power: 20,000.00 USD
Net Assets: 30,000.00 USD
User Input:
What stocks do I hold?
OpenClaw Operation:
get_stock_positions toolResponse:
📊 Current Positions
1. Tencent Holdings (700.HK)
Quantity: 500 shares | Available: 500 shares
Cost: 300.00 HKD | Current: 320.40 HKD
Market Value: 160,200.00 HKD | P&L: +10,200.00 (+6.80%)
2. Apple (AAPL.US)
Quantity: 100 shares | Available: 100 shares
Cost: 150.00 USD | Current: 175.50 USD
Market Value: 17,550.00 USD | P&L: +2,550.00 (+17.00%)
| Tool Name | Description | |-----------|-------------| | quote_subscribe | Subscribe to real-time market feeds (quote/depth/broker/trade) | | get_realtime_quote | Get real-time stock quotes | | get_static_info | Get stock static information | | get_candlesticks | Get historical candlestick data |
| Tool Name | Description | |-----------|-------------| | submit_order | Submit trading orders | | cancel_order | Cancel orders | | get_today_orders | Get today's order list | | get_history_orders | Get historical orders |
| Tool Name | Description | |-----------|-------------| | get_account_balance | Query account fund balance | | get_stock_positions | Query position list |
| Type Code | Order Type | Description | |-----------|------------|-------------| | LO | Limit Order | Execute at specified price or better | | MO | Market Order | Execute immediately at current market price | | ELO | Enhanced Limit Order | Hong Kong stocks specific, can match at multiple price levels | | ALO | At-auction Limit Order | Use during auction period |
| Code | Time in Force | Description | |------|---------------|-------------| | Day | Day Order | Valid for the current trading day | | GTC | Good Till Cancelled | Valid until filled or manually cancelled | | GTD | Good Till Date | Valid until specified date |
┌──────────────────┐
│ OpenClaw │ ← User natural language interaction
└────────┬─────────┘
│
▼
┌──────────────────┐
│ Longbridge Skill │ ← Skill layer (tool invocation)
│ (skill.py) │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ Longbridge SDK │ ← Python SDK (FFI)
│ (longbridge) │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ Longbridge API │ ← REST API / WebSocket
│ (HTTP/WebSocket) │
└──────────────────┘
...
安装 Longbridge Openapi 后,可以对 AI 说这些话来触发它
Help me get started with Longbridge Openapi
Explains what Longbridge Openapi does, walks through the setup, and runs a quick demo based on your current project
Use Longbridge Openapi to access Hong Kong, US, and A-share stock trading, real-time market d...
Invokes Longbridge Openapi with the right parameters and returns the result directly in the conversation
What can I do with Longbridge Openapi in my finance & investment workflow?
Lists the top use cases for Longbridge Openapi, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/longbridge-openapi/ 目录(个人级,所有项目可用),或 .claude/skills/longbridge-openapi/(项目级)。重启 AI 客户端后,用 /longbridge-openapi 主动调用,或让 AI 根据上下文自动发现并使用。
Longbridge Openapi 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Longbridge Openapi 可免费安装使用。请查阅仓库了解许可证信息。
Access Hong Kong, US, and A-share stock trading, real-time market data, order management, and account info via Longbridge Securities OpenAPI.
Longbridge Openapi 属于「Finance & Investment」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my finance & investment tasks using Longbridge Openapi
Identifies repetitive steps in your workflow and sets up Longbridge Openapi to handle them automatically