This interface supports subscribing to the latest market depth (real-time tick-by-tick, Order Book) data for products, but does not support historical market depth or historical tick data.
Interface Features: For each WebSocket connection, sending this request will overwrite the previous subscription by default. For example, if you initially subscribed to products A, B, and C and want to add E, F, and G, you must resend A, B, C, E, F, and G. After successful subscription, data will be pushed.
Note:
1、After a successful subscription, avoid frequent requests. Send a heartbeat every 10 seconds; if no heartbeat is received in 30 seconds, the WebSocket will disconnect.
2、Implement automatic reconnection logic to handle network disconnections.
3、Maximum market depth limits for each product:
3.1 Inactive products may have less depth than listed.
3.2 One side of the depth may be empty, such as during limit up or down for stocks.
After a successful connection, you can subscribe to specific stock market data as needed. Please refer to the documentation below for detailed calling methods.
2、Request Example for Forex, Precious Metals, Cryptocurrencies, and Commodities:
Each time you establish a connection, you must append your authentication token to the URL as follows:
After a successful connection, you can subscribe to specific forex, cryptocurrency, precious metals, and commodities data as needed. Please refer to the documentation below for detailed calling methods.
Request - Protocol Number:22002
Json definition
Field
Name
Type
Required
Description
cmd_id
protocol number
integer
Yes
The protocol number for the order book data request is fixed: 22002
seq_id
response id
integer
Yes
Subscription request identifier, which will be returned in the response. (Customizable and can be repeated for each request)
trace
traceable id
string
Yes
Traceable ID for request log information (Customizable, and it should not be repeated for each request)
symbol_list
Product List
array
Yes
See the symbol definition below for the specific format.
If there is no depth_level field, the background will only provide a quote for one layer, and the requested level is greater than the actual quote level, or if there is no depth_level field, the background will provide as many layers as there are actual quotes.