Skip to main content
The Wealthyhood home experience shows a performance chart plus high-level metrics for the investor’s primary portfolio. Use the Portfolios API endpoints documented here to fetch the price series and enriched portfolio snapshot that drive this UI.
All routes require a bearer token with the read:users scope plus the x-user-id header so the backend can resolve the retail account.

What to fetch

Call GET /portfolios/{id}/prices-by-tenor to retrieve a map of chart points keyed by tenor (1w, 1m, 6m, 1y, max). Each entry contains the sampled data points you can feed directly into the price chart component.

Example: fetch portfolio prices

const BASE = 'https://api.wealthyhood.com';

async function fetchHomeScreen({ token, userId, portfolioId }) {
  const headers = {
    'Authorization': `Bearer ${token}`,
    'x-user-id': userId,
    'Accept': 'application/json'
  };

  const pricesRes = await fetch(
    `${BASE}/portfolios/${portfolioId}/prices-by-tenor`,
    { headers }
  );

  if (!pricesRes.ok) throw new Error(`prices failed: ${pricesRes.status}`);

  return {
    pricesByTenor: await pricesRes.json()
  };
}
Persist the latest prices-by-tenor response to cache so you can render the chart instantly on next load and refresh it in the background. The intraday flag (displayIntraday) tells you when to render finer granularity.

See also

  • API Reference → Portfolios API → GET /portfolios/{id}/prices-by-tenor