---
title: "Api Portfolio Risk"
method: GET
path: "/api/portfolio-analytics/risk"
tags: ["Portfolio"]
---

# Api Portfolio Risk

`GET /api/portfolio-analytics/risk`

## Request

- Base URL: `https://www.oxfordledge.com` (the document declares no server; this is the origin it was published from)
- URL: `https://www.oxfordledge.com/api/portfolio-analytics/risk`
- Auth: none declared

Portfolio risk metrics: beta, VaR, Sharpe, max drawdown, correlations.

Query params:
  ?tickers=AAPL,MSFT
  ?shares=10,5  (optional position-weighted)
  ?benchmark_ticker=IWM  (optional; defaults to ^GSPC / S&P 500)
  ?period=6mo  (optional; 1mo/3mo/6mo/1y/2y/3y/5y; defaults to 1y)

## Query parameters

- `tickers` string
- `shares` string
- `benchmark_ticker` string
- `period` string

## Response `200`

Successful Response

- PortfolioAnalyticsRiskResponse: `GET /api/portfolio-analytics/risk` — risk metrics. F4 backfill 2026-05-11. Free-form aggregator output. M1-2 (2026-05-27): additive Optional ``concentration`` sub-object surfaces HHI + DIVERSIFIED/MODERATE/CONCENTRATED bucket lifted from LEARN module ma-10's DOJ/FTC December 2023 thresholds. No behavior change for clients that ignore it; the FE renders a 5th card on the portfolio risk panel.
  - `error` string, nullable
  - `concentration` PortfolioConcentration: HHI (Herfindahl-Hirschman Index) concentration sub-object on the portfolio risk-analytics response. M1-2 (2026-05-27). Additive Optional[...] field; clients that don't read it see no behavior change. The frontend renders a small "Concentration" card alongside Beta/VaR/Sharpe/MaxDD using the same neutral visual tone. Click-through routes to /?view=learn&module=ma-10. All fields Optional[...] so an upstream compute failure can still return a valid (empty) envelope; the FE renders an em-dash and skips the card.
    - `hhi` integer, nullable
    - `bucket` string, nullable
    - `description` string, nullable
    - `thresholds` ConcentrationThresholds: DOJ/FTC December 2023 Merger Guidelines thresholds, returned so the FE can render the bucket label in context without hardcoding the numbers in two places. Source-of-truth lives in `services/portfolio_hhi.py` (which lifts them from LEARN module `ma-10`).
      - `moderate_floor` integer, nullable
      - `concentrated_floor` integer, nullable
    - `reference` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api.md) · [All operations](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/llms.txt) · [OpenAPI document](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/revisions/e832a1260f0b?raw)
