Portfolio Stress Testing API: VaR, CVaR and 2008, 2020, 2022 Scenarios in One Call
Send portfolio weights, get value at risk, expected shortfall, Monte Carlo bands, historical crisis scenarios, market and rate shocks and hedge simulations as JSON.
Risk teams want the numbers without another dashboard. The Bourse stress-test endpoint takes weights and returns a full risk report as JSON.
Key takeaways
- One GET request:
/v1/stress-test?portfolio=AAPL:40,MSFT:30,TLT:30&value=1000000. - Value at risk and CVaR at 95% and 99% for 1 and 10 days, Cornish-Fisher VaR, volatility, maximum drawdown and CAGR.
- Historical scenarios with real prices: the 2008 financial crisis, Q4 2018, the 2020 COVID crash, the 2022 bear market and the 2025 tariff shock. Assets that did not trade yet are estimated through their beta.
- Market beta and 10-year rate sensitivity with shock tables, correlation clusters, CVaR contributions and a hedge simulation with bonds (IEF) and gold (GLD).
- Available on API Pro, Enterprise and pay-as-you-go keys.
Example
`` curl -H "Authorization: Bearer $BOURSE_KEY" \ "https://api.bourse.pl/v1/stress-test?portfolio=NVDA:25,AAPL:25,MSFT:25,TLT:25" ``
In Python:
`` import bourse r = bourse.stress_test({"NVDA": 25, "AAPL": 25, "MSFT": 25, "TLT": 25}) r["risk"]["cvar99_1d"], r["historical_scenarios_df"] ``
Method
Historical simulation on daily adjusted closes with fixed weights and no costs. Monte Carlo uses a stationary block bootstrap that keeps volatility clusters. Results describe how these weights behaved in the past; they are not a forecast. Full parameters are in the API reference.
See these filings as they land
Bourse collects Congress trades, SEC Form 4 insider filings and 13F fund holdings in one live feed, and flags insider buying clusters automatically. Free to start.
Bourse provides financial data and editorial information, parts of which are generated by AI. This page is for general education only. It is not personalised investment advice or a recommendation to buy or sell any financial instrument. Make your own decisions.