Skip to main content

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

ParameterTypeRequired fieldsDescription
tokenStringYesSubscribe to the token returned by the pre-request, and the token needs to be a token that has already created a connection
symbols[]StringNoSuch as: [00700,00981], supports up to 50 symbols at a time
categoryStringNoSecurity type, enumeration, reference: Category, required when unsubscribe_all is empty or not true
sub_typesStringNoUnsubscribe data type, such as: [SNAPSHOT]SubType Required when unsubscribe_all is empty or not true
unsubscribe_allBooleanNoboolean
false (true means canceling all real-time market subscriptions. When unsubscribe_all is true, symbols, category, sub_types can be empty)

Request Example

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')

Response Example

No return value