Trade

Stock Positions

GEThttps://openapi.longbridge.com/v1/asset/stock

Authorization

Signed mode: every request is signed with your App Key/Secret. Header set:

NameTypeRequiredDescription
Authorizationstring · headerRequiredThe account Access Token from the OpenAPI dashboard — passed as the raw token (no Bearer prefix) and included in the signature calculation.
X-Api-Keystring · headerRequiredYour App Key.
X-Timestampstring · headerRequiredRequest timestamp in seconds (Unix epoch).
X-Api-Signaturestring · headerRequiredHMAC-SHA256 signature. Format: HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=.

The API is used to obtain stock position information including account, stock code, number of shares held, number of available shares, average position price (calculated according to account settings), and currency.

>_ CLI
longbridge positions

Request

Query parameters

NameTypeRequiredDescription
symbolarrayOptionalStock code, use `ticker.region` format, E.g:`AAPL.US`

Response

Response properties

NameTypeRequiredDescription
listobject[]OptionalStock holding information
└ account_channelstringOptionalAccount type
└ stock_infoobject[]OptionalStock list
└ ∟ symbolstringOptionalStock code
└ ∟ symbol_namestringOptionalStock name
└ ∟ currencystringOptionalCurrency
└ ∟ quantitystringOptionalThe number of holdings
└ ∟ available_quantitystringOptionalAvailable quantity
└ ∟ cost_pricestringOptionalCost Price(According to the client's choice of average purchase or diluted cost)
└ ∟ marketstringOptionalmarket
└ ∟ init_quantitystringOptionalInitial position before market opening

Response JSON example

{
  "code": 0,
  "data": {
    "list": [
      {
        "account_channel": "lb",
        "stock_info": [
          {
            "symbol": "700.HK",
            "symbol_name": "TENCENT",
            "currency": "HKD",
            "quantity": "650",
            "market": "HK",
            "available_quantity": "-450",
            "cost_price": "457.53",
            "init_quantity": "214"
          },
          {
            "symbol": "9991.HK",
            "symbol_name": "BAOZUN-SW",
            "currency": "HKD",
            "market": "HK",
            "quantity": "200",
            "available_quantity": "0",
            "cost_price": "32.25",
            "init_quantity": "214"
          },
          {
            "symbol": "TCEHY.US",
            "symbol_name": "Tencent (ADR)",
            "currency": "USD",
            "market": "US",
            "quantity": "10",
            "available_quantity": "10",
            "init_quantity": "18"
          },
          {
            "symbol": "2628.HK",
            "symbol_name": "CHINA LIFE",
            "currency": "HKD",
            "market": "HK",
            "quantity": "9000",
            "available_quantity": "0",
            "init_quantity": "8000"
          },
          {
            "symbol": "5.HK",
            "symbol_name": "HSBC HOLDINGS",
            "currency": "HKD",
            "market": "HK",
            "quantity": "2400",
            "available_quantity": "2000",
            "init_quantity": "2000"
          },
          {
            "symbol": "BABA.US",
            "symbol_name": "Alibaba",
            "currency": "USD",
            "market": "US",
            "quantity": "2000209",
            "available_quantity": "2000209",
            "init_quantity": "214"
          },
          {
            "symbol": "2.HK",
            "symbol_name": "CLP HOLDINGS",
            "currency": "HKD",
            "market": "HK",
            "quantity": "2000",
            "available_quantity": "2000",
            "init_quantity": "2000"
          },
          {
            "symbol": "NOK.US",
            "symbol_name": "Nokia",
            "currency": "USD",
            "market": "US",
            "quantity": "1",
            "available_quantity": "0",
            "init_quantity": "1"
          }
        ]
      }
    ]
  }
}

Error code

See the Error Codes page for the full list of error codes.