Documentation Index
Fetch the complete documentation index at: https://mintlify.com/markzuckerbergas/gbmplus-api-python/llms.txt
Use this file to discover all available pages before exploring further.
gbm.accounts provides methods to inspect your GBM+ portfolio, including strategies, buying power, cash transactions, and position summaries. Access it as gbm.accounts on any GBMPlusAPI instance.
Two distinct identifiers appear throughout these methods.
account_id is returned by getAccounts() and is used with GBM’s main REST API (e.g., cash transactions, transfers). legacy_contract_id is also found on each account object and is required when calling the Homebroker endpoints for buying power, position summaries, and order operations. Always check which identifier an endpoint requires before making a call.getMainContract()
GET https://api.gbm.com/v1/contracts. Returns the first contract object in the list. This method is called automatically during GBMPlusAPI initialisation and stores the result in the session — you will rarely need to call it directly.
Returns: The first contract dict from the API response.
Example:
getAccounts()
GET https://api.gbm.com/v2/contracts/{main_contract}/accounts. Each item in the returned list contains fields such as name, account_id, and legacy_contract_id.
Returns: A list of account/strategy dicts.
Example:
getStrategies()
getAccounts(). Calls the same GET https://api.gbm.com/v2/contracts/{main_contract}/accounts endpoint and returns identical results. Provided as a convenience method to match GBM+ UI terminology.
Returns: A list of account/strategy dicts.
Example:
getAccount(strategy_name)
getAccounts() and performs a dictionary lookup by the name field.
The exact display name of the strategy as it appears in your GBM+ account, e.g.
"Smart Cash" or "Swensen".None if no strategy with that name is found.
Example:
getStrategy(strategy_name)
getAccount(strategy_name). Returns a single strategy dict by its exact display name.
The exact display name of the strategy, e.g.
"Smart Cash".None if not found.
Example:
getCashTransactions(account_id, page=None, page_size=None)
GET https://api.gbm.com/v1/contracts/{main_contract}/accounts/{account_id}/cash-transactions. Optionally accepts pagination parameters to limit and page through large result sets.
The
account_id of the strategy whose cash transactions you want to retrieve. Obtain this from getAccounts().The page number to retrieve. When provided together with
page_size, the request URL includes both as query parameters.The number of results to return per page. Must be supplied alongside
page.items array of cash transaction dicts.
Example:
getStateOfTransfer(account_id, transfer_id)
transfer_id. Calls getCashTransactions() internally and iterates through the items array to find a match.
The
account_id of the strategy to search within.The
transfer_id returned when the transfer was originally created (e.g. via gbm.transfers.transfer()).None if the transfer ID does not appear in the current transaction history.
Example:
getContractBuyingPower(legacy_contract_id)
POST https://homebroker-api.gbm.com/GBMP/api/Operation/GetContractBuyingPower. This endpoint belongs to the Homebroker API and requires the legacy_contract_id rather than the standard account_id.
The legacy contract identifier found in the account object returned by
getAccounts(). This is distinct from account_id.getPositionSummary(legacy_contract_id)
POST https://homebroker-api.gbm.com/GBMP/api/Portfolio/GetPositionSummary. Like getContractBuyingPower(), this is a Homebroker endpoint that requires the legacy_contract_id.
The legacy contract identifier found in the account object returned by
getAccounts().For a worked example of using account IDs to move funds between strategies, see Transfer Funds.