Time Series API
Build Time Series APIs into your digital experience for quick investment and earnings summaries.
Configure Computed Data Points
Computed data points calculate their values when you make the request. They accept extra query parameters that control the calculation, in addition to the parameters that apply to every request. This page explains those parameters and shows how to use them.
Standard data points don't use these parameters. For the difference between the two types, see Core Concepts.
Which Parameters Apply
The following data points are computed. Each accepts a different set of parameters.
| Parameter | return | cumulative-return | rolling-return | growth | price |
|---|---|---|---|---|---|
performanceType | Yes | Yes | Yes | Yes | Yes |
annualDays | Yes | Yes | Yes | Yes | |
annualized | Yes | Yes | |||
preCurrency | Yes | Yes | Yes | Yes | |
requireContinueData | Yes | Yes | Yes | Yes | |
stepSize | Yes | Yes | |||
windowSize | Yes | ||||
initialInvestment | Yes |
The growth and price data points are currently in trial.
Parameter Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
performanceType | string | total | The performance stream to use: total, market or gross. You can pass a second value as a fallback. See Performance Type. |
annualized | boolean | Whether to annualize the results. | |
annualDays | number | 365.25 | The number of days in a year for annualized calculations. Common values are 252 for business days and 365 for calendar days. |
preCurrency | string | The currency to use before currency conversion, as an ISO 4217 code. See Pre-Euro Currency Conversion. | |
requireContinueData | boolean | Whether continuous data is required for the calculation. | |
stepSize | number | 1 | The step size for rolling calculations. |
windowSize | integer | The length of the rolling window. Minimum 1. Used with rolling-return. | |
initialInvestment | number | 10000 | The starting value for the calculation. Used with growth. |
Performance Type
The performanceType parameter sets which performance stream the calculation uses. The values are total, market and gross, and the default is total.
You can pass up to two values. The first is the preferred type, and the second is a fallback that is used if the preferred type returns no data. If you pass one value, no fallback is attempted.
GET /direct-web-services/time-series/v1/performance/return/0P00000CSY
?startDate=2020-01-01
&endDate=2024-12-31
&frequency=monthly
&performanceType=total,gross
The response returns the performanceType that was applied in the timeSeries object, so you can see which stream was used when a fallback applies.
Rolling Returns
Use rolling-return to calculate returns over a moving window. windowSize sets the length of the window, and stepSize sets how far the window moves between calculations.
The following request calculates 12-month rolling returns, moving one month at a time.
GET /direct-web-services/time-series/v1/performance/rolling-return/0P00000CSY
?startDate=2015-01-01
&endDate=2024-12-31
&frequency=monthly
&performanceType=total
&windowSize=12
&stepSize=1
Cumulative Returns
Use cumulative-return to calculate the return accumulated over the time range. Set annualized to true to annualize the result, and use annualDays to change the number of days in a year used for annualization.
GET /direct-web-services/time-series/v1/performance/cumulative-return/0P00000CSY
?startDate=2020-01-01
&endDate=2024-12-31
&frequency=monthly
&annualized=true
&annualDays=365
Growth of an Investment
Use growth to show how an initial investment would have grown. The default starting value is 10000, and you can change it with initialInvestment.
GET /direct-web-services/time-series/v1/performance/growth/0P00000CSY
?startDate=2020-01-01
&endDate=2024-12-31
&frequency=monthly
&initialInvestment=50000
Pre-Euro Currency Conversion
When currencyId is EUR and startDate is before 1999, set preCurrency for computed data points, so that periods before the euro can be converted from the original currency.
GET /direct-web-services/time-series/v1/performance/return/0P00000CSY
?startDate=1995-01-01
&endDate=2024-12-31
&frequency=monthly
¤cyId=EUR
&preCurrency=DEM