Account

Exchange Rates

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

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=.

Get current foreign exchange rates for all currency pairs used in your account.

>_ CLI
longbridge exchange-rate

Request

Query parameters

NameTypeRequiredDescription
basestringOptionalBase currency, e.g. `USD`. Omit for all pairs.

Response

Response properties

NameTypeRequiredDescription
exchangesobject[]OptionalList of exchange rates
└ base_currencystringOptionalBase currency
└ other_currencystringOptionalQuote currency
└ bid_ratenumberOptionalBid rate
└ offer_ratenumberOptionalOffer rate
└ average_ratenumberOptionalAverage exchange rate: the value of 1 `other_currency` in `base_currency`. For example, `base_currency=USD`, `other_currency=HKD`, `average_rate=0.12746` means 1 HKD = 0.12746 USD

Response JSON example

{
  "code": 0,
  "message": "success",
  "data": {
    "exchanges": [
      {
        "base_currency": "USD",
        "other_currency": "HKD",
        "bid_rate": 0.12746,
        "offer_rate": 0.12746,
        "average_rate": 0.12746
      }
    ]
  }
}

Error code

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