Skip to main content

Request a Quote

HTTP Request

POST /v5/asset/exchange/quote-apply

Request Parameters

ParameterRequiredTypeComments
accountTypetruestringWallet type
fromCointruestringConvert from coin (coin to sell)
toCointruestringConvert to coin (coin to buy)
requestCointruestringRequest coin, same as fromCoin
  • In the future, we may support requestCoin=toCoin
requestAmounttruestringrequest coin amount (the amount you want to sell)
fromCoinTypefalsestringcrypto
toCoinTypefalsestringcrypto
paramTypefalsestringopFrom, mainly used for API broker user
paramValuefalsestringBroker ID, mainly used for API broker user
requestIdfalsestringCustomised request ID
  • a maximum length of 36
  • Generally it is useless, but it is convenient to track the quote request internally if you fill this field

Response Parameters

ParameterTypeComments
quoteTxIdstringQuote transaction ID. It is system generated, and it is used to confirm quote and query the result of transaction
exchangeRatestringExchange rate
fromCoinstringFrom coin
fromCoinTypestringFrom coin type. crypto
toCoinstringTo coin
toCoinTypestringTo coin type. crypto
fromAmountstringFrom coin amount (amount to sell)
toAmountstringTo coin amount (amount to buy according to exchange rate)
expiredTimestringThe expiry time for this quote (15 seconds)
requestIdstringCustomised request ID
extTaxAndFeearrayCompliance-related field. Currently returns an empty array, which may be used in the future

Request Example

POST /v5/asset/exchange/quote-apply HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1720071077014
X-BAPI-RECV-WINDOW: 5000
X-BAPI-SIGN: XXXXXX
Content-Type: application/json
Content-Length: 172

{
"requestId": "test-00002",
"fromCoin": "ETH",
"toCoin": "BTC",
"accountType": "eb_convert_funding",
"requestCoin": "ETH",
"requestAmount": "0.1",
"paramType": "opFrom",
"paramValue": "broker-id-001"
}

Response Example

{
"retCode": 0,
"retMsg": "ok",
"result": {
"quoteTxId": "10100108106409340067234418688",
"exchangeRate": "0.053517914861880000",
"fromCoin": "ETH",
"fromCoinType": "crypto",
"toCoin": "BTC",
"toCoinType": "crypto",
"fromAmount": "0.1",
"toAmount": "0.005351791486188000",
"expiredTime": "1720071092225",
"requestId": "test-00002",
"extTaxAndFee":[]
},
"retExtInfo": {},
"time": 1720071077265
}