The REST API TradesHistory endpoint can be used to retrieve the entire trading history for your account.
The TradesHistory endpoint will return up to 50 trades per request in reverse chronological order (the most recent trades first), and provides a pagination offset parameter (ofs) to retrieve subsequent groups (pages) of up to 50 trades each.
For example, calling the TradesHistory endpoint without an offset parameter or with an offset of zero (ofs=0) would return the most recent 50 trades for your account, while calling TradesHistory with an offset of 50 (ofs=50) would return the next group of 50 trades (the 51st to 100th trades).