Documentation Index Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/bitmart-api/llms.txt
Use this file to discover all available pages before exploring further.
The BitMart account endpoints let you inspect wallet balances, retrieve deposit addresses, submit withdrawals, manage margin accounts, and query fee rates. All account endpoints require a valid API key, secret, and memo — initialize the RestClient with your credentials before calling any method on this page.
Setup
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: 'YOUR_API_KEY' ,
apiSecret: 'YOUR_API_SECRET' ,
apiMemo: 'YOUR_API_MEMO' ,
});
All methods on this page call authenticated endpoints. Requests without valid credentials will be rejected with a 401 error.
Wallet Balances
getAccountBalancesV1(params?)
Returns balances for all assets in your funding (main) account. Optionally filter to a single currency.
getAccountBalancesV1 ( params ?: {
currency? : string ;
}): Promise < APIResponse < { wallet : AccountCurrencyBalanceV1 [] } >>
Optional. Filter results to a single currency, e.g. "USDT".
Response — AccountCurrencyBalanceV1 fields:
Field Type Description currencystringAsset symbol namestringAsset full name availablestringAvailable (tradeable) balance frozenstringFrozen (in-order) balance
Get All Funding Balances
Get Single Currency Balance
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const response = await client . getAccountBalancesV1 ();
for ( const asset of response . data . wallet ) {
if ( parseFloat ( asset . available ) > 0 ) {
console . log ( ` ${ asset . currency } : available= ${ asset . available } , frozen= ${ asset . frozen } ` );
}
}
getAccountCurrenciesV1(params?)
Returns metadata for available currencies including network, contract address, and withdrawal limits. This endpoint does not require authentication.
getAccountCurrenciesV1 ( params ?: {
currencies? : string ;
}): Promise < APIResponse < { currencies : AccountCurrencyV1 [] } >>
Optional. Comma-separated list of currency symbols to filter, e.g. "BTC,ETH,USDT".
Response — AccountCurrencyV1 fields:
Field Type Description currencystringCurrency symbol namestringFull name networkstringBlockchain network contract_addressstring | nullToken contract address withdraw_enabledbooleanIs withdrawal enabled deposit_enabledbooleanIs deposit enabled withdraw_minsizestring | nullMinimum withdrawal size withdraw_minfeestring | nullMinimum withdrawal fee withdraw_feestring | nullWithdrawal fee amount withdraw_maxsizestring | nullMaximum withdrawal size
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ();
const response = await client . getAccountCurrenciesV1 ({
currencies: 'BTC,ETH,USDT' ,
});
for ( const c of response . data . currencies ) {
console . log ( ` ${ c . currency } ( ${ c . network } ): withdraw fee= ${ c . withdraw_fee } ` );
}
getSpotWalletBalanceV1()
Returns balances for all assets in your spot trading wallet. This is separate from the funding account.
getSpotWalletBalanceV1 (): Promise < APIResponse < { wallet : SpotWalletBalanceV1 [] } >>
Response — SpotWalletBalanceV1 fields:
Field Type Description idstringCurrency symbol namestringCurrency full name availablestringAvailable balance frozenstringFrozen (in-order) balance
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const response = await client . getSpotWalletBalanceV1 ();
const nonZero = response . data . wallet . filter (
( w ) => parseFloat ( w . available ) > 0 || parseFloat ( w . frozen ) > 0 ,
);
console . log ( 'Non-zero spot balances:' , nonZero );
Deposits
getAccountDepositAddressV1(params)
Returns the deposit address (and optional memo/tag) for a specific currency.
getAccountDepositAddressV1 ( params : {
currency: string ;
}): Promise < APIResponse < AccountDepositAddressV1 >>
Currency symbol to get deposit address for, e.g. "BTC".
Response — AccountDepositAddressV1 fields:
Field Type Description currencystringCurrency symbol chainstringBlockchain network name addressstringDeposit wallet address address_memostringMemo / tag (if required by chain)
Some networks (e.g. XRP, EOS, ATOM) require both address and address_memo to correctly route your deposit. Always check address_memo before sending.
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const response = await client . getAccountDepositAddressV1 ({ currency: 'USDT' });
const { address , address_memo , chain } = response . data ;
console . log ( `USDT deposit address ( ${ chain } ): ${ address } ` );
if ( address_memo ) {
console . log ( `Memo required: ${ address_memo } ` );
}
Withdrawals
getAccountWithdrawQuotaV1(params)
Returns withdrawal quota and fee information for a given currency.
getAccountWithdrawQuotaV1 ( params : {
currency: string ;
}): Promise < APIResponse < AccountWithdrawQuotaV1 >>
Currency to query, e.g. "ETH".
Response — AccountWithdrawQuotaV1 fields:
Field Type Description today_available_withdraw_BTCstringRemaining daily withdraw quota in BTC min_withdrawstringMinimum withdrawal amount withdraw_precisionnumberDecimal precision for withdrawal amounts withdraw_feestringFixed withdrawal fee
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const response = await client . getAccountWithdrawQuotaV1 ({ currency: 'ETH' });
const quota = response . data ;
console . log ( `Min withdrawal: ${ quota . min_withdraw } ETH` );
console . log ( `Fee: ${ quota . withdraw_fee } ETH` );
console . log ( `Today's remaining BTC-equivalent quota: ${ quota . today_available_withdraw_BTC } ` );
submitWithdrawalV1(params)
Submits a withdrawal request to an external address.
submitWithdrawalV1 ( params : SubmitWithdrawalV1Request ): Promise < APIResponse < { withdrawal_id : string } >>
Currency to withdraw, e.g. "USDT".
Withdrawal amount as a string.
Must be the literal string "To Digital Address".
Destination wallet address.
Optional memo / tag for networks that require it.
Withdrawal requests are irreversible. Double-check address and address_memo before calling this method. Sending to the wrong address will result in permanent loss of funds.
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const response = await client . submitWithdrawalV1 ({
currency: 'USDT' ,
amount: '100' ,
destination: 'To Digital Address' ,
address: '0xYourEthereumWalletAddress' ,
});
console . log ( 'Withdrawal submitted. ID:' , response . data . withdrawal_id );
getWithdrawAddressList()
Returns the list of saved/whitelisted withdrawal addresses associated with your account.
getWithdrawAddressList (): Promise < APIResponse < { list : WithdrawAddressListItem [] } >>
Response — WithdrawAddressListItem fields:
Field Type Description currencystringCurrency symbol networkstringBlockchain network addressstringWallet address memostringMemo / tag remarkstringUser-defined label addressTypenumberAddress type flag verifyStatusnumberVerification status
Get Saved Withdraw Addresses
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const response = await client . getWithdrawAddressList ();
for ( const addr of response . data . list ) {
console . log ( ` ${ addr . currency } ( ${ addr . network } ): ${ addr . address } — ${ addr . remark } ` );
}
Transaction History
getDepositWithdrawHistoryV2(params?)
Returns a paginated history of deposit and withdrawal transactions.
getDepositWithdrawHistoryV2 ( params ?: DepositWithdrawHistoryV2Request ): Promise <
APIResponse < { records : AccountDepositWithdrawHistoryV2 [] } >
>
Filter by "deposit" or "withdraw".
Optional. Filter to a specific currency.
Start of time range in milliseconds.
End of time range in milliseconds.
Number of records to return.
Response — AccountDepositWithdrawHistoryV2 fields:
Field Type Description withdraw_idstringWithdrawal record ID deposit_idstringDeposit record ID operation_typestring"deposit" or "withdraw"currencystringCurrency symbol apply_timenumberRequest time (ms) arrival_amountstringAmount credited feestringFee charged statusnumberTransaction status code addressstringOn-chain address tx_idstringBlockchain transaction hash
Get Recent Withdrawal History
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const response = await client . getDepositWithdrawHistoryV2 ({
operation_type: 'withdraw' ,
N: 20 ,
});
for ( const record of response . data . records ) {
console . log ( `[ ${ record . currency } ] ${ record . arrival_amount } — status: ${ record . status } — tx: ${ record . tx_id } ` );
}
getDepositWithdrawDetailV1(params)
Returns the details of a single deposit or withdrawal transaction by its ID.
getDepositWithdrawDetailV1 ( params : {
id: string ;
}): Promise < APIResponse < { record : AccountDepositWithdrawHistoryV2 } >>
The transaction ID (from withdraw_id or deposit_id).
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const response = await client . getDepositWithdrawDetailV1 ({
id: '1234567890' ,
});
const record = response . data . record ;
console . log ( `Type: ${ record . operation_type } ` );
console . log ( `Amount: ${ record . arrival_amount } ${ record . currency } ` );
console . log ( `Status: ${ record . status } ` );
console . log ( `TX hash: ${ record . tx_id } ` );
Margin Account
getMarginAccountDetailsV1(params?)
Returns isolated margin account details for all or a specific trading pair.
getMarginAccountDetailsV1 ( params ?: {
symbol? : string ;
}): Promise < APIResponse < { symbols : SymbolMarginAccountDetailsV1 [] } >>
Optional. Filter to a specific symbol, e.g. "BTC_USDT".
Response — SymbolMarginAccountDetailsV1 key fields:
Field Type Description symbolstringTrading pair risk_ratestringCurrent risk rate risk_levelstringRisk level classification buy_enabledbooleanWhether new buys are enabled sell_enabledbooleanWhether new sells are enabled liquidate_pricestringLiquidation trigger price baseMarginV1BaseQuoteBase asset margin info quoteMarginV1BaseQuoteQuote asset margin info
Get Margin Account Details
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const response = await client . getMarginAccountDetailsV1 ({ symbol: 'BTC_USDT' });
const account = response . data . symbols [ 0 ];
console . log ( `Risk rate: ${ account . risk_rate } ` );
console . log ( `Liquidation price: ${ account . liquidate_price } ` );
console . log ( `Base available: ${ account . base . available } ` );
console . log ( `Quote available: ${ account . quote . available } ` );
submitMarginAssetTransferV1(params)
Transfers assets between your spot wallet and an isolated margin account.
submitMarginAssetTransferV1 ( params : SubmitMarginTransferV1Request ): Promise < APIResponse < { transfer_id : string } >>
The isolated margin trading pair, e.g. "BTC_USDT".
Asset to transfer, e.g. "USDT".
"in" to transfer from spot into margin; "out" to withdraw from margin back to spot.
Transfer to Margin Account
Withdraw from Margin Account
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
// Move 500 USDT from spot wallet into BTC_USDT isolated margin
const response = await client . submitMarginAssetTransferV1 ({
symbol: 'BTC_USDT' ,
currency: 'USDT' ,
amount: '500' ,
side: 'in' ,
});
console . log ( 'Transfer ID:' , response . data . transfer_id );
Fee Rates
getBasicSpotFeeRateV1()
Returns the base fee rate tier for your account (maker/taker by tier level).
getBasicSpotFeeRateV1 (): Promise < APIResponse < BasicFeeRateV1 >>
Response — BasicFeeRateV1 key fields:
Field Type Description user_rate_type0 | 1 | 2Fee schedule type levelstringFee tier level taker_fee_rate_AstringTaker fee for class A pairs maker_fee_rate_AstringMaker fee for class A pairs taker_fee_rate_BstringTaker fee for class B pairs maker_fee_rate_BstringMaker fee for class B pairs
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const response = await client . getBasicSpotFeeRateV1 ();
const fee = response . data ;
console . log ( `Fee tier: ${ fee . level } ` );
console . log ( `Class A — Taker: ${ fee . taker_fee_rate_A } , Maker: ${ fee . maker_fee_rate_A } ` );
console . log ( `Class B — Taker: ${ fee . taker_fee_rate_B } , Maker: ${ fee . maker_fee_rate_B } ` );
getActualSpotTradeFeeRateV1(params)
Returns the actual effective fee rates for a specific trading pair on your account, accounting for any promotions or pair-specific overrides.
getActualSpotTradeFeeRateV1 ( params : {
symbol: string ;
}): Promise < APIResponse < ActualFeeRateV1 >>
Trading pair symbol, e.g. "BTC_USDT".
Response — ActualFeeRateV1 fields:
Field Type Description symbolstringTrading pair buy_taker_fee_ratestringTaker fee rate for buy orders sell_taker_fee_ratestringTaker fee rate for sell orders buy_maker_fee_ratestringMaker fee rate for buy orders sell_maker_fee_ratestringMaker fee rate for sell orders
Get Actual Trade Fee Rate
import { RestClient } from 'bitmart-api' ;
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const response = await client . getActualSpotTradeFeeRateV1 ({ symbol: 'BTC_USDT' });
const fee = response . data ;
console . log ( `BTC_USDT effective fees:` );
console . log ( ` Buy — taker: ${ fee . buy_taker_fee_rate } , maker: ${ fee . buy_maker_fee_rate } ` );
console . log ( ` Sell — taker: ${ fee . sell_taker_fee_rate } , maker: ${ fee . sell_maker_fee_rate } ` );
Complete Account Overview Example
import { RestClient } from 'bitmart-api' ;
async function accountOverview () {
const client = new RestClient ({
apiKey: process . env . API_KEY ! ,
apiSecret: process . env . API_SECRET ! ,
apiMemo: process . env . API_MEMO ! ,
});
const [ spotWallet , feeRate , withdrawAddresses ] = await Promise . all ([
client . getSpotWalletBalanceV1 (),
client . getBasicSpotFeeRateV1 (),
client . getWithdrawAddressList (),
]);
// Print non-zero spot balances
console . log ( '=== Spot Wallet ===' );
for ( const asset of spotWallet . data . wallet ) {
if ( parseFloat ( asset . available ) > 0 ) {
console . log ( ` ${ asset . id } : ${ asset . available } available, ${ asset . frozen } frozen` );
}
}
// Print fee tier
console . log ( ' \n === Fee Tier ===' );
console . log ( ` Level: ${ feeRate . data . level } ` );
console . log ( ` Taker A: ${ feeRate . data . taker_fee_rate_A } ` );
console . log ( ` Maker A: ${ feeRate . data . maker_fee_rate_A } ` );
// Print saved addresses
console . log ( ' \n === Saved Withdraw Addresses ===' );
for ( const addr of withdrawAddresses . data . list ) {
console . log ( ` ${ addr . currency } ( ${ addr . network } ): ${ addr . address } ` );
}
}
await accountOverview ();