How to get a moomoo (Futu OpenAPI) API key

There is no API key: OpenD holds your login, and your code connects to OpenD.

About 15 minutes 4 steps Checked November 2026

Before you start

  • A moomoo or Futubull account
  • Windows, macOS or Linux machine for OpenD

Create your moomoo (Futu OpenAPI) API key

  1. 1

    Download OpenD

    Get OpenD from moomoo.com/download/OpenAPI and install it.

  2. 2

    Log in and accept terms

    Log in with your moomoo id and accept the API questionnaire and agreement.

  3. 3

    Note host and port

    Keep the default 127.0.0.1:11111 or change it in OpenD settings.

  4. 4

    Store the trade password

    Save MOOMOO_TRADE_PASSWORD (and MOOMOO_OPEND_HOST / MOOMOO_OPEND_PORT if not default).

Test the key

Before wiring the key into a strategy, make one request by hand. It separates “the key is wrong” from “my code is wrong”.

from moomoo import OpenQuoteContext
ctx = OpenQuoteContext(host="127.0.0.1", port=11111)
print(ctx.get_global_state())
ctx.close()
A state dict with qot_logined: True means OpenD is connected.

Keep the credentials safe

  • Store values in a password manager or a git-ignored .env, never in code or notebooks you share.
  • In an AlgoGP project you can still add them under APIs & keys (encrypted at rest) and read them with strategy_runtime.secrets.get("MOOMOO_TRADE_PASSWORD").
  • Give each bot its own credential so you can revoke one without stopping the others.
MOOMOO_TRADE_PASSWORD=paste-your-value-here
# MOOMOO_OPEND_HOST=
# MOOMOO_OPEND_PORT=
.env for local runs

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.

How the moomoo (Futu OpenAPI) works

AlgoGP is not affiliated with moomoo (Futu OpenAPI). Menus get renamed from time to time; if a label differs, the official documentation has the current path.