Quick answer
moomoo (and Futubull in Hong Kong) offers the Futu OpenAPI: your program talks to OpenD, a gateway you run locally and log in to, over a TCP Protobuf protocol wrapped by official Python, Java, C#, C++ and JavaScript SDKs. It covers US, Hong Kong and China A-share stocks plus options and futures, with simulated (paper) accounts through the same gateway.
moomoo (Futu OpenAPI) at a glance
- Pricing
- API free; quote levels depend on account and subscriptions
- Availability
- US, Hong Kong, Singapore, Australia, Canada, Japan, Malaysia
- Paper trading
- Paper trading (simulated) accounts through the same OpenD
- Integration type
- Local gateway
- In AlgoGP
- Design and backtest in AlgoGP, connect the exported code
- Gateway
- OpenD (GUI or command line), default port 11111
- SDKs
- Python
moomoo-api/futu-api, Java, C#, C++, JS - Markets
- US, HK, China A-shares (Connect), SG, JP
- Trading
unlock_tradewith the trade password first
A first connection
from moomoo import OpenQuoteContext, OpenSecTradeContext, TrdEnv, TrdSide, OrderType
quote = OpenQuoteContext(host="127.0.0.1", port=11111)
print(quote.request_history_kline("US.AAPL", ktype="K_DAY", max_count=5)[1])
trade = OpenSecTradeContext(host="127.0.0.1", port=11111)
print(trade.place_order(price=0, qty=1, code="US.AAPL", trd_side=TrdSide.BUY,
order_type=OrderType.MARKET, trd_env=TrdEnv.SIMULATE))
quote.close(); trade.close()Build a moomoo (Futu OpenAPI) strategy with AlgoGP
AlgoGP does not connect to moomoo (Futu OpenAPI) natively yet. moomoo (Futu OpenAPI) connects through a local gateway, socket, FIX or Protobuf stack rather than plain HTTPS, so it runs as a separate process next to your strategy.
- 1
Design and backtest in AlgoGP
Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.
- 2
Export the Python project
Every project exports
strategy.py,market_data.py,brokers.pyandlive.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format. - 3
Plug in moomoo (Futu OpenAPI)
Implement the four adapter methods (
account,positions,submit_market_orderand a candle fetcher) with moomoo (Futu OpenAPI)’s SDK, or keep a built-in platform for paper trading and add moomoo (Futu OpenAPI) when you go live.
Built-in brokers for the same markets: Alpaca, Tradier, Interactive Brokers, OKX.
moomoo (Futu OpenAPI): frequently asked questions
Is the moomoo API free?
Yes. Quote depth and markets depend on your account level and quote subscriptions.
Do I have to run OpenD?
Yes. Every SDK connects to a logged-in OpenD, locally or on your server.
What is the difference between futu-api and moomoo-api?
Same API, different branding: futu-api for Futubull accounts, moomoo-api for moomoo.
Design and backtest your moomoo (Futu OpenAPI) strategy first
AlgoGP turns an idea into Python and tests it on years of history before you connect it to moomoo (Futu OpenAPI). The exported code keeps the broker behind four small adapter methods.
- AI copilot writes and revises the rules
- Backtests with realistic costs
- Exported Python ready to wire to moomoo (Futu OpenAPI)
Free plan, no card required.
moomoo (Futu OpenAPI) alternatives
- Interactive Brokers API Built into AlgoGPThe broadest multi-asset broker API: stocks, options, futures, FX and bonds on 150+ markets, through TWS or IB Gateway.
- Tiger Brokers API GuideTiger Open API: stocks, options and futures on US, Hong Kong, Singapore and Australian markets, with RSA-signed requests.
- Webull API GuideWebull OpenAPI: official trading and market-data API for US stocks, options and more, signed with an App Key and App Secret.
- Alpaca API Built into AlgoGPCommission-free API-first broker for US stocks, ETFs and crypto, with a free paper-trading account.
Independent guide. AlgoGP is not affiliated with moomoo (Futu OpenAPI). Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.