Portfolio Optimizer
Portfolio Optimizer is a [Web API](https://en.wikipedia.org/wiki/Web_API) to analyze and optimize investment portfolios (collection of financial assets such…
Finance & banking#openapi#financial
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
Portfolio Optimizer is a Web API to analyze and optimize investment portfolios (collection of financial assets such as stocks, bonds, ETFs, crypto-currencies) using modern portfolio theory algorithms (mean-variance, VaR, etc.).
API General Information
Portfolio Optimizer is based on REST for easy integration, uses JSON for the exchange of data and uses a standard HTTP verb (POST) to represent the action(s).
Portfolio Optimizer is also as secured as a Web API could be:
- 256-bit HTTPS Encryption
- No usage of cookies
- No usage of personal data
API Headers
The following HTTP header(s) are required when calling Portfolio Optimizer endpoints:
Content-type: application/json
This header specifies that the data provided in input to the endpoint is in JSON format
The following HTTP header(s) are optional when calling Portfolio Optimizer endpoints:
Content-Encoding: gzip
This header indicates that the data provided in input to the endpoint is compressed with gzip.
X-API-Key:
This header enables authenticated users to provide their private API key in order to benefit from higher API limits
API Key
Portfolio Optimizer is free to use, but not free to run.
In order to obtain an API key and benefit from higher API limits, a small participation to Portfolio Optimizer running costs is required.
This participation takes the form of coffee(s), with one coffee = one month of usage.
> Notes:
> * Please make sure not to expose your API key publicly!
API Limits
Portfolio Optimizer comes with fairly reasonable API limits.
For anonymous users:
- The API requests are restricted to a subset of all the available endpoints and/or endpoints features
- The API requests are limited to 1 request per second for all the anonymous users combined, with concurrent requests rejected
- The API requests are limited to 1 second of execution time
- The API requests are limited to 20 assets, 250 portfolios, 500 series data points and 5 factors
For authenticated users with an API key:
- The API requests have access to all the available endpoints and endpoints features
- The API requests are limited to 10000 requests per 24 hour per API key, with concurrent requests queued
- The API requests are limited to 2.5 seconds of execution time
- The API requests are limited to 100 assets, 1250 portfolios, 2500 series data points and 25 factors
> Notes:
> * It is possible to further relax the API limits, or to disable the API limits alltogether; please contact the support for more details.
> * Information on the API rate limits are provided in response messages HTTP headers x-ratelimit-*:
> * x-ratelimit-limit-second, the limit on the number of API requests per second
> * x-ratelimit-remaining-second, the number of remaining API requests in the current second
> * x-ratelimit-limit-minute, the limit on the number of API requests per minute
> * ...
API Regions
Portfolio Optimizer servers are located in Western Europe.
> Notes:
> * It is possible to deploy Portfolio Optimizer in other geographical regions, for example to improve the API latency; please contact the support for more details.
API Response Codes
Standard HTTP response codes are used by Portfolio Optimizer to provide details on the status of API requests.
| HTTP Code | Description | Notes |
|---|---|---|
| 200 | Request successfully processed | - |
| 400 | Request failed to be processed because of incorrect content | The response message body contains information on the incorrect content |
| 401 | Request failed to be processed because of invalid API key | - |
| 404 | Request failed to be processed because of non existing endpoint | The requested endpoint might exist, but needs to be accessed with another HTTP method (e.g., POST instead of GET) |
| 429 | Request failed to be processed because of API limits violated | The response message HTTP headers x-ratelimit-* contain information on the API limits |
| 500 | Request failed to be processed because of an internal error | Something went wrong on Portfolio Optimizer side, do not hesitate to report the issue |
| 502 | Request failed to be processed because of a temporary connectivity error | Something went wrong on Portfolio Optimizer side, please check the API status and do not hesitate to report the issue |
API Status
Portfolio Optimizer…
Endpoints 83
Assets / Analysis
- POSTAbsorption Ratio
/assets/analysis/absorption-ratioCompute the absorption ratio associated to a universe of assets. References * Mark Kritzman, Yuanzhen Li, Sebastien Page and Roberto Rigobon, Principal… - POSTTurbulence Index
/assets/analysis/turbulence-indexCompute the turbulence index associated to a universe of assets. References * M. Kritzman, Y. Li, Skulls, Financial Turbulence, and Risk Management,Financial…
Assets / Correlation Matrix
- POSTCorrelation Matrix
/assets/correlation/matrixCompute the Pearson asset correlation matrix from either: * The asset returns * The asset covariance matrix References * Wikipedia, Correlation and Dependence - POSTCorrelation Matrix Bounds
/assets/correlation/matrix/boundsCompute the lower bounds and the upper bounds of an asset correlation matrix associated to a given group of assets. References * Kawee Numpacharoen &… - POSTDenoised Correlation Matrix
/assets/correlation/matrix/denoisedCompute a denoised asset correlation matrix, using one of the following methods: * The eigenvalues clipping method, described in the first reference, which is… - POSTCorrelation Matrix Distance
/assets/correlation/matrix/distanceCompute the distance between an asset correlation matrix and a reference correlation matrix, using one of the following distance metrics: * Euclidean distance… - POSTCorrelation Matrix Effective Rank
/assets/correlation/matrix/effective-rankCompute the effective rank of an asset correlation matrix. References * Olivier Roy and Martin Vetterli, The effective rank: A measure of effective… - POSTCorrelation Matrix Informativeness
/assets/correlation/matrix/informativenessCompute the informativeness of an asset correlation matrix, using one of the following distance metrics: * Euclidean distance (default), which is the distance… - POSTNearest Correlation Matrix
/assets/correlation/matrix/nearestCompute the _closest_ - in terms of the Frobenius norm - asset correlation matrix to an approximate asset correlation matrix, optionally keeping a selected… - POSTRandom Correlation Matrix
/assets/correlation/matrix/randomGenerate an asset correlation matrix uniformly at random over the space of positive definite correlation matrices. References * Joe, H., Generating random… - POSTCorrelation Matrix Shrinkage
/assets/correlation/matrix/shrinkageCompute an asset correlation matrix as a convex linear combination of an asset correlation matrix and a target correlation matrix, the target correlation… - POSTTheory-Implied Correlation Matrix
/assets/correlation/matrix/theory-impliedCompute the theory-implied asset correlation matrix associated with: * A hierarchical classification of a universe of assets * An asset correlation matrix… - POSTCorrelation Matrix Validation
/assets/correlation/matrix/validationValidate whether a matrix is an asset correlation matrix. References * Wikipedia, Correlation and Dependence
Assets / Covariance Matrix
- POSTCovariance Matrix
/assets/covariance/matrixCompute the covariance matrix of assets from either: * The asset correlation matrix and their volatilities (i.e., standard deviations) * The asset correlation… - POSTCovariance Matrix Effective Rank
/assets/covariance/matrix/effective-rankCompute the effective rank of an asset covariance matrix. References * Olivier Roy and Martin Vetterli, The effective rank: A measure of effective… - POSTExponentially Weighted Covariance Matrix
/assets/covariance/matrix/exponentially-weightedCompute an exponentially weighted covariance matrix of assets returns. References * RiskMetrics Group. Longerstaey, J. (1996). RiskMetrics technical document,… - POSTCovariance Matrix Validation
/assets/covariance/matrix/validationValidate whether a matrix is a covariance matrix. References * Wikipedia, Covariance Matrix
Assets / Kurtosis
- POSTKurtosis
/assets/kurtosisCompute the kurtosis of one or several asset(s), from the asset returns. References * Wikipedia, Kurtosis
Assets / Prices
- POSTAdjusted Prices
/assets/prices/adjustedCompute the backward-adjusted prices of one or several asset(s) for one or several date(s) from: * Unadjusted prices * Capital distributions, like stock… - POSTForward-Adjusted Prices
/assets/prices/adjusted/forwardCompute the forward-adjusted prices of one or several asset(s) for one or several date(s) from: * Unadjusted prices * Capital distributions, like stock…
Assets / Returns
- POSTArithmetic Returns
/assets/returnsCompute the arithmetic return(s) of one or several asset(s) for one or several time period(s). References * Wikipedia, Rate of Return - POSTArithmetic Average Return
/assets/returns/averageCompute the arithmetic average of the return(s) of one or several asset(s). References * Wikipedia, Arithmetic Average Rate of Return
Assets / Returns Simulation
- POSTBootstrap
/assets/returns/simulation/bootstrapSimulate the return(s) of one or several asset(s) for one or several time period(s) using a bootstrap method. References * Efron, B. (1979), Bootstrap…
Assets / Skewness
- POSTSkewness
/assets/skewnessCompute the skewness of one or several asset(s), from the asset returns. References * Wikipedia, Skewness
Assets / Variance
- POSTVariance
/assets/varianceCompute the variance of one or several asset(s) from either: * The asset returns * The asset covariance matrix * The asset volatility(ies) References *…
Assets / Volatility
- POSTVolatility
/assets/volatilityCompute the volatility (i.e., standard deviation) of one or several asset(s) from either: * The asset returns * The asset covariance matrix * The asset…
Factors
- POSTResidualization
/factors/residualizationCompute the residuals of a factor against a set of factors, using a returns-based linear regression analysis. References * Factor Research, Factor Exposure…
Portfolio Analysis
- POSTAlpha
/portfolio/analysis/alphaCompute the Jensen’s alpha of one or several portfolio(s) in the Capital Asset Pricing Model (CAPM). References * Carl R. Bacon, Practical Portfolio… - POSTBeta
/portfolio/analysis/betaCompute the beta of one or several portfolio(s) in the Capital Asset Pricing Model (CAPM). References * Carl R. Bacon, Practical Portfolio Performance… - POSTConditional Value At Risk
/portfolio/analysis/conditional-value-at-riskCompute the conditional value at risk of one or several portfolio(s) from portfolio values. References * Wikipedia, Value at risk * Acerbi, C. and Tasche, D.… - POSTReturn Contributions
/portfolio/analysis/contributions/returnPerform a return contribution analysis of one or several portfolio(s), optionally using groups of assets. References * Carl R. Bacon, Practical Portfolio… - POSTRisk Contributions
/portfolio/analysis/contributions/riskPerform a risk contribution analysis of one or several portfolio(s), optionally using groups of assets. References * Carl R. Bacon, Practical Portfolio… - POSTCorrelation Spectrum
/portfolio/analysis/correlation-spectrumCompute the correlation spectrum of one or several portfolio(s). References * Tristan Froidure, Khalid Jalalzai and Yves Choueifaty, Portfolio… - POSTDiversification Ratio
/portfolio/analysis/diversification-ratioCompute the diversification ratio of one or several portfolio(s). References * Yves Choueifaty and Yves Coignard, Toward Maximum Diversification, The Journal… - POSTDrawdowns
/portfolio/analysis/drawdownsCompute the drawdown function - also called the underwater equity curve -, as well as the worst 10 drawdowns of one or several portfolio(s). References *… - POSTEffective Number of Bets
/portfolio/analysis/effective-number-of-betsCompute the effective number of bets of one or several portfolio(s). References * Meucci, Attilio and Santangelo, Alberto and Deguest, Romain, Risk Budgeting… - POSTFactor Exposures
/portfolio/analysis/factors/exposuresCompute the exposures of one or several portfolio(s) to a set of factors, using a returns-based linear regression analysis. References * Measuring Factor… - POSTMean-Variance Efficient Frontier
/portfolio/analysis/mean-variance/efficient-frontierCompute the discretized mean-variance efficient frontier associated to a list of assets, optionally subject to: * Minimum and maximum weights constraints *… - POSTMean-Variance Minimum Variance Frontier
/portfolio/analysis/mean-variance/minimum-variance-frontierCompute the discretized mean-variance minimum variance frontier associated to a list of assets, optionally subject to: * Minimum and maximum weights… - POSTArithmetic Return
/portfolio/analysis/returnCompute the arithmetic return of one or several portfolio(s) from either: * Portfolio assets arithmetic returns * Portfolio values References * Wikipedia,… - POSTArithmetic Average Return
/portfolio/analysis/returns/averageCompute the arithmetic average of the arithmetic return(s) of one or several portfolio(s). References * Wikipedia, Arithmetic Average Rate of Return - POSTTracking Error
/portfolio/analysis/tracking-errorCompute the tracking error between a benchmark and one or several portfolio(s). References * Wikipedia, Tracking error * Carl R. Bacon, Practical Portfolio… - POSTUlcer Index
/portfolio/analysis/ulcer-indexCompute the Ulcer Index of one or several portfolio(s). References * Carl R. Bacon, Practical Portfolio Performance Measurement and Attribution * Peter G.… - POSTUlcer Performance Index
/portfolio/analysis/ulcer-performance-indexCompute the Ulcer Performance Index of one or several portfolio(s). References * Carl R. Bacon, Practical Portfolio Performance Measurement and Attribution *… - POSTValue At Risk
/portfolio/analysis/value-at-riskCompute the value at risk of one or several portfolio(s) from portfolio values. References * Wikipedia, Value at risk * Acerbi, C. and Tasche, D. (2002),… - POSTVolatility
/portfolio/analysis/volatilityCompute the volatility (i.e., standard deviation) of one or several portfolio(s) from either: * Portfolio assets covariance matrix * Portfolio values…
Portfolio Analysis / Sharpe ratio
- POSTSharpe Ratio
/portfolio/analysis/sharpe-ratioCompute the Sharpe ratio of one or several portfolio(s) from either: * Portfolio assets arithmetic returns and assets covariance matrix * Portfolio values… - POSTBias-Adjusted Sharpe Ratio
/portfolio/analysis/sharpe-ratio/bias-adjustedCompute the Sharpe ratio of one or several portfolio(s), adjusted for small sample bias. References * Opdyke, J., Comparing Sharpe ratios: So where are the… - POSTSharpe Ratio Confidence Interval
/portfolio/analysis/sharpe-ratio/confidence-intervalBuild a confidence interval for the Sharpe ratio of one or several portfolio(s). References * Opdyke, J.D., Comparing Sharpe ratios: So where are the… - POSTProbabilistic Sharpe Ratio
/portfolio/analysis/sharpe-ratio/probabilisticCompute the probabilistic Sharpe ratio of one or several portfolio(s). References * Opdyke, J.D., Comparing Sharpe ratios: So where are the p-values?. J Asset… - POSTMinimum Track Record Length
/portfolio/analysis/sharpe-ratio/probabilistic/minimum-track-record-lengthCompute the minimum track record length of one or several portfolio(s). References * Bailey, David H. and Lopez de Prado, Marcos, The Sharpe Ratio Efficient…
Portfolio Construction
- POSTInvestable Portfolio
/portfolio/construction/investableCompute an investable portfolio as close as possible, in terms of assets weights, to a desired portfolio, taking into account: * The desired assets weights *… - POSTMimicking Portfolio
/portfolio/construction/mimickingConstruct a portfolio as close as possible, in terms of returns, to a benchmark, optionally subject to: * Minimum and maximum weights constraints * Maximum… - POSTRandom Portfolio
/portfolio/construction/randomConstruct one or several random portfolio(s), optionally subject to: * Minimum and maximum weights constraints * Minimum and maximum portfolio exposure…
Portfolio Optimization
- POSTEqual Risk Contributions Portfolio
/portfolio/optimization/equal-risk-contributionsCompute the asset weights of the equal risk contributions portfolio, optionally subject to: * Minimum and maximum weights constraints References * Richard,… - POSTEqual Sharpe Ratio Contributions Portfolio
/portfolio/optimization/equal-sharpe-ratio-contributionsCompute the asset weights of the equal Sharpe Ratio contributions portfolio. References * Andreas Steiner, Sharpe Ratio Contribution and Attribution Analysis - POSTEqual Volatility Weighted Portfolio
/portfolio/optimization/equal-volatility-weightedCompute the asset weights of the equal volatility-weighted portfolio. References * Tristan Froidure, Khalid Jalalzai and Yves Choueifaty, Portfolio… - POSTEqual Weighted Portfolio
/portfolio/optimization/equal-weightedCompute the asset weights of the equal-weighted portfolio. References * Victor DeMiguel and al., Optimal Versus Naive Diversification: How Inefficient is the… - POSTHierarchical Risk Parity Portfolio
/portfolio/optimization/hierarchical-risk-parityCompute the asset weights of the hierarchical risk parity portfolio, optionally subject to: * Minimum and maximum weights constraints * Minimum and maximum… - POSTHierarchical Clustering-Based Risk Parity Portfolio
/portfolio/optimization/hierarchical-risk-parity/clustering-basedCompute the asset weights of the hierarchical clustering-based risk parity portfolio, optionally subject to: * Minimum and maximum weights constraints *… - POSTInverse Variance Weighted Portfolio
/portfolio/optimization/inverse-variance-weightedCompute the asset weights of the inverse variance-weighted portfolio. References * Raul Leote de Carvalho and al., Demystifying Equity Risk-Based Strategies:… - POSTInverse Volatility Weighted Portfolio
/portfolio/optimization/inverse-volatility-weightedCompute the asset weights of the inverse volatility-weighted portfolio. References * Raul Leote de Carvalho and al., Demystifying Equity Risk-Based… - POSTMarket Capitalization Weighted Portfolio
/portfolio/optimization/market-capitalization-weightedCompute the asset weights of the market capitalization-weighted portfolio. References * Wikipedia, Capitalization-weighted Index - POSTMaximum Decorrelation Portfolio
/portfolio/optimization/maximum-decorrelationCompute the asset weights of the maximum decorrelation portfolio, optionally subject to: * Minimum and maximum weights constraints * Maximum group weights… - POSTMaximum Ulcer Performance Index Portfolio
/portfolio/optimization/maximum-ulcer-performance-indexCompute the asset weights of the maximum Ulcer Performance Index portfolio, optionally subject to: * Minimum and maximum weights constraints * Maximum group… - POSTMinimum Correlation Portfolio
/portfolio/optimization/minimum-correlationCompute the asset weights of the (heuristic) minimum correlation portfolio, which is a portfolio built using the Minimum Correlation Algorithm discovered by… - POSTMinimum Ulcer Index Portfolio
/portfolio/optimization/minimum-ulcer-indexCompute the asset weights of the minimum Ulcer Index portfolio, optionally subject to: * Minimum and maximum weights constraints * Maximum group weights… - POSTMost Diversified Portfolio
/portfolio/optimization/most-diversifiedCompute the asset weights of the most diversified portfolio, optionally subject to: * Minimum and maximum weights constraints * Maximum group weights…
Portfolio Optimization / Mean-Variance
- POSTMaximum Return Portfolio
/portfolio/optimization/maximum-returnCompute the asset weights of the maximum return portfolio, optionally subject to: * Minimum and maximum weights constraints * Maximum group weights… - POSTDiversified Maximum Return Portfolio
/portfolio/optimization/maximum-return/diversifiedCompute the asset weights of the diversified maximum return portfolio, as defined in the first reference, optionally subject to: * Minimum and maximum weights… - POSTSubset Resampling-Based Maximum Return Portfolio
/portfolio/optimization/maximum-return/subset-resampling-basedCompute the asset weights of the subset resampling-based maximum return portfolio, following the methodology described in the first and the second references,… - POSTMaximum Sharpe Ratio Portfolio
/portfolio/optimization/maximum-sharpe-ratioCompute the asset weights of the maximum Sharpe ratio portfolio, optionally subject to: * Minimum and maximum weights constraints * Maximum group weights… - POSTDiversified Maximum Sharpe Ratio Portfolio
/portfolio/optimization/maximum-sharpe-ratio/diversifiedCompute the asset weights of the diversified maximum Sharpe ratio portfolio, as defined in the first reference, optionally subject to: * Minimum and maximum… - POSTSubset Resampling-Based Maximum Sharpe Ratio Portfolio
/portfolio/optimization/maximum-sharpe-ratio/subset-resampling-basedCompute the asset weights of the susbet resampling-based maximum Sharpe ratio portfolio, following the methodology described in the first and the second… - POSTMean-Variance Efficient Portfolio
/portfolio/optimization/mean-variance-efficientCompute the asset weights of a mean-variance efficient portfolio, optionally subject to: * Minimum and maximum weights constraints * Maximum group weights… - POSTDiversified Mean-Variance Efficient Portfolio
/portfolio/optimization/mean-variance-efficient/diversifiedCompute the asset weights of a diversified mean-variance efficient portfolio, as defined in the first reference, optionally subject to: * Minimum and maximum… - POSTSubset Resampling-Based Mean-Variance Efficient Portfolio
/portfolio/optimization/mean-variance-efficient/subset-resampling-basedCompute the asset weights of a subset resampling-based mean-variance efficient portfolio, following the methodology described in the first and the second… - POSTMinimum Variance Portfolio
/portfolio/optimization/minimum-varianceCompute the asset weights of the minimum variance portfolio, optionally subject to: * Minimum and maximum weights constraints * Maximum group weights… - POSTDiversified Minimum Variance Portfolio
/portfolio/optimization/minimum-variance/diversifiedCompute the asset weights of the diversified minimum variance portfolio, as defined in the first reference, optionally subject to: * Minimum and maximum… - POSTSubset Resampling-Based Minimum Variance Portfolio
/portfolio/optimization/minimum-variance/subset-resampling-basedCompute the asset weights of the subset resampling-based minimum variance portfolio, following the methodology described in the first and the second…
Portfolio Simulation
- POSTDrift-weight Portfolio Rebalancing
/portfolio/simulation/rebalancing/drift-weightSimulate the evolution of one or several portfolio(s) over one or several time period(s), the portfolio(s) being never rebalanced (a.k.a. buy and hold).… - POSTFixed-weight Portfolio Rebalancing
/portfolio/simulation/rebalancing/fixed-weightSimulate the evolution of one or several portfolio(s) over one or several time period(s), the portfolio(s) being rebalanced toward fixed weights at the… - POSTRandom-weight Portfolio Rebalancing
/portfolio/simulation/rebalancing/random-weightSimulate the evolution of one or several portfolio(s) over one or several time period(s), the portfolio(s) being rebalanced toward random weights at the…
API details
- Base URL
https://api.portfoliooptimizer.io/v1https://eu-west-1.api.portfoliooptimizer.io/v1- Authentication
- An API key in the X-API-Key header
- Operations
- 83 operations on 83 pathsPOST 83
- Main resources
- Portfolio Analysis 19Portfolio Optimization 14Portfolio Optimization / Mean-Variance 12Assets / Correlation Matrix 11Portfolio Analysis / Sharpe ratio 5Assets / Covariance Matrix 4Portfolio Construction 3Portfolio Simulation 3Assets / Analysis 2Assets / Prices 2
- Response formats
application/json- Description format
- OpenAPI 3.0.1, API version
1.0.9 - Links
- Documentation · OpenAPI document · Terms of service · Support
- Listed from
- APIs.guru OpenAPI Directory (CC0-1.0)
Source updated
How to test the Portfolio Optimizer in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the Portfolio Optimizer collection, without the publisher's secrets.
- Add your credentialsThis API uses an API key in the X-API-Key header. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Absorption Ratio” (POST /assets/analysis/absorption-ratio), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the Portfolio Optimizer?
Portfolio Optimizer is a [Web API](https://en.wikipedia.org/wiki/Web_API) to analyze and optimize investment portfolios (collection of financial assets such… It is listed under Finance & banking and has 83 endpoints.
Who publishes the Portfolio Optimizer?
It is listed from Portfolio Optimizer's public API description (an OpenAPI document), not published by Portfolio Optimizer on Swastik Codes. Anyone who controls portfoliooptimizer.io can claim the profile by adding a DNS TXT record.
What is the base URL of the Portfolio Optimizer?
Its description lists 2 base URLs: https://api.portfoliooptimizer.io/v1, https://eu-west-1.api.portfoliooptimizer.io/v1. The first is the usual one; the others are typically sandbox or regional servers.
How do I authenticate with the Portfolio Optimizer?
With an API key in the X-API-Key header.
How many endpoints does the Portfolio Optimizer have?
83 operations on 83 paths (83 POST). The largest groups are Portfolio Analysis, Portfolio Optimization, Portfolio Optimization / Mean-Variance, Assets / Correlation Matrix.
Is forking the Portfolio Optimizer free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.