Portfolio X-Ray API

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

API Inputs

Request Inputs

This API generates an x-ray of one or two portfolios in a single request (POST /portfolioanalysis/v1/xray). The x-ray shows how each portfolio is diversified by region, sector, and investment style. Inputs are passed in the JSON request body, except langcult, which is a query parameter.

A maximum of 2 portfolios can be passed per request, with a maximum of 250 holdings per portfolio. The request body has four top-level fields. Portfolios and RequestSettings are required. Their inputs are described in the following sections:

{
  "View": { "Id": "All" },
  "RequestSettings": {
    "OutputCurrency": "USD",
    "AnalysisDateTimePeriod": "MonthEnd",
    "PortfolioPerformanceStartDate": "EarliestCommon"
  },
  "Portfolios": [
    {
      "Name": "ExamplePortfolio1",
      "Currency": "USD",
      "TotalValue": 50000,
      "Holdings": [
        { "TradingSymbol": "SPY", "Weight": 40 },
        { "ISIN": "US0378331005", "Weight": 50 },
        { "SecurityId": "CASH%0.000", "Weight": 10 }
      ]
    }
  ]
}

Config

AttributeValue
TypeRequest Payload
Data Typeobject
Possible Values{"Id": "Default"}. Default: Default
Example{"Id": "Default"}

Optional. Account-specific configuration preset, selected with the Id field. Settings from the preset can be overridden directly in the request.

langcult

AttributeValue
TypeQuery Parameter
Data Typestring
Possible Valuesen-US, en-CA, en-AU, en-GB. Default: en-US
Exampleen-GB

Language and locale used for the response. To override the default value in the Accept-Language HTTP header, use this parameter.

Portfolios

AttributeValue
TypeRequest Payload
Data Typearray of objects
Possible ValuesPortfolio objects. A minimum of 1 and a maximum of 2 can be passed. See Portfolio Inputs.
Example[{"Name": "ExamplePortfolio1", "Currency": "USD", "TotalValue": 50000, "Holdings": [...]}]

Required. Array of portfolios to analyze.

RequestSettings

AttributeValue
TypeRequest Payload
Data Typeobject
Possible ValuesSettings object. OutputCurrency is required. See Request Settings Inputs.
Example{"OutputCurrency": "USD"}

Required. Analysis settings including output currency, date range, performance frequency, and optional data sections.

View

AttributeValue
TypeRequest Payload
Data Typeobject
Possible Values{"Id": ...} where Id is one of All, Default, Intersection, Operation, Portfolio, StockIntersection, XrayOverview, Snapshot. Default: All
Example{"Id": "XrayOverview"}

Optional. Selects a predefined set of data points to return in the response, using the Id field.

Request Settings Inputs

These inputs are passed in the RequestSettings object.

AnalysisDateTimePeriod

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typestring
Possible ValuesMonthEnd, QuarterEnd, YearEnd, CustomDate. Default: MonthEnd
ExampleMonthEnd

Optional. End date period for the analysis. CustomDate requires PortfolioPerformanceEndDate to be set.

AssetClassGroupConfigs

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typeobject
Possible Values{"AssetClassGroupConfig": [{"Id": ...}]} where Id is one of ACG-AUDETAILED, ACG-BROAD-INDIA2, ACG-BROAD-JAPAN, ACG-CABROAD, ACG-CANBROAD4, ACG-EUBROAD, ACG-GLOBBROAD, ACG-NZDETAILED, ACG-UKBROAD, ACG-UK-GBR, ACG-USBROAD. Default: ACG-USBROAD
Example{"AssetClassGroupConfig": [{"Id": "ACG-USBROAD"}]}

Optional. Asset class group to query. The AssetClassGroupConfig array accepts a maximum of one value per request.

DisableRescale

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typeboolean
Possible Valuestrue, false. Default: false
Examplefalse

Optional. When true, portfolio weights are not rescaled if any holdings are invalid or unentitled.

EnablePerformanceCommonEndDate

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typeboolean
Possible Valuestrue, false. Default: false
Exampletrue

Optional. When true, the most recent common end date across all portfolios is used as the analysis end date.

IncludeGrossNetReturns

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typeboolean
Possible Valuestrue, false. Default: false
Exampletrue

Optional. When true, both gross and net return values are included in trailing returns and calendar year return data.

IncludePortfolioInCorrelationMatrix

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typeboolean
Possible Valuestrue, false. Default: false
Exampletrue

Optional. When true, the portfolio is included as an entry in the correlation matrix.

InitialValue

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typenumber
Possible ValuesA number greater than or equal to 1. Default: 10000
Example10000

Optional. Initial value of the portfolio in the output currency.

MaxCorrelationMatrixHoldingNumber

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typeinteger
Possible ValuesIntegers from 2 to 50. Default: 50
Example25

Optional. Maximum number of holdings to include in the correlation matrix. Applies only when ReturnDataSections includes CorrelationMatrix.

OutputCurrency

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typestring
Possible ValuesAUD, BRL, CAD, CHF, DKK, EUR, GBP, HKD, INR, JPY, MXN, MYR, NOK, NZD, SEK, SGD, TWD, USD, ZAR. Default: USD
ExampleUSD

Required. Currency used to calculate output values. 19 currencies are supported; accepted values are ISO 4217 currency codes.

PerformanceFrequency

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typestring
Possible ValuesMonthly, Quarterly. Default: Monthly
ExampleMonthly

Optional. Frequency of performance returns and risk calculations.

PortfolioPerformanceCustomStartDate

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typestring (date)
Possible Valuesyyyy-MM-dd
Example2022-10-31

Custom start date of the analysis. Required when PortfolioPerformanceStartDate is set to CustomDate.

PortfolioPerformanceEndDate

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typestring (date)
Possible Valuesyyyy-MM-dd
Example2022-10-31

End date of the analysis. Required when AnalysisDateTimePeriod is set to CustomDate.

PortfolioPerformanceStartDate

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typestring
Possible ValuesEarliestCommon, EarliestAvailable, EarliestCommonExtended, EarliestCommonExtended10Year, Year10, CustomDate. Default: EarliestCommon
ExampleEarliestCommon

Optional. Start date of the analysis. CustomDate requires PortfolioPerformanceCustomStartDate to be set.

ReturnDataSections

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typearray of strings
Possible ValuesCorrelationMatrix, RollingReturns
Example["RollingReturns"]

Optional. Additional data sections to include in the response. Related inputs are RollingReturnFrequencies, RollingReturnStep, and MaxCorrelationMatrixHoldingNumber.

RollingReturnFrequencies

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typearray of strings
Possible ValuesMonth3, Month6, Year1, Year3, Year5, Year10
Example["Year1", "Year3", "Year5"]

Rolling return periods to calculate. Required when ReturnDataSections includes RollingReturns.

RollingReturnStep

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typeinteger
Possible ValuesIntegers greater than or equal to 1. Default: 1
Example1

Optional. Step interval, in months, between rolling return calculations. Applies only when ReturnDataSections includes RollingReturns.

SynchronizePortfolioStartDate

AttributeValue
TypeRequest Payload (RequestSettings)
Data Typeboolean
Possible Valuestrue, false. Default: false
Exampletrue

Optional. When true, the latest common start date across all portfolios is used as the analysis start date for all portfolios.

Portfolio Inputs

These inputs are passed in each object of the Portfolios array.

Currency

AttributeValue
TypeRequest Payload (Portfolios)
Data Typestring
Possible ValuesAUD, BRL, CAD, CHF, DKK, EUR, GBP, HKD, INR, JPY, MXN, MYR, NOK, NZD, SEK, SGD, TWD, USD, ZAR
ExampleUSD

Required. Portfolio currency. 19 currencies are supported; accepted values are ISO 4217 currency codes.

Fees

AttributeValue
TypeRequest Payload (Portfolios)
Data Typeobject
Possible ValuesFee object. See Fee Inputs.
Example{"AnnualFeePercent": 1.15, "AnnualFeeFrequency": "Monthly"}

Optional. Portfolio-level annual fee configuration.

Holdings

AttributeValue
TypeRequest Payload (Portfolios)
Data Typearray of objects
Possible ValuesHolding objects. A minimum of 1 and a maximum of 250 can be passed. See Holding Inputs.
Example[{"TradingSymbol": "SPY", "Weight": 60}, {"SecurityId": "CASH%0.000", "Weight": 40}]

Required. The holdings in the portfolio. Each holding must specify a security identifier and either Weight or Value.

IrrFees

AttributeValue
TypeRequest Payload (Portfolios)
Data Typenumber
Possible ValuesA number greater than or equal to 1
Example1000

Optional. Annual fee used in the internal rate of return calculation.

Name

AttributeValue
TypeRequest Payload (Portfolios)
Data Typestring
Possible Values—
ExampleExamplePortfolio1

Required. Portfolio name.

TotalValue

AttributeValue
TypeRequest Payload (Portfolios)
Data Typenumber
Possible ValuesA number greater than or equal to 1
Example20000

Total market value of the portfolio in the portfolio currency. Required when holdings use Weight. When holdings use Value, the sum of all holding values must equal TotalValue.

Holding Inputs

These inputs are passed in each object of the Holdings array.

Each holding requires one security identifier and one position size:

  • Identifier: pass one of SecurityId, CUSIP, FundCode, ISIN, PerformanceId, or TradingSymbol. If multiple identifiers are provided for a single holding, SecurityId takes priority. If SecurityId is absent, the last identifier listed in the object is used. Identifier types can be mixed across holdings.
  • Position size: pass either Weight or Value. The position size type must be the same for every holding in the portfolio.

Holdings can also include the annual fee inputs described under Fee Inputs.

CUSIP

AttributeValue
TypeRequest Payload (Holdings)
Data Typestring
Possible ValuesA security CUSIP
Example09251T103

Security's CUSIP.

FundCode

AttributeValue
TypeRequest Payload (Holdings)
Data Typestring
Possible ValuesA security fund code
ExampleABG

Security's fund code.

ISIN

AttributeValue
TypeRequest Payload (Holdings)
Data Typestring
Possible ValuesA security ISIN
ExampleUS0378331005

Security's ISIN.

PerformanceId

AttributeValue
TypeRequest Payload (Holdings)
Data Typestring
Possible ValuesA Morningstar Performance ID
Example0P00002QN3

Security's Morningstar Performance ID. Use the Universe API to retrieve Performance IDs for investments in your entitled universe.

SecurityId

AttributeValue
TypeRequest Payload (Holdings)
Data Typestring
Possible ValuesA Morningstar Security ID, or CASH%0.000 for cash positions
ExampleFOUSA00DFS

Morningstar unique identifier of a security. Use CASH%0.000 for cash positions. Takes priority over any other identifier passed for the same holding.

TradingSymbol

AttributeValue
TypeRequest Payload (Holdings)
Data Typestring
Possible ValuesA security ticker or trading symbol
ExampleMDLOX

Security's ticker or trading symbol.

Value

AttributeValue
TypeRequest Payload (Holdings)
Data Typenumber
Possible ValuesA number greater than or equal to 1
Example25000

Market value of the holding in the portfolio currency. The sum of all holding values must equal the portfolio TotalValue. Use either Value or Weight, not both.

Weight

AttributeValue
TypeRequest Payload (Holdings)
Data Typenumber
Possible ValuesNumbers from 1 to 100
Example60

Holding weight as a percentage of the portfolio total. All holding weights must sum to 100, and the portfolio TotalValue is required. Use either Weight or Value, not both.

Fee Inputs

These inputs configure annual fees. They can be passed at the portfolio level, in the Fees object of a portfolio, or at the holding level, in an object of the Holdings array.

AnnualFeeFrequency

AttributeValue
TypeRequest Payload (Fees; Holdings)
Data Typestring
Possible ValuesMonthly, Quarterly, SemiAnnually, Annually. Default: Monthly
ExampleMonthly

Optional. How often the annual fee is deducted. At the portfolio level the fee is deducted from the portfolio; at the holding level it is deducted from the holding.

AnnualFeePercent

AttributeValue
TypeRequest Payload (Fees; Holdings)
Data Typenumber
Possible ValuesA number greater than or equal to 0. Default: 0 (no fee)
Example1.15

Optional. Annual fee as a percentage of portfolio value (portfolio level) or holding value (holding level). For example, 1.15 is 1.15%.