Skip to main content

Get Token

Interface Description

  • Function description:

    • Obtain the token required by the market subscription interface, Subscribe and UnSubscribe require the token. Request the token before initiating the establishment of a persistent connection.
  • Request URL: /market-data/streaming/token

  • 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

No parameters

Response Example

FieldTypeDescription
tokenStringtoken

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.get_token()
if response.status_code == 200:
token = response.json()

Response Example

{
"token": "2d29ea02-8a35-11ec-8356-020017000b7b"
}