Skip to Content

Security Brokers

This API is used to obtain the real-time broker queue data of security.

ℹ️Info

Request

Parameters

NameTypeRequiredDescription
symbolstringYesSecurity code, in ticker.region format, for example: 700.HK

Protobuf

protobuf
message SecurityRequest {
  string symbol = 1;
}

Request Example

python
# 获取标的经纪队列
# https://open.longportapp.com/docs/quote/pull/brokers
# Before running, please visit the "Developers to ensure that the account has the correct quotes authority.
# If you do not have the quotes authority, you can enter "Me - My Quotes - Store" to purchase the authority through the "LongPort" mobile app.
from longport.openapi import QuoteContext, Config

config = Config.from_env()
ctx = QuoteContext(config)

resp = ctx.brokers("700.HK")
print(resp)

Response

Response Properties

NameTypeDescription
symbolstringSecurity code
ask_brokersobject[]Ask brokers
∟ positionint32Position
∟ broker_idsint32[]Broker IDs, obtained through theGet Broker IDs API
bid_brokersobject[]Bid brokers
∟ positionint32Postition
∟ broker_idsint32[]Broker IDs, obtained through theGet Broker IDs API

Protobuf

protobuf
message SecurityBrokersResponse {
  string symbol = 1;
  repeated Brokers ask_brokers = 2;
  repeated Brokers bid_brokers = 3;
}

message Brokers {
  int32 position = 1;
  repeated int32 broker_ids = 2;
}

Response JSON Example

json
{
  "symbol": "700.HK",
  "ask_brokers": [
    {
      "position": 1,
      "broker_ids": [7358, 9057, 9028, 7364]
    },
    {
      "position": 2,
      "broker_ids": [6968, 3448, 3348, 1049, 4973, 6997, 3448, 5465, 6997]
    }
  ],
  "bid_brokers": [
    {
      "position": 1,
      "broker_ids": [6996, 5465, 8026, 8304, 4978]
    },
    {
      "position": 2
    }
  ]
}

Error Code

Protocol Error CodeBusiness Error CodeDescriptionTroubleshooting Suggestions
3301600Invalid requestInvalid request parameters or unpacking request failed
3301606Request rate limitReduce the frequency of requests
7301602Server errorPlease try again or contact a technician to resolve the issue
7301600Symbol not foundCheck that the requested symbol is correct
7301603No quotesSecurity no quote
7301604No accessNo access to security quote