Get brokerage holdings
get_holdingsYOUR connected brokerage holdings (the API key's user — no address input, identity comes from the key): Robinhood and any other brokerage linked to Gambit through SnapTrade. Covers STOCKS/ETFs/ADRs, OPTIONS, and CRYPTO HELD AT THE BROKERAGE (an actual coin at Coinbase/Kraken/Robinhood — not COIN, BITO or MSTR, which merely track one); see get_positions / get_account_balances for Hyperliquid. Bonds, CFDs and futures are NOT reported: they are dropped rather than shown in a column that would misprice them. EACH LOT CARRIES assetClass ('equity' | 'option' | 'crypto'). OPTION ARITHMETIC IS NOT SHARE ARITHMETIC: quantity is in CONTRACTS, while marketPrice and averageCost are per SHARE (that is how a premium is quoted), and option.contractMultiplier is the shares per contract AS STATED BY THE VENUE. marketValue already has the multiplier in it. So cost basis is quantity x averageCost x contractMultiplier — never quantity x averageCost, which understates it by ~100x. contractMultiplier is NULL when the venue stated none or stated something unusable; treat null as 'cannot value this row', never as 100 (a mini covers 10, a split-adjusted contract covers whatever the adjustment made it). Options also carry option.underlyingSymbol, optionType, strikePrice and expirationDate. Rows carry listingRegion ('us' | 'non_us' | null — null means the venue did not say, NOT 'US') and isDepositaryReceipt (a US-listed foreign company; for an option this describes its UNDERLYING). Default view is compact: total value, cashUsd and buyingPowerUsd (the same numbers the Gambit web app shows: USD-labelled or unlabelled balances only, other currencies are not summed, and null — not 0 — when the total is zero or negative, so a CAD-only account or a negative margin balance reads null), each connected account (with accountId, so two accounts sharing a label stay distinguishable), and topHoldings — the 10 largest ACCOUNT-LEVEL LOTS by absolute market value PER CURRENCY (a symbol held in two accounts appears twice, each row names its account; shorts rank by exposure; amounts are never compared across currencies, there is no FX conversion) with quantity, price, market value, average cost and currency, plus holdingsCount so you know what the cap hid (meta.caps_applied is non-null only when rows were dropped). Pass view: 'full' for every lot as the raw snapshot (holdings, totalCash; no topHoldings/spotlight fields). Pass symbol (compact view only) to get activeSymbolPosition: that ticker across accounts, INCLUDING options written over it. Because shares, contracts and coins are three different units, the spotlight breaks out legs[] — one entry per assetClass, each with its own quantity/marketPrice/averageCost/marketValue — and the headline quantity, marketPrice and averageCost are NULL whenever legs has more than one entry. marketValue is the exception and stays summed across legs, because dollars add up where units do not. Null when not held. Lots with no currency code are listed last as an unranked sample (ordered by symbol, capped like any group; meta.caps_applied.top_holdings.unknown_currency_truncated says if that sample dropped rows). Sampled rows keep their nominal values with currency: null; only the SPOTLIGHT aggregate is nulled — lots spanning currencies (or with no currency code) report null marketValue/marketPrice/averageCost/currency there, and lots mixing long and short keep net quantity and net marketValue but report null marketPrice and averageCost. Tickers match exactly (BRK.B is not BRK.A; a dex: prefix like xyz:TSLA is stripped). totalValue carries currency and totalValueCaveat: currency is NULL when no account stated one — that means UNKNOWN, not USD, so do not label such a total with a currency symbol or add it to one that has a currency. totalValueCaveat names why the total is not simply the worth of every account: 'mixed_currency' (accounts disagree, or some stated none — totalValue is null), 'missing_accounts' (some accounts reported no total and are left out of it), 'holdings_only' (no account total at all, so cash is missing), 'unknown_currency' (a real figure in a unit nobody stated). holdingsDegraded: true means at least one account's positions came from a REDUCED FEED THAT CANNOT REPORT OPTIONS — the holdings are present but known to be incomplete, so say so rather than reporting an option-free account as settled; account.positionsSource names which account it was. meta.data_freshness.status is 'fresh' inside the ~60s server cache and 'stale' when a cached snapshot was served past it (brokerages sync roughly daily, so stale is usually fine for reading — not for sizing a trade). meta.degraded_reason names why the answer is EMPTY: brokerage_not_connected means the user has not linked a brokerage in Gambit (Portfolio → Connect brokerage) — an empty list is never silent. Read-only, and cannot place brokerage orders. Needs the api:portfolio scope.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| view | No | compact (default): totals + up to 10 account-level lots per currency by absolute market value + symbol spotlight; full: every lot, raw snapshot shape | |
| symbol | No | compact view only: exact ticker to spotlight, e.g. NVDA or BRK.B — aggregated across accounts as activeSymbolPosition |