Get trades history

Retrieves trades history for a selected pair or list of pairs in a specific timeframe.

Supports pagination for ease of use.

getTradeHistory(
    Array $pairs,        // default ['BTC/USDT'],
    String $startDate,   // default 'yesterday'
    String $endDate,     // default 'today'
    Int $pageSize,       // default 50,
    Int $pageNumber      // default 0
): array
Example:
$tradeHistory = NexoPro::getTradeHistory(
    pairs: ['NEXO/USDT'],
    startDate: '-1 month',
    endDate: 'today',
    pageSize: 50,
    pageNumber: 0
);
{
  "trades": [
    {
      "id": "588",
      "symbol": "NEXO/USDT",
      "side": "buy",
      "tradeAmount": "100",
      "executedPrice": "2.05801152",
      "timestamp": 1622030078,
      "orderId": "3112015294862764_690693483"
    }
  ]
}

Last updated