# OpenAPI Introduction
# Overview
OpenAPI provides wide varieties of market data and trading services for your programmed trading to meet the needs of every developer's programmed trading and help your Quant dreams.
Moomoo users can click here to learn more.
OpenAPI consists of OpenD and moomoo API:
- OpenD is the gateway program of moomoo API, running on your local computer or cloud server. It is responsible for transferring the protocol requests to moomoo servers, and returning the processed data.
- moomoo API is an API SDK encapsulated by moomoo, including mainstream programming languages (Python, Java, C#, C++, JavaScript), to reduce the difficulty of your trading strategy development. If the language you want to use is not listed above, you can still interface with the protocol yourself to complete the trading strategy development.
Diagrams below illustrate the architecture of OpenAPI.
The first time using OpenAPI, you need to finish the following two steps:
The first step is to install and start a gateway program OpenD locally or in the cloud.
OpenD exposes the interfaces in the way of TCP, which is responsible for transferring the protocol requests to moomoo servers and returning the processed data. The protocol interface has nothing to do with the type of programming language.
The second step is to download moomoo API and complete Environment Setup.
For your convenience, moomoo encapsulates API SDK for mainstream programming languages (hereinafter referred to as moomoo API).
# Account
OpenAPI involves two types of accounts, moomoo ID and universal account.
# moomoo ID
moomoo ID is your user account (moomoo ID), which can be used in moomoo APP and OpenAPI.
You can use your moomoo ID and login password to log in to OpenD and obtain market data.
# Universal Account
Universal account allows trading across multiple markets (including Hong Kong stocks, US stocks, A-shares, and funds) in various currencies. There's no need for multiple accounts.
Universal Accounts come in two forms:
- Securities Universal Account: Trade stocks, ETFs, options, and other securities across different markets.
- Futures Universal Account: Trade futures, including Hong Kong, US CME Group, Singapore, and Japanese futures.
# Functionality
There are 2 functions of OpenAPI: quotation and trading.
# Quotation Functions
# Quotation Data Categories
Including stocks, indices, options and futures from HK, US and A-share market. Find the specific types of support in the table below. You need authorities for each kinds of market data. For more details on how to obtain authorities, please click here.
Market | Contract | Moomoo Users |
---|---|---|
HK Market | Stocks, ETFs, Warrants, CBBCs, Inline Warrants | ✓ |
Options | ✓ | |
Futures | ✓ | |
Indices | ✓ | |
Plates | ✓ | |
US Market | Stocks, ETFs | ✓ |
OTC Securities | X | |
Options | ✓ | |
Futures | ✓ | |
Indices | X | |
Plates | ✓ | |
A-share Market | Stocks, ETFs | ✓ |
Indices | ✓ | |
Plates | ✓ | |
Singapore Market | Stocks, ETFs, Warrants, REITs, DLCs | X |
Futures | X | |
Japanese Market | Stocks, ETFs, REITs | X |
Futures | X | |
Australian Market | Stocks, ETFs | X |
Global Markets | Forex | X |
# Method to Obtain Market Data
- Subscribe and receive pushed real-time quote, candlestick, tick-by-tick and order book.
- Request for the latest market snapshot, historical candlesticks etc.
# Trading Functions
# Trading Capacity
Including stocks, options and futures from HK, US, A-share, Singapore and Japanese markets. Find the specific types of support in the table below:
Market | Contracts | Paper Trading | Live Trading | ||||||
---|---|---|---|---|---|---|---|---|---|
FUTU HK | Moomoo US | Moomoo SG | Moomoo AU | Moomoo MY | Moomoo CA | Moomoo JP | |||
HK Market | Stocks, ETFs, Warrants, CBBCs, Inline Warrants | ✓ | ✓ | ✓ | ✓ | ✓ | X | X | X |
Options | ✓ | ✓ | X | X | X | X | X | X | |
Futures | ✓ | ✓ | X | X | X | X | X | X | |
US Market | Stocks, ETFs | ✓ | ✓ | ✓ | ✓ | ✓ | X | X | X |
Options | ✓ | ✓ | ✓ | ✓ | ✓ | X | X | X | |
Futures | ✓ | ✓ | X | ✓ | X | X | X | X | |
A-share Market | China Connect Securities stocks | ✓ | ✓ | ✓ | ✓ | X | X | X | X |
Non-China Connect Securities stocks | ✓ | X | X | X | X | X | X | X | |
Singapore Market | Stocks, ETFs, Warrants, REITs, DLCs | X | X | X | X | X | X | X | X |
Futures | ✓ | ✓ | X | ✓ | X | X | X | X | |
Japanese Market | Stocks, ETFs, REITs | X | X | X | X | X | X | X | X |
Futures | ✓ | ✓ | X | X | X | X | X | X | |
Australian Market | Stocks, ETFs | X | X | X | X | X | X | X | X |
# Method of Trading
The trading interfaces are used for both live trading and paper trading.
# Features
- Full platform and multi-language
- OpenD supports Windows, MacOS, CentOS, Ubuntu
- moomoo API supports Python, Java, C#, C++, JavaScript, etc.
- Stable speed and free
- Stable technical architecture, directly connected to the exchanges
- The fastest order is 0.0014s
- There is no additional charge for trading via OpenAPI
- Abundant investment varieties
- Supporting real-time market data, live trading, and simulated trading in multiple markets including United States, Hong Kong, etc.
- Professional institutional services
- Customized market data and trading solutions