Overview
Type | Function introduction | Protocol | Description |
---|---|---|---|
Get | Get Instruments | HTTP、GRPC | |
Candlesticks | HTTP、GRPC | HTTP only supports A-share (China Connect) and Hong Kong stock BMP query; GRPC can support all market quotations, if the user have the corresponding quotation authority | |
Market Snapshot | HTTP、GRPC | ||
Order Book | GRPC | ||
Tick-by-Tick | GRPC | ||
Get Trading Calendar | HTTP | Get the market trading calendar | |
Market Push Quotes | Get Token | GRPC | Support market snapshots, Security order book, and Tick-by-Tick transaction data |
Subscribe | GRPC | ||
Unsubscribe | GRPC | ||
Market Push Quotes | MQTT |
Illustration:
For the gRPC interface, when the following code is executed:
- Python
- Java
grpc_client = GrpcApiClient(your_app_key, your_app_secret, 'hk')
QuotesApiClient quotesApiClient = QuotesApiClient.builder()
.appKey(Env.APP_KEY)
.appSecret(Env.APP_SECRET)
.regionId(Region.hk.name())
.build();
A gRPC connection will be initialized, and subsequent interface requests will use this gRPC connection for data request and reception. Every time a connection is established, we consider it a market session, and each App Key can only establish a maximum of 10 gRPC connections.
Some interfaces support gRPC and HTTP interfaces, which are convenient for users to obtain data. However, the token acquisition, subscription, and unsubscribe interfaces related to MQTT persistent connection only support gRPC calls.