Get Transaction History
API Description
This interface returns the historical transaction records of the specified trading instruments.
Note: Transaction history data is only available via RESTful API.
Precautions
- This interface does not return transaction history for orders that have not yet been executed. Only completed orders will be returned.
- This interface will only return transaction records within the last 30 days.
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=returnUTradeHistory
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
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| currencyPair | True | String | Trading instrument(s). Multiple tranding instruments allowed, separated by commas. Example: "BTC_USDT,ETH_USDT" Note: Max 20 instruments per request |
| startAt | False | String | Start time (timestamp) |
| endAt | False | String | End time (timestamp) |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| tradeID | String | Transaction ID |
| type | String | Trade direction: Buy/Sell |
| amount | String | Current order size in quote currency |
| success_amount | String | Traded order size in quote currency |
| total | String | Current order size in base currency |
| success_count | String | Traded order size in base currency |
| fee | String | Handling fee |
| prize | String | Order price specified by user |
| date | String | Transaction time (timestamp) |
| status | String | Status:1: Uncompleted, 2: Partially completed,3: Fully completed,4: User cancelled |
| pair | String | Trading instrument |
Request Example
The following Python code shows how to get transaction history for BTC_USDT and ETH_USDT.
Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Spot > RESTful Private Interface.
api_url = "/api/v1/private?command=returnUTradeHistory"
method = "post"
params = {"currencyPair": "BTC_USDT,ETH_USDT",
# "startAt":"1631526172583",
# "endAt":"1631526317779"
}
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. For brevity, only two orders are shown below:
{'code': '200',
'data': [{'tradeID': 4626945040880301545,
'date': 1764334890420,
'amount': '0.00',
'total': '0.0000',
'fee': '0.00',
'type': 'buy',
'prize': '0.00',
'success_count': '0.0010',
'success_amount': '91.57',
'status': 3,
'out_trade_no': '',
'pair': 'BTC_USDT'},
{'tradeID': 4626942841857038261,
'date': 1764334912854,
'amount': '0.00',
'total': '0.0000',
'fee': '0.00',
'type': 'buy',
'prize': '0.00',
'success_count': '0.0493',
'success_amount': '149.73',
'status': 3,
'out_trade_no': '',
'pair': 'ETH_USDT'}],
'msg': 'SUCCESS',
'success': True,
'failed': False}