Overview
LongPort Developers provides programmatic interfaces for investors with research and development capabilities, enabling them to build trading or market analysis tools based on their own investment strategies. The platform covers the following categories:
- Quote — Real-time and historical quotes, market depth, candlesticks, options/warrants data, subscriptions
- Fundamental — Company profiles, financials, valuations, analyst ratings, market data, calendars
- News & Contents — Market news, community topics, sharelist management
- Trade — Create, amend, and cancel orders; query orders, executions, and assets
- Account — Portfolio analysis, price alerts, DCA plans, watchlist
- MCP — Model Context Protocol integration for AI assistant workflows
Interface Type
LongPort provides diversified access methods such as HTTP / WebSockets interfaces for accessing the underlying services and SDK (Python / C++, etc.) encapsulated in the upper layer, allowing flexible choices.
How to Enable OpenAPI
Log in to the LongPort App to complete the account opening process;
Log in to the longport.com and enter the developer platform, complete the developer verification (OpenAPI permission application), and obtain a token.
Quote Coverage
| Market | Symbol |
|---|---|
| HK Market | Securities (including equities, ETFs, Warrants, CBBCs) |
| Hang Seng Index | |
| US Market | Securities (including stocks, ETFs) |
| Nasdsaq Index | |
| OPRA Options | |
| CN Market | Securities (including stocks, ETFs) |
| Index |
Trading
Supported trading functions include:
| Market | Stock and ETF | Warrant & CBBC | Options |
|---|---|---|---|
| HK Market | ✓ | ✓ | |
| US Market | ✓ | ✓ | ✓ |
Rate Limit
| Category | Limitation |
|---|---|
| Quote API |
|
| Trade API |
|
The OpenAPI SDK has done effective frequency control internally:
- Quote: The methods under
QuoteContextwill be actively controlled by the SDK according to the server's rate limit. When the request is too fast, the SDK will automatically delay the request. Therefore, you do not need to implement the frequency control details separately. - Trade: The methods under
TradeContextare not limited by the SDK. Due to the special nature of the trading order placement scenario, this is left to the user to handle.
Pricing
LongPort does not charge any additional fees for activating or using interface services. You only need to open a LongPort Integrated A/C and get OpenAPI service permissions to use it for free. For quote data subscription fees, please enter "Me - My Quotes - Quote Store" in the "LongPort" mobile app. For actual transaction fees, please contact the brokerage firm where you have opened your securities account.
Other
The OpenAPI services are provided by LongPort and the applicable affiliates (subject to the agreement). openapi-trade.longportapp.com