Docs / Endpoints
Performance & risk
POST/v1/performanceunits: 2 + 1 per decade of historyintraday
Period returns, CAGR, volatility, Sharpe, Sortino, maximum drawdown, VaR and CVaR, skew and kurtosis, plus beta, alpha, R², tracking error and up/down capture against a benchmark.
Add "async": true to run it as a job, and "webhook_url" to be called when it finishes (Jobs & async). Calls estimated above 1,000 units run as jobs automatically. Supports interval for intraday bars at 5× the units (Intraday).
Parameters
| Field | Type | Default | Description |
|---|---|---|---|
symbolrequired | string | — | Ticker. |
start_date | date | — | YYYY-MM-DD. First date to include. Default: the full history available. |
end_date | date | — | YYYY-MM-DD. Last date to include. Default: the latest bar. |
benchmark | string | "SPY" | Benchmark for beta, alpha, capture and tracking error. |
risk_free_rate | number | 0 | Annual risk-free rate as a decimal (0.04 = 4%), used by Sharpe and Sortino. |
interval | string | "1day" | "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. |
Example request
MSFT: ten years of return and risk Read the walkthrough →
POST /v1/performance{ "symbol": "MSFT", "start_date": "2016-01-01", "benchmark": "SPY" }
The same call with curl, Python and JavaScript
curl https://clickapis.com/v1/performance \
-H "Authorization: Bearer $CLICKAPIS_KEY" \
-H "Content-Type: application/json" \
-d '{"symbol":"MSFT","start_date":"2016-01-01","benchmark":"SPY"}'import os, requests
r = requests.post(
"https://clickapis.com/v1/performance",
headers={"Authorization": f"Bearer {os.environ['CLICKAPIS_KEY']}"},
json={
"symbol": "MSFT",
"start_date": "2016-01-01",
"benchmark": "SPY"
},
timeout=60,
)
print(r.json()["data"])const r = await fetch("https://clickapis.com/v1/performance", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.CLICKAPIS_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"symbol": "MSFT",
"start_date": "2016-01-01",
"benchmark": "SPY"
}),
});
console.log((await r.json()).data);Example response
{ "ok": true, "data": { "symbol": "MSFT", "start": "2016-01-04", "end": "2026-11-12", "last_close": 521.89, "returns": { "1d": 0.001468, "1w": -0.026197, "1m": -0.035591, "3m": 0.061831, "6m": 0.285064, "ytd": 0.085981, "1y": 0.02945, "3y": 0.444878, "5y": 0.615058, "10y": 8.959733, "max": 9.947976, "since": "2016-01-04", "3y_annualized": 0.130517, "5y_annualized": 0.100621, "10y_annualized": 0.258418 }, "bars_per_year": 250.7, "risk": { "days": 2731, "annual_return": 0.245655, "annual_volatility": 0.274939, "sharpe": 0.936359, "sortino": 1.395959, "max_drawdown": -0.371499, "calmar": 0.661254, "best_day": 0.15505, "worst_day": -0.147401, "up_days_pct": 0.534969, "avg_up_day": 0.012112, "avg_down_day": -0.011855, "skew": 0.280358, "excess_kurtosis": 8.739985, "var_95_1d": 0.026629, "cvar_95_1d": 0.038566, "var_99_1d": 0.042883, "cvar_99_1d": 0.060305 }, "vs_benchmark": { "benchmark": "SPY", "days": 2731, "beta": 1.177276, "correlation": 0.756801, "alpha_annual": 0.077741, "r_squared": 0.572747, "tracking_error": 0.182906, "information_ratio": 0.574099, "up_capture": 1.2372, "down_capture": 1.143882, "excess_return_total": 6.485207 }, "interval": "1day" }, "meta": { "op": "performance", "units": 4, "cost_usd": 0.0, "billing": "internal", "free_call": false, "free_calls_left": 0, "balance_usd": 5.0, "ms": 79, "interval": "1day", "data_as_of": "2026-11-12", "partial_last_bar": false } }
Every response has the same envelope: ok, data and meta (op, units, cost_usd, ms, interval, billing, balance_usd, data_as_of, partial_last_bar). Numbers are decimals (0.05 = 5%), dates ISO, and a value that cannot be computed is null.