# moomoo OpenAPI — LLM-Friendly Documentation Index ## Product Info | Item | Value | | --- | --- | | Product | moomoo OpenAPI | | Brand | moomoo | | Docs Domain | [https://open.moomoo.com](https://open.moomoo.com) | | API Host | `webapi.moomoo.com` | | MCP Endpoint | `mcp.moomoo.com/mcp` | | Skills Hub | [https://www.moomoo.com/skillhub](https://www.moomoo.com/skillhub) | ## What OpenAPI Provides moomoo OpenAPI provides programmatic access to market data and trading for developers who want to build strategies, trading tools, or analysis workflows. Core capabilities: - **Trading** — Place, modify, cancel orders; query today's/historical orders and deals; order confirm; max trade quantity - **Quotes** — Real-time quotes, historical K-lines, order book, time-sharing data, tick-by-tick trades - **Portfolio** — Account funds, positions, authorized trading accounts - **Real-time Push** — WebSocket push for quotes and trade events (order placement, modification, cancellation, fills) - **Market Data** — Capital flow, plate/sector, derivatives, screening, IPO, watchlist, F10 deep data, short selling - **Simulated Trading** — Simulated accounts, funds, positions, orders for testing ## Interface Types | Layer | Use Case | | --- | --- | | **RESTful HTTP** | Standard HTTP requests, works with any programming language | | **WebSocket** | Real-time push for quotes and trade events | | **MCP** | Model Context Protocol — connect AI assistants via natural language | | **Skills** | Pre-built AI skills for Cursor, Claude Code, Codex, etc. | ## API Hosts | Service | Host | | --- | --- | | HTTP API | `https://webapi.moomoo.com` | | WebSocket Quote | `wss://webapi-quote.moomoo.com` | | WebSocket Trade | `wss://webapi-trade.moomoo.com` | | MCP | `https://mcp.moomoo.com/mcp` | | Dashboard | `https://webapi.moomoo.com/dashboard` | ## Market Coverage | Market | Code Prefix | Instruments | | --- | --- | --- | | Hong Kong | `HK` | Stocks, ETFs, Warrants/CBBCs, Options, Futures | | US | `US` | Stocks, ETFs, Options | | Shanghai A-share | `SH` | A-shares, ETFs | | Shenzhen A-share | `SZ` | A-shares, ETFs | | Singapore | `SG` | Stocks, ETFs | | Japan | `JP` | Stocks, ETFs | | Australia | `AU` | Stocks, ETFs | | Canada | `CA` | Stocks, ETFs | | Malaysia | `BMS` | Stocks, ETFs | Security identifier format: `{market}.{code}` — e.g. `HK.00700`, `US.AAPL`, `SH.600519`. ## How to Enable OpenAPI 1. Log in to the [moomoo App](https://www.moomoo.com/download) and complete account opening. 2. Visit [https://open.moomoo.com](https://open.moomoo.com) and go to the Dashboard to create an AppKey or register an OAuth client. 3. Choose authentication method (OAuth 2.1 + PKCE recommended) and obtain credentials. ## Trading Capabilities | Market | Stocks & ETF | Warrants & CBBC | Options | Futures | | --- | --- | --- | --- | --- | | Hong Kong (`HK`) | ✓ | ✓ | ✓ | ✓ | | US (`US`) | ✓ | — | ✓ | — | | A-share (`SH`/`SZ`) | ✓ | — | — | — | | Singapore (`SG`) | ✓ | — | — | — | | Japan (`JP`) | ✓ | — | — | — | | Canada (`CA`) | ✓ | — | — | — | | Malaysia (`BMS`) | ✓ | — | — | — | | Australia (`AU`) | ✓ | — | — | — | ## Common Conventions - **Time**: Mostly Unix millisecond timestamps; some fields use seconds. Date fields use `YYYY-MM-DD` in the security's market timezone. - **Ratios**: Percentage values. `1.23` means 1.23%. - **Pagination**: List endpoints use `next_key` / `limit`. See pagination docs. - **Rate Limit**: Batch requests, cache static data, stagger calls, exponential backoff on 429. ## Skills (AI Agent Integration) Skills Hub provides pre-built AI capabilities for natural-language trading, screening, portfolio analysis, news search, sentiment analysis, and more. - Skills Hub: [https://www.moomoo.com/skillhub](https://www.moomoo.com/skillhub) - Install Guide: [https://www.moomoo.com/skills/moomoo-install.md](https://www.moomoo.com/skills/moomoo-install.md) Skills support 13 order types (limit, market, stop loss/profit, trailing stop, TWAP, VWAP, auction, enhanced limit, etc.) and 7 push callbacks. Triple security: local OpenD gateway, trade password (AI cannot access), simulated environment by default. ## Docs - [llm](https://open.moomoo.com/llm.md) --- # Documentation Links Docs base: **https://open.moomoo.com** ## Overview - [API Reference Guide](https://open.moomoo.com/api/overview/api-reference.md) - [Getting Started](https://open.moomoo.com/api/overview/getting-started.md) - [Home](https://open.moomoo.com/api/overview/index.md) - [Rate Limit](https://open.moomoo.com/api/overview/rate-limit.md) ## Quote - [Naming Dictionary](https://open.moomoo.com/api/quote/naming-dictionary.md) - [Overview](https://open.moomoo.com/api/quote/overview.md) - [Pagination](https://open.moomoo.com/api/quote/pagination.md) ## Quote > Real-time - [Current K-line](https://open.moomoo.com/api/quote/realtime/cur-kline.md) - [Market Snapshot](https://open.moomoo.com/api/quote/realtime/market-snapshot.md) - [Order Book](https://open.moomoo.com/api/quote/realtime/order-book.md) - [Stock Quote](https://open.moomoo.com/api/quote/realtime/stock-quote.md) - [Tick-by-tick Trades](https://open.moomoo.com/api/quote/realtime/rt-ticker.md) - [Time-sharing Data](https://open.moomoo.com/api/quote/realtime/rt-data.md) ## Quote > Basic Data - [Economic Calendar Hot](https://open.moomoo.com/api/quote/basic-data/economic-calendar-hot.md) - [Economic Calendar Search](https://open.moomoo.com/api/quote/basic-data/economic-calendar-search.md) - [History K-line](https://open.moomoo.com/api/quote/basic-data/history-kline.md) - [Market State](https://open.moomoo.com/api/quote/basic-data/market-state.md) - [Owner Plate](https://open.moomoo.com/api/quote/basic-data/owner-plate.md) - [Rehabilitation Factor](https://open.moomoo.com/api/quote/basic-data/rehab.md) - [Search](https://open.moomoo.com/api/quote/basic-data/search.md) - [Stock Basic Info](https://open.moomoo.com/api/quote/basic-data/stock-basicinfo.md) - [Trading Days](https://open.moomoo.com/api/quote/basic-data/trading-days.md) ## Quote > Capital Flow - [Capital Distribution](https://open.moomoo.com/api/quote/capital-flow/capital-distribution.md) - [Capital Flow](https://open.moomoo.com/api/quote/capital-flow/capital-flow.md) - [Capital Flow History](https://open.moomoo.com/api/quote/capital-flow/capital-flow-history.md) ## Quote > Plate / Sector - [Plate Constituent Stocks](https://open.moomoo.com/api/quote/plate/plate-stock.md) - [Plate List](https://open.moomoo.com/api/quote/plate/plate-list.md) ## Quote > Derivatives - [Futures Info](https://open.moomoo.com/api/quote/derivatives/future-info.md) - [Option Chain](https://open.moomoo.com/api/quote/derivatives/option-chain.md) - [Option Exercise Probability](https://open.moomoo.com/api/quote/derivatives/option-exercise-probability.md) - [Option Expiration](https://open.moomoo.com/api/quote/derivatives/option-expiration.md) - [Option Volatility](https://open.moomoo.com/api/quote/derivatives/option-volatility.md) - [Reference Futures](https://open.moomoo.com/api/quote/derivatives/reference-future.md) ## Quote > Screening - [Option Screen](https://open.moomoo.com/api/quote/screening/option-screen.md) - [Stock Screen](https://open.moomoo.com/api/quote/screening/stock-screen.md) - [Warrant Screen](https://open.moomoo.com/api/quote/screening/warrant-screen.md) ## Quote > IPO - [IPO List](https://open.moomoo.com/api/quote/ipo/ipo-list.md) ## Quote > Watchlist - [Modify User Security](https://open.moomoo.com/api/quote/watchlist/modify-user-security.md) - [User Security Group](https://open.moomoo.com/api/quote/watchlist/user-security-group.md) - [User Security List](https://open.moomoo.com/api/quote/watchlist/user-security.md) ## Quote > Stock Deep Data (F10) - [Analyst Consensus](https://open.moomoo.com/api/quote/f10/analyst-consensus.md) - [Buybacks](https://open.moomoo.com/api/quote/f10/buybacks.md) - [Company Executives](https://open.moomoo.com/api/quote/f10/company-executives.md) - [Company Profile](https://open.moomoo.com/api/quote/f10/company-profile.md) - [Dividends](https://open.moomoo.com/api/quote/f10/dividends.md) - [Earnings Price History](https://open.moomoo.com/api/quote/f10/earnings-price-history.md) - [Earnings Price Move](https://open.moomoo.com/api/quote/f10/earnings-price-move.md) - [Executive Background](https://open.moomoo.com/api/quote/f10/executive-background.md) - [Financial Statements](https://open.moomoo.com/api/quote/f10/statements.md) - [Holder Detail](https://open.moomoo.com/api/quote/f10/holder-detail.md) - [Holding Changes](https://open.moomoo.com/api/quote/f10/holding-changes.md) - [Insider Holders](https://open.moomoo.com/api/quote/f10/insider-holders.md) - [Insider Trades](https://open.moomoo.com/api/quote/f10/insider-trades.md) - [Institutional](https://open.moomoo.com/api/quote/f10/institutional.md) - [Morningstar](https://open.moomoo.com/api/quote/f10/morningstar.md) - [Operational Efficiency](https://open.moomoo.com/api/quote/f10/operational-efficiency.md) - [Rating Summary](https://open.moomoo.com/api/quote/f10/rating-summary.md) - [Revenue Breakdown](https://open.moomoo.com/api/quote/f10/revenue-breakdown.md) - [Shareholders Overview](https://open.moomoo.com/api/quote/f10/shareholders-overview.md) - [Stock Splits](https://open.moomoo.com/api/quote/f10/stock-splits.md) - [Top Brokers](https://open.moomoo.com/api/quote/f10/top-brokers.md) - [Valuation Detail](https://open.moomoo.com/api/quote/f10/valuation-detail.md) - [Valuation Plate Stocks](https://open.moomoo.com/api/quote/f10/valuation-plate-stocks.md) ## Quote > Short Selling - [Daily Short Volume](https://open.moomoo.com/api/quote/short-selling/daily-short-volume.md) - [Short Interest](https://open.moomoo.com/api/quote/short-selling/short-interest.md) ## Quote > Push (WebSocket) - [Auth](https://open.moomoo.com/api/quote/push/auth.md) - [Data Format](https://open.moomoo.com/api/quote/push/data-format.md) - [Error Codes](https://open.moomoo.com/api/quote/push/error-codes.md) - [Heartbeat](https://open.moomoo.com/api/quote/push/heartbeat.md) - [Overview](https://open.moomoo.com/api/quote/push/overview.md) - [Rate Limit](https://open.moomoo.com/api/quote/push/rate-limit.md) - [Subscribe](https://open.moomoo.com/api/quote/push/subscribe.md) ## Trading - [Naming Dictionary](https://open.moomoo.com/api/trading/naming-dictionary.md) - [Overview](https://open.moomoo.com/api/trading/overview.md) ## Trading > Account - [Get Account Funds](https://open.moomoo.com/api/trading/account/get-funds.md) - [Get Authorized Trading Accounts](https://open.moomoo.com/api/trading/account/get-accounts.md) - [Get Position List](https://open.moomoo.com/api/trading/account/get-positions.md) ## Trading > Trade - [Cancel Order](https://open.moomoo.com/api/trading/trade/cancel-order.md) - [Get Max Trade Quantity](https://open.moomoo.com/api/trading/trade/get-max-qty.md) - [Modify Order](https://open.moomoo.com/api/trading/trade/modify-order.md) - [Order Confirm](https://open.moomoo.com/api/trading/trade/order-confirm.md) - [Place Order](https://open.moomoo.com/api/trading/trade/place-order.md) ## Trading > Order - [Get History Orders](https://open.moomoo.com/api/trading/order/get-history-orders.md) - [Get Open Orders](https://open.moomoo.com/api/trading/order/get-open-orders.md) - [Get Order Details](https://open.moomoo.com/api/trading/order/get-order-details.md) ## Trading > Deal - [Get History Deals](https://open.moomoo.com/api/trading/deal/get-history-deals.md) - [Get Today's Deals](https://open.moomoo.com/api/trading/deal/get-today-deals.md) ## Trading > Trade Event Push - [Auth](https://open.moomoo.com/api/trading/trade_event_push/auth.md) - [Data Format](https://open.moomoo.com/api/trading/trade_event_push/data-format.md) - [Error Codes](https://open.moomoo.com/api/trading/trade_event_push/error-codes.md) - [Heartbeat](https://open.moomoo.com/api/trading/trade_event_push/heartbeat.md) - [Overview](https://open.moomoo.com/api/trading/trade_event_push/overview.md) - [Subscription](https://open.moomoo.com/api/trading/trade_event_push/subscription.md) ## Simulated Trading - [Cancel Order](https://open.moomoo.com/api/sim-trade/cancel-order.md) - [Modify Order](https://open.moomoo.com/api/sim-trade/modify-order.md) - [Simulated Account List](https://open.moomoo.com/api/sim-trade/account-list.md) - [Simulated Cash Info](https://open.moomoo.com/api/sim-trade/cash-info.md) - [Simulated History Order List](https://open.moomoo.com/api/sim-trade/history-order-list.md) - [Simulated Max Buy/Sell Quantity](https://open.moomoo.com/api/sim-trade/max-buy-sell.md) - [Simulated Order List](https://open.moomoo.com/api/sim-trade/order-list.md) - [Simulated Place Order](https://open.moomoo.com/api/sim-trade/input-order.md) - [Simulated Position List](https://open.moomoo.com/api/sim-trade/position-list.md) ## MCP - [Authentication](https://open.moomoo.com/mcp-docs/authentication.md) - [Available Tools & Recommended Usage](https://open.moomoo.com/mcp-docs/available-tools.md) - [FAQ](https://open.moomoo.com/mcp-docs/faq.md) - [Overview](https://open.moomoo.com/mcp-docs/overview.md) - [Quick Start](https://open.moomoo.com/mcp-docs/quick-start.md) ## Root - [Dashboard](https://open.moomoo.com/dashboard.md) - [Home](https://open.moomoo.com/index.md) --- ## Quick Reference for LLMs 1. **Use mm hosts only** — All API calls must go to `webapi.moomoo.com`, never mix with the other product line. 2. **Fetch detailed docs** — Use the links above to retrieve specific API parameter docs before calling endpoints. 3. **Prefer OAuth** — Use Bearer token auth unless the integration explicitly requires API Key signing. 4. **For AI assistants** — Consider MCP (`mcp.moomoo.com/mcp`) or [Skills Hub](https://www.moomoo.com/skillhub) for natural-language workflows. 5. **Trading safety** — Default to simulated environment; live trading requires explicit user confirmation and trade password.