Skip to main content

Overview

The Accounts API provides access to account-level data including balances, buying power, positions, and order history for specific trading accounts.

Class Reference

Methods

get_balances(account_id)

Retrieve account balances and buying power.
Parameters:
  • account_id (str): Account ID
Returns: Balances object

get_orders(account_id, status=None)

Retrieve all orders for an account.
Parameters:
  • account_id (str): Account ID
  • status (str, optional): Filter by status (“open”, “filled”, “cancelled”)
Returns: List of Order objects

get_positions(account_id)

Retrieve all positions for an account.
Parameters:
  • account_id (str): Account ID
Returns: List of Position objects

Data Objects

Balances Object

Position Object

Examples

Check Account Balance Before Trading

Monitor Account Positions

Review Order History

Calculate Account Performance

Find Winning and Losing Positions

Error Handling

Best Practices

  1. Check balances before trading to avoid insufficient funds errors
  2. Monitor positions regularly to stay informed about P/L
  3. Use filters when querying orders to reduce data transfer
  4. Store account data appropriately to minimize API calls
  5. Handle errors gracefully especially for permission issues
  • Orders - Place and manage orders
  • Users - Get list of user accounts
  • Market Data - Get current prices for positions

API Endpoints

This SDK wraps the following REST API endpoints:
  • GET /v1/accounts/{id}/balances - Get account balances
  • GET /v2/accounts/{id}/orders - Get account orders
  • GET /v1/accounts/{id}/positions - Get account positions