Build with the AI Skill
Trade ItTrade ItDocs
Actions

Read holdings

Fetch an account's holdings from your server using the user's OAuth access token and an account.id from Read accounts.

Scopes: brokerage:read tool:execute.

Server side: fetch positions

const response = await fetch('https://api.tradeit.app/api/tool/execute', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${accessToken}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    tool_name: 'get_holdings',
    params: { account_id: accountId },
  }),
});
if (!response.ok) throw new Error(`Holdings request failed: ${response.status}`);
const holdings = await response.json();

Returns: Holding[]. See Get holdings for a sample response.

On this page