ClickAPIs
Examples · Which holdings made this portfolio's return?

Examples / Everyday

Which holdings made this portfolio's return?

Level 2 · EverydayPOST/v1/attribution

What it answers

Splits the last 12 months' return of a five-stock portfolio into additive contributions by holding and by sector, with the best and worst contributor in each month and the return against SPY.

Request

Input POST /v1/attribution
{
  "symbols": [
    "AAPL",
    "MSFT",
    "NVDA",
    "JPM",
    "XOM"
  ],
  "weights": [
    0.3,
    0.25,
    0.2,
    0.15,
    0.1
  ]
}
Open in playground

Response

Output 200 OK
{
  "ok": true,
  "data": {
    "start": "2025-11-12",
    "end": "2026-11-12",
    "trading_days": 251,
    "rebalance": "none",
    "total_return": 0.12915,
    "annualized_return": 0.129696,
    "holdings": [
      {
        "symbol": "AAPL",
        "weight_start": 0.3,
        "weight_end": 0.346124,
        "return": 0.302754,
        "contribution": 0.090826,
        "share_of_total": 0.703262,
        "sector": "Technology"
      },
      {
        "symbol": "XOM",
        "weight_start": 0.1,
        "weight_end": 0.130787,
        "return": 0.476784,
        "contribution": 0.047678,
        "share_of_total": 0.369172,
        "sector": "Energy"
      },
      {
        "symbol": "JPM",
        "weight_start": 0.15,
        "weight_end": 0.144798,
        "return": 0.089992,
        "contribution": 0.013499,
        "share_of_total": 0.104521,
        "sector": "Financial Services"
      },
      {
        "symbol": "MSFT",
        "weight_start": 0.25,
        "weight_end": 0.227926,
        "return": 0.02945,
        "contribution": 0.007363,
        "share_of_total": 0.057008,
        "sector": "Technology"
      },
      {
        "symbol": "NVDA",
        "weight_start": 0.2,
        "weight_end": 0.150364,
        "return": -0.151081,
        "contribution": -0.030216,
        "share_of_total": -0.233963,
        "sector": "Technology"
      }
    ],
    "sectors": [
      {
        "sector": "Technology",
        "holdings": 3,
        "weight_start": 0.75,
        "contribution": 0.067972
      },
      {
        "sector": "Energy",
        "holdings": 1,
        "weight_start": 0.1,
        "contribution": 0.047678
      },
      {
        "sector": "Financial Services",
        "holdings": 1,
        "weight_start": 0.15,
        "contribution": 0.013499
      }
    ],
    "monthly": [
      {
        "month": "2025-11",
        "return": -0.02478,
        "best": {
          "symbol": "AAPL",
          "contribution": 0.005896
        },
        "worst": {
          "symbol": "NVDA",
          "contribution": -0.017337
        }
      },
      {
        "month": "2025-12",
        "return": 0.006244,
        "best": {
          "symbol": "NVDA",
          "contribution": 0.010066
        },
        "worst": {
          "symbol": "AAPL",
          "contribution": -0.007862
        }
      },
      {
        "month": "2026-01",
        "return": -0.024408,
        "best": {
          "symbol": "XOM",
          "contribution": 0.018332
        },
        "worst": {
          "symbol": "MSFT",
          "contribution": -0.026634
        }
      },
      {
        "month": "2026-02",
        "return": -0.02006,
        "best": {
          "symbol": "XOM",
          "contribution": 0.010801
        },
        "worst": {
          "symbol": "MSFT",
          "contribution": -0.01876
        }
      },
      {
        "month": "2026-03",
        "return": -0.014388,
        "best": {
          "symbol": "XOM",
          "contribution": 0.01573
        },
        "worst": {
          "symbol": "AAPL",
          "contribution": -0.012159
        }
      },
      {
        "month": "2026-04",
        "return": 0.065186,
        "best": {
          "symbol": "NVDA",
          "contribution": 0.028092
        },
        "worst": {
          "symbol": "XOM",
          "contribution": -0.014255
        }
      },
      {
        "month": "2026-05",
        "return": 0.06576,
        "best": {
          "symbol": "AAPL",
          "contribution": 0.0457
        },
        "worst": {
          "symbol": "XOM",
          "contribution": -0.007049
        }
      },
      {
        "month": "2026-06",
        "return": -0.065038,
        "best": {
          "symbol": "JPM",
          "contribution": 0.012614
        },
        "worst": {
          "symbol": "MSFT",
          "contribution": -0.036207
        }
      },
      {
        "month": "2026-07",
        "return": 0.09763,
        "best": {
          "symbol": "MSFT",
          "contribution": 0.045991
        },
        "worst": {
          "symbol": "NVDA",
          "contribution": 0.000696
        }
      },
      {
        "month": "2026-08",
        "return": 0.054604,
        "best": {
          "symbol": "MSFT",
          "contribution": 0.019886
        },
        "worst": {
          "symbol": "JPM",
          "contribution": 0.001865
        }
      },
      {
        "month": "2026-09",
        "return": 0.016094,
        "best": {
          "symbol": "AAPL",
          "contribution": 0.015656
        },
        "worst": {
          "symbol": "JPM",
          "contribution": -0.010525
        }
      },
      {
        "month": "2026-10",
        "return": 0.015373,
        "best": {
          "symbol": "XOM",
          "contribution": 0.018489
        },
        "worst": {
          "symbol": "NVDA",
          "contribution": -0.021274
        }
      },
      {
        "month": "2026-11",
        "return": -0.036641,
        "best": {
          "symbol": "AAPL",
          "contribution": 0.010014
        },
        "worst": {
          "symbol": "NVDA",
          "contribution": -0.035753
        }
      }
    ],
    "check_sum_of_contributions": 0.12915,
    "benchmark": {
      "symbol": "SPY",
      "return": 0.115923,
      "active_return": 0.013227
    }
  },
  "meta": {
    "op": "attribution",
    "units": 7,
    "cost_usd": 0.0,
    "billing": "internal",
    "free_call": false,
    "free_calls_left": 0,
    "balance_usd": 5.0,
    "ms": 6,
    "interval": "1day",
    "data_as_of": "2026-11-12",
    "partial_last_bar": false
  }
}

How to read it

holdings[].contribution adds up to total_return (check_sum_of_contributions). share_of_total is each holding's slice; monthly shows who helped and who hurt each month.

Parameters and limits: Return attribution reference. Analytics, not advice.