Read a stock's risk statistics
curl --request GET \
--url https://api.darvas.app/v1/prices/risk \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.darvas.app/v1/prices/risk"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.darvas.app/v1/prices/risk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ticker": "AAPL",
"benchmark": "SPY",
"interval": "day",
"as_of_date": "2026-11-27",
"risk_statistics": [
{
"lookback": "1y",
"interval": "day",
"start_date": "2025-11-28",
"end_date": "2026-11-27",
"observations": 250,
"lookback_complete": true,
"risk_free_rate_annual_pct": 4.12,
"beta": 1.18,
"beta_adjusted": 1.12,
"beta_std_error": 0.06,
"alpha_annualized_pct": -2.4,
"correlation": 0.78,
"r_squared": 0.61,
"volatility_annualized_pct": 27.9,
"benchmark_volatility_annualized_pct": 18.4,
"downside_deviation_annualized_pct": 19.2,
"return_annualized_pct": 14.6,
"benchmark_return_annualized_pct": 15.1,
"total_return_pct": 14.4,
"sharpe_ratio": 0.38,
"sortino_ratio": 0.55,
"treynor_ratio": 0.09,
"tracking_error_annualized_pct": 17.5,
"information_ratio": -0.03,
"var_95_loss_pct": 2.6,
"cvar_95_loss_pct": 3.9,
"max_drawdown_pct": -18.8,
"max_drawdown_peak_date": "2026-01-05",
"max_drawdown_trough_date": "2026-04-08",
"null_reason": null
}
],
"price_type": "close_split_consistent_price_return",
"methodology": {
"fit": "beta is the OLS slope of the stock's returns on the benchmark's"
},
"units": {
"_pct": "percent: 12.5 means 12.5%"
},
"source": "Daily closes of US listings and the US Treasury par yield curve, as Darvas stores them",
"as_of": "2026-11-30T12:00:00.000Z"
}{
"error": "VALIDATION_ERROR",
"message": "Send ticker or cik"
}{
"error": "UNAUTHORIZED",
"message": "The API key is not valid"
}{
"error": "PLAN_REQUIRED",
"message": "The account of this key has no active data API plan"
}{
"error": "NOT_FOUND",
"message": "No company has this ticker or CIK"
}{
"error": "RATE_LIMITED",
"message": "Too many requests"
}{
"error": "INTERNAL_ERROR",
"message": "Something went wrong"
}{
"error": "UNAVAILABLE",
"message": "The data service is unavailable"
}Stocks & Short Interest
Stock Beta, Sharpe & Drawdown Risk API
Compute a US stock’s beta, alpha, correlation, volatility, Sharpe, Sortino, Treynor, max drawdown and 95% VaR against any benchmark over 6 months to 10 years.
Read a stock's risk statistics
curl --request GET \
--url https://api.darvas.app/v1/prices/risk \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.darvas.app/v1/prices/risk"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.darvas.app/v1/prices/risk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ticker": "AAPL",
"benchmark": "SPY",
"interval": "day",
"as_of_date": "2026-11-27",
"risk_statistics": [
{
"lookback": "1y",
"interval": "day",
"start_date": "2025-11-28",
"end_date": "2026-11-27",
"observations": 250,
"lookback_complete": true,
"risk_free_rate_annual_pct": 4.12,
"beta": 1.18,
"beta_adjusted": 1.12,
"beta_std_error": 0.06,
"alpha_annualized_pct": -2.4,
"correlation": 0.78,
"r_squared": 0.61,
"volatility_annualized_pct": 27.9,
"benchmark_volatility_annualized_pct": 18.4,
"downside_deviation_annualized_pct": 19.2,
"return_annualized_pct": 14.6,
"benchmark_return_annualized_pct": 15.1,
"total_return_pct": 14.4,
"sharpe_ratio": 0.38,
"sortino_ratio": 0.55,
"treynor_ratio": 0.09,
"tracking_error_annualized_pct": 17.5,
"information_ratio": -0.03,
"var_95_loss_pct": 2.6,
"cvar_95_loss_pct": 3.9,
"max_drawdown_pct": -18.8,
"max_drawdown_peak_date": "2026-01-05",
"max_drawdown_trough_date": "2026-04-08",
"null_reason": null
}
],
"price_type": "close_split_consistent_price_return",
"methodology": {
"fit": "beta is the OLS slope of the stock's returns on the benchmark's"
},
"units": {
"_pct": "percent: 12.5 means 12.5%"
},
"source": "Daily closes of US listings and the US Treasury par yield curve, as Darvas stores them",
"as_of": "2026-11-30T12:00:00.000Z"
}{
"error": "VALIDATION_ERROR",
"message": "Send ticker or cik"
}{
"error": "UNAUTHORIZED",
"message": "The API key is not valid"
}{
"error": "PLAN_REQUIRED",
"message": "The account of this key has no active data API plan"
}{
"error": "NOT_FOUND",
"message": "No company has this ticker or CIK"
}{
"error": "RATE_LIMITED",
"message": "Too many requests"
}{
"error": "INTERNAL_ERROR",
"message": "Something went wrong"
}{
"error": "UNAVAILABLE",
"message": "The data service is unavailable"
}Overview
This endpoint measures a US stock against a benchmark, SPY without one, over each lookback window you ask for. Each window carries raw and Blume-adjusted beta, Jensen’s alpha, correlation and R², volatility and downside deviation, the Sharpe, Sortino and Treynor ratios, tracking error and the information ratio, the largest drawdown with its peak and trough, and 95% historical value at risk and expected shortfall. Returns are price returns of split-consistent daily closes, sampled daily, weekly or monthly. The risk-free rate is the window’s average 3-month Treasury par yield. A window with too few returns answersnull statistics and says why.
| Coverage | Details |
|---|---|
| Stocks | Every US stock and fund with stored daily closes, as ticker and benchmark |
| Windows | 6m, 1y, 2y, 3y, 5y and 10y; 1y,3y,5y by default |
| Sampling | day, week or month returns |
| Units | _pct fields are percent; ratios and beta are plain numbers |
| MCP tool | get_price_risk on the data API MCP server |
Example
import os
import requests
headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]}
answer = requests.get(
"https://api.darvas.app/v1/prices/risk",
headers=headers,
params={
"ticker": "NVDA",
"benchmark": "QQQ",
"lookback": "1y,3y",
},
).json()
for window in answer["risk_statistics"]:
print(window["lookback"], window["beta"], window["sharpe_ratio"], window["max_drawdown_pct"])
curl -H "X-API-KEY: $DARVAS_API_KEY" \
"https://api.darvas.app/v1/prices/risk?ticker=NVDA&benchmark=QQQ&lookback=1y,3y"
Authorizations
apiKeybearerKey
Query Parameters
Response
Read a stock's risk statistics: one page.
The answer of GET /prices/risk.