Overview
The Market Data API provides access to market data via both HTTP and WebSocket/TCP protocols. Our focus is on historical and real-time data, enabling developers to efficiently integrate these APIs into their applications.
The Market Data API is divided into the Data API and the Data Streaming API. The Data API uses the HTTP protocol and is mainly for developers to pull historical and latest market data. The Data Streaming API uses MQTT protocol based on WebSocket/TCP for pushing real-time market data.
To simplify integration, we provide SDKs in Python. These SDKs offer comprehensive encapsulation of authentication interfaces, allowing developers to get started quickly. For details on how to install the SDK, please refer to the SDKs and Tools.
Market API Overview
| Type | Function | Protocol | Description | Threshold |
|---|---|---|---|---|
| Stock Quotes | Tick | HTTP | Interface for retrieving tick-by-tick transaction data of securities. Returns detailed tick-by-tick transaction records for specified securities within a specified time range | 300/60s |
| Snapshot | HTTP | Real-time market snapshot data interface for securities, supporting queries for multiple security types such as US stocks, Hong Kong stocks, etc. | ||
| Quotes | HTTP | Interface for retrieving the latest order book data of securities. Returns order book information at specified depth, including price, quantity, order details, etc. | ||
| Historical Bars (single symbol) | HTTP | Supports historical candlestick bars data at various granularities such as M1, M5, etc.; currently, daily candlestick bars and above only provide forward-adjusted candlestick bars data, while minute candlestick bars data only provides non-adjusted candlestick bars data | ||
| Historical Bars | HTTP | candlestick bars batch query supports historical candlestick bars data at various granularities such as M1, M5, etc.; currently, daily candlestick bars and above only provide forward-adjusted candlestick bars data, while minute candlestick bars data only provides non-adjusted candlestick bars data | ||
| Futures Quotes | Tick | HTTP | Returns time, price, volume, and direction of individual trades for a futures contract within a specified time range, sorted latest-first | |
| Snapshot | HTTP | Returns real-time key indicators (e.g., latest price, change, volume, turnover rate) for a futures contract | ||
| Quotes | HTTP | Fetch the latest bid/ask data for a futures contract at a specified depth, including price and quantity | ||
| Historical Bars | HTTP | Batch query for recent N bars of futures data by symbol, granularity (e.g., M1, M5), and type. | ||
| Crypto Quotes | Snapshot | HTTP | Fetch real-time market snapshots for up to 20 crypto symbols, including latest price, change, % change, bid/ask quotes, and other key metrics | |
| Historical Bars | HTTP | Fetch historical candlestick data for a crypto symbol across intervals (M1, M5, H1, D, etc.). Daily+ bars are forward-adjusted; minute bars are unadjusted. Returns 1–1200 most recent bars | ||
| Streaming | Subscribe | HTTP | Market data subscription interface. After the market data push MQTT connection is successfully established, call this interface to subscribe to real-time market data push notifications | / |
| Unsubscribe | HTTP | Unsubscribe interface. After the market data push MQTT connection is successfully established, call this interface to unsubscribe from real-time market data push notifications |
Usage Fees
Market Data:
| Market | Category | Permission Acquisition |
|---|---|---|
| US Market | Securities Products (Stocks, ETFs, Night Session) | To obtain permission to access U.S. stock market data, please purchase Level 1 and Level 2 market data for U.S. stock.
Note:Subscriptions in QT or the mobile app are independent of OpenAPI. You need a separate data subscription specifically enabled for OpenAPI usage. Only one device may access LV1 and LV2 at any one time. |
| US Market | Futures | Not supported yet. Coming soon. |
| US Market | Crypto |