Account Summary

View as MarkdownOpen in Claude

The get_account_summary() function returns all relevant account details identical to Trader Workstation’s “Account” window. Users may query to receive all available data or a narrow window based on the [Account Summary Tag](/tws-api/doc/account-portfolio-data/account-summary/account-summary-tags).

get_account_summary(

tags: String. Account summary key value to receive data for. See [Account Summary Tags](/tws-api/doc/account-portfolio-data/account-summary/account-summary-tags) for details.

group: String. Indicates a Financial Advisor’s allocation group to reference account details for. Non-advisor account structures should always pass “All”.

Default value passed, “All”.

timeout: Integer. Timeout before the request disconnects. Function-specific timeout default of 5 second.

)

from ibapi.account_summary_tags import AccountSummaryTags
app.get_account_summary(AccountSummaryTags.AllTags, "All")

Total size of the request may vary depending on number of accounts held in the account, and the number of tags requested.

Response Object

{AccountId}: Dictionary. Contains all tag value pairs for the designated accountId.

{

{Tag}: Dictionary. Contains the value of the affiliated tag along with the relevant currency.

value: String. Contains the alphanumeric value affiliated with the designated tag.

currency: String. Returns the currency used to denote the value. May return an empty string if returning value does not contain a price.

}

{'U1234567': {'AccountType': {'value': 'LLC', 'currency': ''}, 'Cushion': {'value': '0.993764', 'currency': ''}, 'DayTradesRemaining': {'value': '-1', 'currency': ''}, 'LookAheadNextChange': {'value': '1760558400', 'currency': ''}, 'AccruedCash': {'value': '262079.00', 'currency': 'USD'}, 'AvailableFunds': {'value': '219944453.18', 'currency': 'USD'}, 'BuyingPower': {'value': '1466299088.69', 'currency': 'USD'}, 'EquityWithLoanValue': {'value': '221042710.95', 'currency': 'USD'}, 'ExcessLiquidity': {'value': '220044618.70', 'currency': 'USD'}, 'FullAvailableFunds': {'value': '219944453.18', 'currency': 'USD'}, 'FullExcessLiquidity': {'value': '220044618.70', 'currency': 'USD'}, 'FullInitMarginReq': {'value': '1101020.27', 'currency': 'USD'}, 'FullMaintMarginReq': {'value': '1000859.00', 'currency': 'USD'}, 'GrossPositionValue': {'value': '2982965.22', 'currency': 'USD'}, 'InitMarginReq': {'value': '1101020.27', 'currency': 'USD'}, 'LookAheadAvailableFunds': {'value': '219944453.18', 'currency': 'USD'}, 'LookAheadExcessLiquidity': {'value': '220044618.70', 'currency': 'USD'}, 'LookAheadInitMarginReq': {'value': '1101020.27', 'currency': 'USD'}, 'LookAheadMaintMarginReq': {'value': '1000859.00', 'currency': 'USD'}, 'MaintMarginReq': {'value': '1000859.00', 'currency': 'USD'}, 'NetLiquidation': {'value': '221425500.56', 'currency': 'USD'}, 'PreviousDayEquityWithLoanValue': {'value': '205659145.23', 'currency': 'USD'}, 'TotalCashValue': {'value': '218181198.71', 'currency': 'USD'}}