Portfolio X-Ray API

Build Portfolio X-Ray APIs into your digital experience for quick investment and earnings summaries.

Request Structure

A Portfolio X-Ray request describes the portfolios you want to analyze and the settings that control the analysis. This page explains the structure of the request body and the rules for the portfolio portion of it: how holdings are identified, how positions are sized, and how fees are applied. For the settings that control the analysis itself, see Configuring the Analysis.

Top-Level Properties

The request body is a JSON object with the following top-level properties.

PropertyRequiredDescription
PortfoliosYesAn array of one or two portfolios to analyze.
RequestSettingsYesAnalysis settings such as output currency, date range and optional data sections.
ViewNoThe predefined set of data points to return. Defaults to All.
ConfigNoAn account-specific configuration preset. Defaults to Default.

Request Limits

  • A request can include a maximum of 2 portfolios.
  • Each portfolio can contain a maximum of 250 holdings.

Defining a Portfolio

Each object in the Portfolios array has the following properties.

PropertyRequiredDescription
NameYesThe portfolio name. The name is returned in the response as PortfolioName.
CurrencyYesThe portfolio currency, as an ISO 4217 code. See Supported currencies.
HoldingsYesAn array of 1 to 250 holdings.
TotalValueConditionalThe total market value of the portfolio in the portfolio currency. Required when holdings use Weight. Minimum 1.
FeesNoPortfolio-level annual fee. See Adding fees.
IrrFeesNoThe annual fee used in the internal rate of return calculation.

Identifying Holdings

Each holding must include one security identifier. The following identifiers are supported.

IdentifierDescriptionExample
SecurityIdMorningstar unique identifier of a security.FOUSA00DFS
CUSIPThe security's CUSIP.09251T103
ISINThe security's ISIN.US0378331005
PerformanceIdThe security's Morningstar Performance ID.0P00002QN3
TradingSymbolThe security's ticker or trading symbol.MDLOX
FundCodeThe security's fund code.ABG

You can mix identifier types across holdings in the same portfolio. For example, one holding can use TradingSymbol and another can use ISIN.

If you provide more than one identifier for a single holding, SecurityId takes priority. If SecurityId is absent, the last identifier listed in the object is used. To avoid ambiguity, provide one identifier per holding.

To include a cash position, use the SecurityId value CASH%0.000.

Sizing Positions

Each holding must also include a position size, expressed as either Weight or Value. The position size type must be the same for every holding in a portfolio. You can use Weight in one portfolio and Value in another.

Position sizeRules
WeightA percentage of the portfolio, from 1 to 100. Weights across all holdings must sum to 100. TotalValue is required on the portfolio.
ValueThe market value of the holding in the portfolio currency. Minimum 1. Values across all holdings must equal the portfolio's TotalValue.

Supported Currencies

The portfolio Currency accepts the following 19 ISO 4217 codes: AUD, BRL, CAD, CHF, DKK, EUR, GBP, HKD, INR, JPY, MXN, MYR, NOK, NZD, SEK, SGD, TWD, USD and ZAR.

The same set of currencies is supported for OutputCurrency in the request settings.

Adding Fees

You can apply an annual fee to an entire portfolio, to individual holdings, or both.

PropertyLevelDescription
AnnualFeePercentPortfolio (inside Fees) and holdingThe annual fee as a percentage of value. For example, 1.15 represents 1.15%. Defaults to 0.
AnnualFeeFrequencyPortfolio (inside Fees) and holdingHow often the fee is deducted: Monthly, Quarterly, SemiAnnually or Annually. Defaults to Monthly.

Use IrrFees on the portfolio to set the annual fee used in the internal rate of return calculation.

Example Portfolio

The following portfolio uses Weight for position sizes, mixes a trading symbol with a cash position, and applies a portfolio-level fee.

{
  "Name": "ExamplePortfolio1",
  "Currency": "USD",
  "TotalValue": 50000,
  "Holdings": [
    { "TradingSymbol": "SPY", "Weight": 40 },
    { "TradingSymbol": "AGG", "Weight": 30 },
    { "TradingSymbol": "QQQ", "Weight": 20 },
    { "SecurityId": "CASH%0.000", "Weight": 10 }
  ],
  "Fees": {
    "AnnualFeePercent": 0.5,
    "AnnualFeeFrequency": "Monthly"
  }
}

To send this portfolio, add it to the Portfolios array along with the required RequestSettings. See Request Portfolio X-Ray for a complete request.