You need one credential issued for your broker:
| Credential | Header | Description |
|---|---|---|
ACCESS_TOKEN |
Authorization: Bearer <token> |
Broker-scoped access token issued by Longport Whale |
The example below queries the account_cash_balances dataset (POST /v1/datasets/account_cash_balances):
curl --request POST \
--url https://b-api.longbridge.xyz/v1/datasets/account_cash_balances \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Content-Type: application/json; charset=utf-8" \
--data '{"filters": {}, "page": 1, "page_size": 20}'import requests
ACCESS_TOKEN = "${access_token}"
host = "https://b-api.longbridge.xyz" # production: https://b-api.lbkrs.com
uri = "/v1/datasets/account_cash_balances"
resp = requests.post(
url=host + uri,
headers={
"Authorization": f"Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json; charset=utf-8",
},
json={"filters": {}, "page": 1, "page_size": 20},
)
print(resp.json())Tip
Switch between Test and Production environments by changing the host — use https://b-api.longbridge.xyz for testing without affecting live data.
Head to the Broker API reference to browse all endpoints with an interactive playground.