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.account_id(str): Account ID
get_orders(account_id, status=None)
Retrieve all orders for an account.account_id(str): Account IDstatus(str, optional): Filter by status (“open”, “filled”, “cancelled”)
get_positions(account_id)
Retrieve all positions for an account.account_id(str): Account ID
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
- Check balances before trading to avoid insufficient funds errors
- Monitor positions regularly to stay informed about P/L
- Use filters when querying orders to reduce data transfer
- Cache account data appropriately to minimize API calls
- Handle errors gracefully especially for permission issues
Related APIs
- 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 balancesGET /v1/accounts/{id}/orders- Get account ordersGET /v1/accounts/{id}/positions- Get account positions