Unsubscribe
Interface Description
caution
The unsubscribe interface can only be used after establishing a long MQTT link. persistent connection building can refer to Market Push Quotes.
Function description:
Real-time quotes unsubscribe interface is subscribed to real-time quotes pushes according to symbol and data type.
When unsubscribing from the interface, you get no result returned if it succeeds, and Error is returned if it fails.
Request URL: /market-data/streaming/unsubscribe
Request method: Establish a gRPC through the Webull SDK to establish a persistent connection, and then call the interface to obtain it.
Frequency limit: The calling frequency of each AppId is limited to 10 times per minute.
Request Parameters
Parameter | Type | Required fields | Description |
---|---|---|---|
token | String | Yes | Subscribe to the token returned by the pre-request, and the token needs to be a token that has already created a connection |
symbols | []String | No | Such as: [00700,00981], supports up to 50 symbols at a time |
category | String | No | Security type, enumeration, reference: Category, required when unsubscribe_all is empty or not true |
sub_types | String | No | Unsubscribe data type, such as: [SNAPSHOT]、SubType Required when unsubscribe_all is empty or not true |
unsubscribe_all | Boolean | No | boolean false (true means canceling all real-time market subscriptions. When unsubscribe_all is true, symbols, category, sub_types can be empty) |
Request Example
- Python
- Java
from webullsdktrade.grpc_api import API
from webullsdkquotescore.grpc.grpc_client import GrpcApiClient
from webullsdkcore.common.region import Region
grpc_client = GrpcApiClient(your_app_key, your_app_secret, Region.HK.value)
api = API(grpc_client)
response = api.market_data.remove_subscription_rel(token, symbols, category, sub_types)
if response.status_code == 200:
print('unsubscribe successful')
try (QuotesApiClient quotesApiClient = QuotesApiClient.builder()
.appKey(Env.APP_KEY)
.appSecret(Env.APP_SECRET)
.regionId(Region.hk.name())
.build()) {
quotesApiClient.unsubscribe(token, symbols, category, subTypes);
}
Response Example
No return value