Skip to main content

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

  1. This interface does not return transaction history for orders that have not yet been executed. Only completed orders will be returned.
  2. 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

ParameterMandatoryTypeDescription
currencyPairTrueStringTrading instrument(s).
Multiple tranding instruments allowed, separated by commas.
Example: "BTC_USDT,ETH_USDT"
Note: Max 20 instruments per request
startAtFalseStringStart time (timestamp)
endAtFalseStringEnd time (timestamp)

Response Parameters

ParameterTypeDescription
tradeIDStringTransaction ID
typeStringTrade direction: Buy/Sell
amountStringCurrent order size in quote currency
success_amountStringTraded order size in quote currency
totalStringCurrent order size in base currency
success_countStringTraded order size in base currency
feeStringHandling fee
prizeStringOrder price specified by user
dateStringTransaction time (timestamp)
statusStringStatus:1: Uncompleted, 2: Partially completed,3: Fully completed,4: User cancelled
pairStringTrading 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}