Docs / Endpoints
Compare
POST/v1/compareunits: 1 + 1 per symboldaily
Several symbols side by side over the same dates: total return, CAGR, volatility, Sharpe, max drawdown, beta, and a growth-of-1 series for charting.
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.
Parameters
| Field | Type | Default | Description |
|---|---|---|---|
symbolsrequired | array of string | — | 2–20 tickers. |
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 | — | Optional benchmark for beta and correlation. |
Example request
Compare the megacaps since 2023 Read the walkthrough →
Request
POST /v1/compare{ "symbols": [ "AAPL", "MSFT", "NVDA", "AMZN", "GOOGL", "META" ], "start_date": "2023-01-01", "benchmark": "SPY" }
The same call with curl, Python and JavaScript
curl https://clickapis.com/v1/compare \
-H "Authorization: Bearer $CLICKAPIS_KEY" \
-H "Content-Type: application/json" \
-d '{"symbols":["AAPL","MSFT","NVDA","AMZN","GOOGL","META"],"start_date":"2023-01-01","benchmark":"SPY"}'import os, requests
r = requests.post(
"https://clickapis.com/v1/compare",
headers={"Authorization": f"Bearer {os.environ['CLICKAPIS_KEY']}"},
json={
"symbols": [
"AAPL",
"MSFT",
"NVDA",
"AMZN",
"GOOGL",
"META"
],
"start_date": "2023-01-01",
"benchmark": "SPY"
},
timeout=60,
)
print(r.json()["data"])const r = await fetch("https://clickapis.com/v1/compare", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.CLICKAPIS_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"symbols": [
"AAPL",
"MSFT",
"NVDA",
"AMZN",
"GOOGL",
"META"
],
"start_date": "2023-01-01",
"benchmark": "SPY"
}),
});
console.log((await r.json()).data);Example response
Response 200 OK
{ "ok": true, "data": { "symbols": [ "AAPL", "MSFT", "NVDA", "AMZN", "GOOGL", "META" ], "start": "2023-01-03", "end": "2026-11-12", "days": 970, "rows": [ { "symbol": "AAPL", "name": "Apple Inc.", "start_close": 122.88, "end_close": 355.3, "total_return": 1.891439, "annual_return": 0.316091, "annual_volatility": 0.256636, "sharpe": 1.198334, "sortino": 1.8195, "max_drawdown": -0.33358, "best_day": 0.153236, "worst_day": -0.092441, "beta": 1.049675, "correlation_to_benchmark": 0.61443, "excess_return": 0.81441 }, { "symbol": "MSFT", "name": "Microsoft Corporation", "start_close": 232.5, "end_close": 521.89, "total_return": 1.244688, "annual_return": 0.232653, "annual_volatility": 0.264478, "sharpe": 0.922056, "sortino": 1.431072, "max_drawdown": -0.344971, "best_day": 0.15505, "worst_day": -0.099939, "beta": 1.024766, "correlation_to_benchmark": 0.582064, "excess_return": 0.167659 }, { "symbol": "NVDA", "name": "NVIDIA Corporation", "start_close": 14.27, "end_close": 164.13, "total_return": 10.501752, "annual_return": 0.881092, "annual_volatility": 0.480043, "sharpe": 1.554463, "sortino": 2.478828, "max_drawdown": -0.36887, "best_day": 0.24335, "worst_day": -0.169631, "beta": 2.031573, "correlation_to_benchmark": 0.635752, "excess_return": 9.424723 }, { "symbol": "AMZN", "name": "Amazon.com, Inc.", "start_close": 85.82, "end_close": 267.98, "total_return": 2.122582, "annual_return": 0.342537, "annual_volatility": 0.326191, "sharpe": 1.065188, "sortino": 1.660789, "max_drawdown": -0.308766, "best_day": 0.153206, "worst_day": -0.089791, "beta": 1.401011, "correlation_to_benchmark": 0.645216, "excess_return": 1.045553 }, { "symbol": "GOOGL", "name": "Alphabet Inc.", "start_close": 88.28, "end_close": 299.77, "total_return": 2.395673, "annual_return": 0.371974, "annual_volatility": 0.310816, "sharpe": 1.173524, "sortino": 1.742487, "max_drawdown": -0.306202, "best_day": 0.102246, "worst_day": -0.126412, "beta": 1.178905, "correlation_to_benchmark": 0.569785, "excess_return": 1.318644 }, { "symbol": "META", "name": "Meta Platforms, Inc.", "start_close": 123.66, "end_close": 620.59, "total_return": 4.018519, "annual_return": 0.517863, "annual_volatility": 0.393618, "sharpe": 1.252727, "sortino": 2.104157, "max_drawdown": -0.341505, "best_day": 0.232822, "worst_day": -0.113349, "beta": 1.494992, "correlation_to_benchmark": 0.570558, "excess_return": 2.94149 } ], "ranking": [ { "rank": 1, "symbol": "NVDA", "total_return": 10.501752 }, { "rank": 2, "symbol": "META", "total_return": 4.018519 }, { "rank": 3, "symbol": "GOOGL", "total_return": 2.395673 }, { "rank": 4, "symbol": "AMZN", "total_return": 2.122582 }, { "rank": 5, "symbol": "AAPL", "total_return": 1.891439 }, { "rank": 6, "symbol": "MSFT", "total_return": 1.244688 } ], "correlation": { "symbols": [ "AAPL", "MSFT", "NVDA", "AMZN", "GOOGL", "META" ], "matrix": [ [ 1.0, 0.3796, 0.3089, 0.366, 0.3703, 0.3459 ], [ 0.3796, 1.0, 0.4404, 0.547, 0.3903, 0.4417 ], [ 0.3089, 0.4404, 1.0, 0.4065, 0.3569, 0.4095 ], [ 0.366, 0.547, 0.4065, 1.0, 0.5727, 0.5553 ], [ 0.3703, 0.3903, 0.3569, 0.5727, 1.0, 0.4321 ], [ 0.3459, 0.4417, 0.4095, 0.5553, 0.4321, 1.0 ] ] }, "rebased": { "dates": [ "2023-01-03", "2023-01-06", "2023-01-11", "2023-01-17", "2023-01-20", "… 316 more items …", "2026-11-04", "2026-11-09", "2026-11-12" ], "AAPL": [ 100.0, 103.638, 106.73, 108.691, 110.229, "… 316 more items …", 284.432, 285.392, 289.144 ], "MSFT": [ 100.0, 93.888, 98.413, 100.323, 100.267, "… 316 more items …", 239.054, 234.486, 224.469 ], "NVDA": [ 100.0, 103.784, 111.773, 123.616, 124.597, "… 316 more items …", 1402.453, 1252.067, 1150.175 ], "AMZN": [ 100.0, 100.303, 110.802, 111.92, 113.319, "… 316 more items …", 309.986, 311.035, 312.258 ], "GOOGL": [ 100.0, 98.006, 102.696, 102.435, 109.991, "… 316 more items …", 327.288, 326.405, 339.567 ], "META": [ 100.0, 104.229, 106.534, 108.507, 111.726, "… 316 more items …", 509.461, 518.656, 501.852 ], "SPY": [ 100.0, 101.906, 103.858, 104.451, 103.954, "… 316 more items …", 210.575, 206.698, 207.703 ] }, "benchmark": { "symbol": "SPY", "total_return": 1.077029, "annual_volatility": 0.150223, "max_drawdown": -0.187548 } }, "meta": { "op": "compare", "units": 7, "cost_usd": 0.0, "billing": "internal", "free_call": false, "free_calls_left": 0, "balance_usd": 5.0, "ms": 76, "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.