Skip to main content
GET
/
api
/
v1
/
trading
/
transactions
Get Transactions
curl --request GET \
  --url https://api.example.com/api/v1/trading/transactions \
  --header 'Content-Type: application/json' \
  --data '
{
  "limit": 123,
  "offset": 123
}
'
{
  "transactions": [
    {
      "id": "<string>",
      "type": "<string>",
      "amount": 123,
      "balance_after": 123,
      "created_at": "<string>",
      "description": "<string>"
    }
  ],
  "total": 123,
  "limit": 123,
  "offset": 123
}

Usage

result = client.get_transactions(limit=50, offset=0)

Parameters

limit
integer
default:50
Maximum number of transactions to return.
offset
integer
default:0
Pagination offset for fetching subsequent pages.

Response

transactions
array
List of transaction records.
total
integer
Total number of transactions.
limit
integer
Limit used in the request.
offset
integer
Offset used in the request.

Example

from polyhush import PolyhushClient

client = PolyhushClient(api_key="your-api-key")

# Get first page of transactions
result = client.get_transactions(limit=20, offset=0)

for tx in result['transactions']:
    sign = "+" if tx['amount'] > 0 else ""
    print(f"{tx['created_at']}: {tx['type']} {sign}${tx['amount']:.2f}")
    print(f"  {tx['description']}")
    print(f"  Balance: ${tx['balance_after']:.2f}")
    print()

# Get next page
if result['total'] > 20:
    page2 = client.get_transactions(limit=20, offset=20)

Response

{
  "transactions": [
    {
      "id": "tx_123",
      "type": "TRADE",
      "amount": -55.00,
      "balance_after": 945.00,
      "created_at": "2024-01-15T10:30:00Z",
      "description": "Buy 100 shares @ $0.55"
    },
    {
      "id": "tx_122",
      "type": "SETTLEMENT",
      "amount": 100.00,
      "balance_after": 1000.00,
      "created_at": "2024-01-14T15:00:00Z",
      "description": "Settlement payout: Will BTC hit $50k?"
    }
  ],
  "total": 150,
  "limit": 50,
  "offset": 0
}