APIs, Bots & Automation

How to Read Quote.Trade Account Balance, Margin, and Buying Power

Use GET /api/account with a read-only key to read balances, margin, buying power, and positions. Use only fields actually returned by the account, and remove account IDs and balances from screenshots or logs you share.

25 minutesIntermediateDevelopers, bots, and risk dashboards

What you will accomplish

  • Authenticate a read-only account request
  • Interpret account permission and margin fields
  • Retrieve current positions and valuation
  • Block trading when account data is stale or inconsistent

Before you begin

  • A read-enabled Quote.Trade API key
  • A server-side application
  • The current account and positions schema
EndpointGET /api/account
CredentialRead-only X-MBX-APIKEY
Public exampleRemove private details before sharing
WithdrawalsSupported through a separate withdrawal workflow
Step-by-step

Use a read-only key

Use a read-only credential for this account-read tutorial and send X-MBX-APIKEY to GET https://app.quote.trade/api/account as documented. Withdrawal is supported separately through dedicated withdrawal tools; it is not part of this read call.

Save the response securely and remove private details before sharing

Keep the full response only in secure troubleshooting storage. Remove account IDs, balances, wallet details, and other private fields from screenshots, examples, or support messages.

Read the returned account fields

The current trading reference lists assets, canDeposit, canTrade, canWithdraw, feeTier, maxWithdrawAmount, totalInitialMargin, totalMaintMargin, totalMarginBalance, totalOpenOrderInitialMargin, totalPositionInitialMargin, totalUnrealizedProfit, totalWalletBalance, and updateTime.

Calculate buying power only from returned fields

Do not label a field as buying power unless the API returns it or the published methodology defines the calculation. Private RISK_UPDATE events include a USD buying-power estimate; treat that as a separate event source.

Check freshness and permissions

Check updateTime or the event timestamp and confirm canTrade. Block new orders when the account response is stale or disagrees with the latest private events.

Troubleshooting

Common problems and fixes

The account returns an empty assets array

Use the documented top-level margin fields and positions endpoint; do not assume the account is empty from one array.

Wallet balance and margin balance differ

They represent different concepts. Review open positions, unrealized P&L, and margin allocations.

The update timestamp is old

Treat the snapshot as stale, stop automated order submission, and reconnect or query again.

Primary sources

Ready for the next step?

Open account API documentation

Open account API documentation