Get Full Spot Account Balance
API Description
This interface allows users to retrieve the complete balance details of their spot trading account. The term “Full” here refers to the comprehensiveness of the data dimensions — it includes both the available balance and the balance frozen by open orders, providing a complete view of the account. For application scenarios that require precise accounting of all fund movements in the account, it is recommended to use the full spot account balance interface.
Note: Full spot account balance data is only available via RESTful API.
Precautions
None
Authentication
This is a private interface and requires authentication. For details on using the RESTful API, refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.
Request Method
POST
Endpoint
/api/v1/private?command=returnCompleteBalances
Frequency limit
The frequency limit for this interface is 5 requests/2s per user ID. In addition to this per-interface limit, a global rate limit is also enforced.
For detailed information on Global rate limits and API Rate Limiting Policy, please refer to the "Frequency Limit" section at click here
Request Parameters
This interface does not require any request parameter.
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| data | Json | Data object containing all holdings |
| -available | String | Available balance |
| -onOrders | String | Freeze Balance |
Request Example
The following Python code shows to get complete balance information.
Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.
api_url = "/api/v1/private?command=returnCompleteBalances"
method = "post"
params = {}
SpotRestfulPrivate(host, api_url, method, api_key, params, secret_key) # function SpotRestfulPrivate() is defined in section (Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface)
Note: For a complete Java code example, please refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.
Response Example
The following is an example response returned by the above Python request:
{'code': '200',
'data': {'BTC': {'onOrders': '0', 'available': '0.0012'},
'CWT': {'onOrders': '0', 'available': '400'},
'SAND': {'onOrders': '0', 'available': '108.467'},
'ETH': {'onOrders': '0', 'available': '0.033'},
'USDT': {'onOrders': '0', 'available': '257.51830114'}},
'msg': 'SUCCESS',
'success': True,
'failed': False}