longbridge
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLongbridge CLI
Longbridge CLI
A CLI that wraps all Longbridge OpenAPI endpoints. Supports Hong Kong (HK), US, and China A-share (SH/SZ) markets.
一款封装了Longbridge所有OpenAPI接口的CLI工具,支持港股(HK)、美股(US)及A股(沪/深)市场。
Authentication
身份认证
bash
longbridge login # Opens browser OAuth flow; token saved to ~/.longbridge/terminal/.openapi-session
longbridge logout # Clear token
longbridge check # Verify token, region, and API endpoint connectivity (no auth required)The CLI auto-detects China Mainland by probing on each startup (background, non-blocking). The result is cached in ; if CN, all API calls use CN endpoints automatically on the next run.
geotest.lbkrs.com~/.longbridge-openapi/region-cachebash
longbridge login # 打开浏览器OAuth流程;令牌将保存至~/.longbridge/terminal/.openapi-session
longbridge logout # 清除令牌
longbridge check # 验证令牌、地区及API端点连通性(无需身份认证)该CLI在每次启动时会通过探测自动检测是否处于中国大陆地区(后台执行,无阻塞)。检测结果会缓存到中;若检测为中国大陆地区,下一次运行时所有API调用将自动使用国内节点。
geotest.lbkrs.com~/.longbridge-openapi/region-cacheSymbol Format
股票代码格式
All symbols:
<CODE>.<MARKET>| Market | Examples |
|---|---|
| |
| |
| |
| |
所有股票代码格式为:
<代码代码>.<市场代码>| 市场代码 | 示例 |
|---|---|
| |
| |
| |
| |
Output Formats
输出格式
bash
--format table # Human-readable (default)
--format json # Machine-readable for AI agents and scriptsbash
--format table # 易读格式(默认)
--format json # 机器可读格式,适用于AI Agent及脚本Quick Reference
快速参考
Most Common Commands
常用命令
bash
undefinedbash
undefinedDiagnostics
诊断工具
longbridge check
longbridge check
News, filings, and community topics
新闻、公告及社区话题
longbridge news TSLA.US
longbridge news-detail <id>
longbridge filings AAPL.US
longbridge topics TSLA.US
longbridge topic-detail <id>
longbridge news TSLA.US
longbridge news-detail <id>
longbridge filings AAPL.US
longbridge topics TSLA.US
longbridge topic-detail <id>
Real-time quote
实时报价
longbridge quote TSLA.US 700.HK AAPL.US
longbridge quote TSLA.US 700.HK AAPL.US
Daily candlesticks (last 100)
日K线数据(最近100条)
longbridge kline TSLA.US --period day --count 100
longbridge kline TSLA.US --period day --count 100
Historical data by date range
指定日期范围的历史数据
longbridge kline-history TSLA.US --start 2024-01-01 --end 2024-12-31
longbridge kline-history TSLA.US --start 2024-01-01 --end 2024-12-31
Order book depth
盘口深度
longbridge depth TSLA.US
longbridge depth TSLA.US
Account positions
账户持仓
longbridge positions
longbridge positions
Today's orders
今日订单
longbridge orders
longbridge orders
Submit a limit buy order
提交限价买入订单
longbridge buy TSLA.US 100 --price 250.00
longbridge buy TSLA.US 100 --price 250.00
Submit a market sell order
提交市价卖出订单
longbridge sell AAPL.US 50 --order-type MO
undefinedlongbridge sell AAPL.US 50 --order-type MO
undefinedReference Files
参考文档
- Quote commands (quote, depth, kline, trades, options, warrants, market data): See references/quote-commands.md
- Trade commands (orders, buy, sell, positions, balance, executions): See references/trade-commands.md
- Watchlist commands (create, update, delete groups): See references/watchlist-commands.md
Load the relevant reference file based on what the user is asking about.
- 行情类命令(quote、depth、kline、trades、options、warrants、market data):详见references/quote-commands.md
- 交易类命令(orders、buy、sell、positions、balance、executions):详见references/trade-commands.md
- 自选股类命令(创建、更新、删除分组):详见references/watchlist-commands.md
根据用户的问题加载对应的参考文档。