# ClickAPIs > Financial markets analytics API. Send a question about one or more instruments as JSON and get computed answers back: snapshots, performance and risk, drawdowns, seasonality, return distributions, support and resistance, correlation, comparisons, portfolio risk, event studies, backtests, screens, movers, sector performance and peers. Pay per use from prepaid credits. Also an MCP server for AI agents. - Base URL: https://clickapis.com/v1 — every operation is POST /v1/ with a JSON body. - Auth: header `Authorization: Bearer ` (keys start with ck_live_). Read the key from env CLICKAPIS_KEY. - Reply: {"ok": true, "data": {...}, "meta": {op, units, cost_usd, ms, interval, billing, balance_usd, data_as_of, partial_last_bar}} or {"ok": false, "error": {code, message}}. - Numbers are decimals (0.05 = 5%). Dates ISO YYYY-MM-DD. Uncomputable values are null. - Price: $0.50 per 1,000 units; intraday intervals cost 5x. Failed calls are free. - MCP: POST https://clickapis.com/mcp (Streamable HTTP), same Bearer key. ## Operations ### POST /v1/snapshot — Snapshot Everything about one symbol today in a single call: period returns, trend, momentum, volatility regime, 52-week range, volume, one-year risk and the signals active on the latest bar. Units: 3 (daily only) Parameters: - symbol (string, required): Ticker, e.g. NVDA, BRK-B, BTCUSD. - benchmark (string, default "SPY"): Benchmark used for relative statistics. - as_of_date (date): YYYY-MM-DD. Compute the snapshot as it looked at the close of this date. Example body: {"symbol":"NVDA"} ### POST /v1/performance — Performance & risk 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. Units: 2 + 1 per decade of history (intraday allowed, x5) Parameters: - symbol (string, required): 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, default "SPY"): Benchmark for beta, alpha, capture and tracking error. - risk_free_rate (number, default 0): Annual risk-free rate as a decimal (0.04 = 4%), used by Sharpe and Sortino. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"MSFT","start_date":"2016-01-01","benchmark":"SPY"} ### POST /v1/query — Query Evaluate any expressions over a symbol’s history and keep only the bars where a condition holds. Same expression language as screens, event studies and backtests. Units: 1 + expressions × decades (intraday allowed, x5) Parameters: - symbol (string, required): Ticker. - select (array of string, required): Columns to compute, each "expr as name" or a bare expression. - where (string (expression)): Keep only bars where this condition is true. - 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. - sort (string, default "date"): Column name to sort by (a name from select, or date). - order ("asc" | "desc", default "desc"): Sort direction. - limit (integer, default 100): Rows to return, ≤ 5000. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"AAPL","select":["close","ret as day_return","rvol(20) as rel_volume","close / sma(200) - 1 as dist_200d"],"where":"rvol(20) > 3","limit":10} ### POST /v1/drawdowns — Drawdowns Every drawdown episode: peak, trough, depth, bars to the trough and to recovery, the current drawdown and the share of time spent under water. Units: 2 (intraday allowed, x5) Parameters: - symbol (string, required): 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. - limit (integer, default 10): How many of the deepest episodes to return. - min_depth (number, default 0.05): Ignore declines shallower than this (0.05 = 5%). - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"QQQ","limit":5,"min_depth":0.1} ### POST /v1/seasonality — Seasonality Average, median, win rate and t-statistic for each calendar month and weekday, the best and worst years, and a year-by-month grid. Units: 2 (daily only) Parameters: - symbol (string, required): Ticker. - start_year (integer): First year. Default: 20 years before end_year. - end_year (integer): Last year. Default: the last complete year. Example body: {"symbol":"SPY","start_year":2006,"end_year":2025} ### POST /v1/distribution — Return distribution The distribution of returns over a horizon: percentiles, skew and fat tails, a histogram, how often moves beyond given thresholds happen, and where the latest move sits. Units: 2 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker. - horizon_bars (integer, default 1): Return horizon in bars (1 = one day on daily bars, one hour on 1hour bars). - 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. - bins (integer, default 30): Histogram bins. - thresholds (array of number, default [0.02, 0.05]): Move sizes to count, as decimals. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"TSLA","horizon_bars":1,"thresholds":[0.03,0.05,0.1]} ### POST /v1/levels — Support & resistance Support and resistance levels from clustered swing highs and lows, with touches and distance from the last close, plus pivot points and the position in the range. Units: 2 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker. - lookback_bars (integer, default 120): How many bars to search for swing points. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"SPY","lookback_bars":250} ### POST /v1/correlation — Correlation Correlation matrix over a window, the most and least correlated pairs, annualised volatilities, and a rolling correlation for the first pair. Units: 1 + 1 per symbol (daily only) Parameters: - symbols (array of string, required): 2–50 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. - lookback_days (integer, default 252): Window in trading days when no dates are given. - method ("pearson" | "spearman" | "kendall", default "pearson"): Correlation method. - on ("returns" | "log_returns" | "prices", default "returns"): Series to correlate. - frequency ("daily" | "weekly" | "monthly", default "daily"): Resample before correlating. - rolling_window (integer, default 60): Window for the rolling correlation of the first pair. Example body: {"symbols":["SPY","TLT","GLD","BTCUSD"],"lookback_days":252,"rolling_window":60} ### POST /v1/compare — Compare 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. Units: 1 + 1 per symbol (daily only) Parameters: - symbols (array of string, required): 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 body: {"symbols":["AAPL","MSFT","NVDA","AMZN","GOOGL","META"],"start_date":"2023-01-01","benchmark":"SPY"} ### POST /v1/risk — Portfolio risk Portfolio volatility, historical and parametric VaR and CVaR (in money with a portfolio value), each holding’s share of risk, diversification ratio, beta and the worst days. Units: 2 + 1 per holding (daily only) Parameters: - symbols (array of string, required): 1–100 tickers. - weights (array of number, default equal): Weights in the order of symbols; normalised to sum to 1. - lookback_days (integer, default 252): Window in trading days. - benchmark (string, default "SPY"): Benchmark for portfolio beta. - portfolio_value (number): Notional; adds VaR and CVaR in money. - confidence_levels (array of number, default [0.95, 0.99]): VaR confidence levels. Example body: {"symbols":["SPY","AGG"],"weights":[0.6,0.4],"portfolio_value":1000000,"confidence_levels":[0.95,0.99]} ### POST /v1/event-study — Event study Every time a condition was true, what happened next: forward returns at several horizons, win rate, and the edge over all other bars with t-statistics. Pool up to 100 symbols in one call. Units: 3 per symbol (intraday allowed, x5) Parameters: - symbols (array of string, required): 1–100 tickers (one ticker for intraday). - condition (string (expression), required): When the event happens, e.g. rsi(14) < 30 and close > sma(200). - horizons (array of integer, default [1, 5, 10, 20, 60]): Forward horizons in bars. - cooldown_bars (integer): Ignore repeat signals within this many bars of the last one. - 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. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbols":["QQQ"],"condition":"streak() == -3","horizons":[1,5,20],"start_date":"2010-01-01"} ### POST /v1/backtest — Backtest Rule-based backtest with entry and exit expressions, stops, targets, time limits, fees and slippage, filled at the next open with no look-ahead. Returns statistics against buy-and-hold, every trade and the equity curve. Units: 5 + 1 per decade (intraday allowed, x5) Parameters: - symbol (string, required): Ticker. - entry (string (expression), required): Enter when true. - exit (string (expression)): Exit when true. Without it, exits come from stops, targets or max_bars. - side ("long" | "short", default "long"): Trade direction. - 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. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. - initial_capital (number, default 10000): Starting equity. - position_size (number, default 1.0): Fraction of equity per trade (0–1). - stop_loss (number): Exit at this loss from entry (0.08 = 8%). - take_profit (number): Exit at this gain from entry. - trailing_stop (number): Exit when price falls this far from the best price since entry. - max_bars (integer): Exit after this many bars. - cooldown_bars (integer, default 0): Bars to wait after an exit before a new entry. - fill ("next_open" | "close", default "next_open"): Fill price for signals. - fee_bps (number, default 1): Fee per side in basis points. - slippage_bps (number, default 2): Slippage per side in basis points. - benchmark (string): Compare with this symbol as well as buy-and-hold. Example body: {"symbol":"SPY","entry":"cross_above(sma(50), sma(200))","exit":"cross_below(sma(50), sma(200))","start_date":"2000-01-01","stop_loss":0.08,"trailing_stop":0.15,"fee_bps":1,"slippage_bps":2} ### POST /v1/screen — Screen Run a condition across a universe or your own list, add computed columns and sort. Returns the symbols that match on the latest bar. Units: 1 per 10 symbols scanned (daily only) Parameters: - universe (string, default "us.top500"): One of us.top100, us.top500, us.top1000, us.etf.top100, us.etf.top500. - symbols (array of string): Your own list instead of a universe, ≤ 1000. - where (string (expression)): Keep symbols where this is true on the latest bar. - select (array of string, default []): Columns, each "expr as name". - sort (string (expression)): Expression to rank by. - order ("asc" | "desc", default "desc"): Sort direction. - limit (integer, default 50): Rows to return, ≤ 500. Example body: {"universe":"us.top500","where":"rsi(14) < 30 and close > sma(200)","select":["rsi(14) as rsi","ret(20) as ret_20d","dist_high(252) as off_high"],"sort":"rsi(14)","order":"asc","limit":25} ### POST /v1/movers — Movers Biggest gainers, losers, gappers, volume surges or widest ranges in a universe over the last day, five days or month. Units: 1 per 10 symbols (daily only) Parameters: - universe (string, default "us.top500"): Universe to rank. - metric ("change" | "gap" | "volume_ratio" | "range", default "change"): What to rank by. - period ("1d" | "5d" | "1m", default "1d"): Look-back period. - direction ("up" | "down", default "up"): Largest positive or largest negative values. - limit (integer, default 20): Rows to return, ≤ 500. Example body: {"universe":"us.top500","metric":"gap","period":"1d","direction":"up","limit":10} ### POST /v1/sectors — Sectors Sector performance across a universe: median return per sector over several periods, breadth (share above the 50-day average) and the leading sector for each period. Units: 1 per 10 symbols (daily only) Parameters: - universe (string, default "us.top1000"): Universe to group. - periods (array of string, default ["1d","1w","1m","3m","ytd","1y"]): Any of 1d 1w 1m 3m ytd 1y; sorted by the first. Example body: {"universe":"us.top1000","periods":["1w","1m","3m","ytd"]} ### POST /v1/peers — Peers The instruments that behave most like a symbol: same sector and industry, ranked by a similarity score that includes one-year return correlation. Units: 3 (daily only) Parameters: - symbol (string, required): Ticker. - limit (integer, default 10): How many peers to return. Example body: {"symbol":"AAPL","limit":8} ### POST /v1/trader-stats — Trader statistics How a symbol trades: the win rate of days, weeks, months and years, average and largest up and down moves, the longest winning and losing streaks, volume on up versus down days, and a year-by-year table. Units: 2 (intraday allowed, x5) Parameters: - symbol (string, required): 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. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"SPY","start_date":"2010-01-01"} ### POST /v1/volatility — Volatility Realised volatility with five estimators (close-to-close, Parkinson, Garman-Klass, Rogers-Satchell, Yang-Zhang) over several windows, the volatility cone with today’s percentile in each window, and a regime label. Units: 3 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker. - windows (array of integer, default [10, 20, 60, 120, 252]): Rolling windows in bars, 5–1000, up to 8. - start_date (date): YYYY-MM-DD. First date of the history behind the cone. Default: all history. - end_date (date): YYYY-MM-DD. Last date to include. Default: the latest bar. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"TSLA"} ### POST /v1/volume-profile — Volume profile Volume by price over the lookback: the point of control, the value area high and low, high- and low-volume nodes, and where the current price sits in the profile. Units: 2 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker. - lookback_bars (integer, default 120): Bars to build the profile from, 10–2000. - bins (integer, default 30): Equal price bins, 5–200. - value_area (number, default 0.7): Share of volume inside the value area (0.5–0.95). - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"NVDA"} ### POST /v1/unusual-volume — Unusual volume Every volume spike (volume at least threshold times its average) with the return that day and 1, 5 and 20 bars later, and what followed up-day and down-day spikes compared with all bars. Units: 2 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker. - window (integer, default 20): Bars in the average volume, 5–252. - threshold (number, default 3): Spike when volume ÷ average volume is at least this (1.2–50). - start_date (date): YYYY-MM-DD. Only count spikes from this date. Averages use earlier bars. - end_date (date): YYYY-MM-DD. Last date to include. Default: the latest bar. - limit (integer, default 50): Spikes to list, newest first, ≤ 500. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"AAPL","start_date":"2015-01-01"} ### POST /v1/gaps — Gaps Opening gaps up and down: how often they fill the same day and within N days, how long filling takes, open-to-close and next-five-day returns by gap size, and the recent gaps that are still open. Units: 2 (daily only) Parameters: - symbol (string, required): Ticker. - min_gap (number, default 0.01): Smallest |open ÷ previous close − 1| that counts (0.01 = 1%). - fill_bars (integer, default 5): Report the share of gaps filled within this many days (1–60). - 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. - limit (integer, default 20): Recent and unfilled gaps to list, ≤ 200. Example body: {"symbol":"TSLA","min_gap":0.03,"start_date":"2020-01-01"} ### POST /v1/streaks — Streaks Runs of consecutive up and down closes: how long they last, the current streak and how often one that long carried on, and what happened over the next bar and next five bars after an N-day up or down streak. Units: 2 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker. - max_n (integer, default 7): Report what followed streaks of 1 to max_n bars (1–15). - 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. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"QQQ"} ### POST /v1/candles — Candlestick patterns Seventeen candlestick patterns with stated rules (doji, hammer, engulfing, harami, piercing line, stars, three soldiers and crows, marubozu): occurrences, forward returns and win rates against all bars, the latest occurrences and the patterns on the last bar. Units: 3 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker. - patterns (array of string, default all): Any of doji hammer hanging_man inverted_hammer shooting_star bullish_engulfing bearish_engulfing bullish_harami bearish_harami piercing_line dark_cloud_cover morning_star evening_star three_white_soldiers three_black_crows bullish_marubozu bearish_marubozu. - horizons (array of integer, default [1, 5, 10]): Forward horizons in bars, up to 5. - start_date (date): YYYY-MM-DD. Only count patterns from this date. - end_date (date): YYYY-MM-DD. Last date to include. Default: the latest bar. - recent (integer, default 20): Latest occurrences to list, ≤ 200. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"SPY","start_date":"2005-01-01"} ### POST /v1/signals — Technical signals Twenty-three technical signals (golden and death crosses, RSI, MACD, Bollinger breaks, 52-week highs and lows, ADX, volume breakouts, SMA and stochastic crosses): which fired recently, and how each one has done on this symbol before. Units: 5 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker. - signals (array of string, default all): Signal names to evaluate, e.g. golden_cross, rsi_oversold, macd_bullish_cross, new_52w_high, volume_breakout. Default: all 23. - recent_bars (integer, default 5): A signal is active when it fired within this many bars (1–60). - horizons (array of integer, default [5, 20]): Forward horizons in bars for each signal’s history, up to 4. - cooldown_bars (integer, default 5): Minimum bars between counted occurrences. - start_date (date): YYYY-MM-DD. Only count occurrences from this date. Indicators use earlier bars. - end_date (date): YYYY-MM-DD. Last date to include. Default: the latest bar. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"NVDA"} ### POST /v1/best-days — Best & worst days The best and worst days with dates, what buy-and-hold returned against missing the best (or the worst, or both) 5, 10, 20 or 30 days, and how closely the best days cluster around the worst ones. Units: 2 (daily only) Parameters: - symbol (string, required): Ticker. - top_n (integer, default 10): Best and worst days to list, ≤ 100. - miss_counts (array of integer, default [5, 10, 20, 30]): How many best (and worst) days to leave out, up to 8 values. - 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. Example body: {"symbol":"SPY","start_date":"2000-01-01"} ### POST /v1/earnings-moves — Earnings moves How a stock reacted to every earnings report, measured on the right day for before-the-open and after-the-close reports: the gap, the day’s move, the close-to-close reaction and the 5- and 20-day drift, with move statistics, beats against misses and the next report date. Units: 3 (daily only) Parameters: - symbol (string, required): Ticker of a company (not a fund or ETF). - start_date (date): YYYY-MM-DD. Only reports from this date. - end_date (date): YYYY-MM-DD. Only reports up to this date. - limit (integer, default 20): Reports to list, newest first, ≤ 200. Statistics use every report. Example body: {"symbol":"NVDA"} ### POST /v1/dividends — Dividends Dividend history adjusted for splits, annual totals, 1, 3, 5 and 10-year growth, consecutive years of increases, payment frequency, trailing and forward yield, and where today’s yield sits in its own history. Stocks and ETFs. Units: 2 (daily only) Parameters: - symbol (string, required): Ticker. - limit (integer, default 40): Payments to list, newest first, ≤ 500. - yield_years (integer, default 10): Years of month-end yields behind the yield percentile (1–40). Example body: {"symbol":"KO"} ### POST /v1/fibonacci — Fibonacci levels Fibonacci retracements (23.6% to 78.6%) and extensions (127.2% to 261.8%) of the dominant swing in the lookback, with prices, distances from the last close and the nearest support and resistance. Units: 1 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker. - lookback_bars (integer, default 252): Bars to find the swing high and low in, 10–5000. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"AAPL"} ### POST /v1/factors — Factor exposures OLS of excess returns on ETF factor proxies (market, size, value, momentum, quality, low volatility, or your own long/short legs): betas, t-stats, R², annual alpha, residual volatility and a rolling 1-year market beta. Units: 5 (daily only) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - factors (array of object): Custom factor list [{name, long, short?}]. Default: market SPY, size IWM-SPY, value IWD-IWF, momentum MTUM-SPY, quality QUAL-SPY, low_vol USMV-SPY. Each item: {name, long, short?}. - frequency ("daily" | "weekly", default "daily"): Regress daily returns, or weekly returns (last close of each calendar week). - start_date (date): First date (YYYY-MM-DD). When given, lookback_days is ignored. - end_date (date): Last date to include (YYYY-MM-DD). Default: the latest bar. - lookback_days (integer, default 756): Trading days of history when start_date is not given (756 = 3 years). - risk_free_rate (number, default 0.0): Annual risk-free rate (0.04 = 4%) subtracted from the asset and from one-legged factors. - rolling_window (integer): Window (observations) of the rolling beta on the first factor. Default: 252 daily / 52 weekly (1 year). - newey_west_lags (integer, default 0): 0 = OLS standard errors; > 0 = Newey-West HAC standard errors with that many lags. Example body: {"symbol":"AAPL"} ### POST /v1/liquidity — Liquidity Average and median dollar volume (20/60/252 days), Amihud illiquidity, Roll and Corwin-Schultz spread estimates, turnover, volume variability and an optional liquidity percentile within a universe. Units: 2 (+1 per 10 symbols with compare_universe) (daily only) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - window_bars (integer, default 252): Bars used for the spread and illiquidity estimates (20-2520). - compare_universe ("us.top100" | "us.top500" | "us.top1000" | "us.etf.top100" | "us.etf.top500"): Optional universe for a liquidity percentile (median 60-day dollar volume). Adds 1 unit per 10 symbols. Example body: {"symbol":"SMCI","compare_universe":"us.top500"} ### POST /v1/range — Range & ATR True range and ATR with its regime percentile, inside/outside days, NR4/NR7 bars and what followed them, average range by weekday and expansion/contraction streaks. Units: 2 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - atr_period (integer, default 14): ATR period in bars (Wilder smoothing). - percentile_bars (integer, default 1260): Bars of ATR% history the current ATR% is ranked against (1260 = ~5 years daily). - start_date (date): First date to include (YYYY-MM-DD). Default: all available history. - end_date (date): Last date to include (YYYY-MM-DD). Default: the latest bar. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"TSLA"} ### POST /v1/skew — Skew & tails Rolling skewness and kurtosis with their percentiles, up vs down volatility, tail ratio, 3-sigma counts and the largest down days. Units: 2 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - windows (array of integer, default [63, 252]): Rolling windows in bars for skewness and kurtosis (63 = a quarter, 252 = a year). - worst_days (integer, default 10): How many worst (and best) days to list. - start_date (date): First date to include (YYYY-MM-DD). Default: all available history. - end_date (date): Last date to include (YYYY-MM-DD). Default: the latest bar. - max_points (integer, default 260): Points of the rolling series to return (latest). - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"SPY"} ### POST /v1/herding — Herding Cross-sectional dispersion (CSSD, CSAD) across a universe, the Chang-Cheng-Khorana herding regression, the extreme-market-day test and a rolling CSAD series. Units: 1 per 10 symbols (daily only) Parameters: - universe ("us.top100" | "us.top500" | "us.top1000" | "us.etf.top100" | "us.etf.top500", default "us.top100"): Cross-section to test (ignored when symbols is given). - symbols (array of string): Your own cross-section (10-500 symbols) instead of a universe. - start_date (date): First date (YYYY-MM-DD). When given, lookback_days is ignored. - end_date (date): Last date to include (YYYY-MM-DD). Default: the latest bar. - lookback_days (integer, default 504): Trading days to test when start_date is not given (504 = 2 years). - rolling_window (integer, default 60): Window (days) of the rolling average CSAD series. - extreme_pct (number, default 0.05): Tail share of market days treated as extreme in the Christie-Huang test (0.05 = 5% each side). - newey_west_lags (integer, default 5): Newey-West lags for the regression t-stats (0 = plain OLS). - max_points (integer, default 260): Points of the rolling CSAD series to return. Example body: {"universe":"us.top100"} ### POST /v1/attribution — Return attribution Portfolio total return split into additive contributions by holding, by sector and by month (best and worst contributor), buy-and-hold or rebalanced. Units: 2 + 1 per symbol (daily only) Parameters: - symbols (array of string, required): 1 to 100 holdings. - weights (array of number): One starting weight per symbol (negative = short), normalised by gross exposure. Default: equal weight. - start_date (date): First date (YYYY-MM-DD). Default: one year before end_date. - end_date (date): Last date to include (YYYY-MM-DD). Default: the latest bar. - rebalance ("none" | "monthly" | "quarterly", default "none"): none = buy and hold (weights drift); monthly / quarterly = reset to the target weights at the first close of each period. - benchmark (string, default "SPY"): Benchmark for active return, or null. Example body: {"symbols":["AAPL","MSFT","NVDA","JPM","XOM"],"weights":[0.3,0.25,0.2,0.15,0.1]} ### POST /v1/stress — Stress test Portfolio return, max drawdown and worst day through historical crises (2008, 2011, 2015, 2018, 2020, 2022, 2023) and your own windows, contributions per holding, plus beta-scaled benchmark shocks. Units: 3 + 1 per symbol (daily only) Parameters: - symbols (array of string, required): 1 to 100 holdings. - weights (array of number): One weight per symbol (negative = short), normalised by gross exposure. Default: equal weight. - portfolio_value (number): Portfolio value, to also express losses in money. - benchmark (string, default "SPY"): Benchmark for window returns and the beta shocks, or null. - custom_windows (array of object, default []): Extra windows [{name, start_date, end_date}]. Each item: {name, start_date, end_date}. - include_historical (boolean, default true): Run the built-in historical windows (GFC 2008-09, euro 2011, Aug 2015, Q4 2018, COVID 2020, 2022 rate shock, Mar 2023 banks). - shocks (array of number, default [-0.1, -0.2, -0.3]): Hypothetical benchmark moves (-0.2 = -20%) applied through each holding's 1-year beta. Example body: {"symbols":["SPY","TLT"],"weights":[0.6,0.4],"portfolio_value":1000000} ### POST /v1/zscore — Z-score & mean reversion Z-score of price vs its 20/50/200-bar averages and of recent returns, with how often and how fast past 2-sigma excursions reverted and the AR(1) half-life. Units: 2 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - windows (array of integer, default [20, 50, 200]): Moving-average windows n for z = (close - sma(n)) / stdev(close, n). - threshold (number, default 2.0): |z| that counts as an excursion (2 = two stdevs). - revert_to (number, default 0.0): An excursion has reverted when z crosses back through +/- this level (0 = the moving average). - max_bars (integer, default 60): Bars allowed for a reversion to count. - max_points (integer, default 120): Points of the z series to return (latest). - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"NVDA"} ### POST /v1/regime — Market regime Each bar classified as bull/sideways/bear x low/normal/high volatility: the current regime, time in each, transition probabilities and forward returns by regime. Units: 3 (daily only) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - sma_bars (integer, default 200): Moving average that defines the trend. - slope_bars (integer, default 20): Bars over which the moving average's slope is measured. - slope_threshold (number, default 0.01): Minimum moving-average change over slope_bars for bull/bear (0.01 = 1%); smaller moves = sideways. - vol_window (integer, default 20): Realised-volatility window in bars. - vol_percentile_window (integer, default 756): Bars of history the volatility is ranked against (low <= 25th pct, high > 75th). - horizon_bars (integer, default 20): Forward return horizon for regime statistics. - max_points (integer, default 260): Points of the regime series to return (latest). Example body: {"symbol":"SPY"} ### POST /v1/price-actions — Price-action setups Inside-bar and NR7 breakouts, outside and key reversals, 3-bar reversals, 20-EMA pullbacks and 52-week-high retests: occurrences, forward returns and win rate vs baseline, and which are active now. Units: 3 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - setups (array of "inside_bar_breakout_up"|"inside_bar_breakout_down"|"nr7_breakout_up"|"nr7_breakout_down"|"outside_reversal_bull"|"outside_reversal_bear"|"pullback_to_20ema_uptrend"|"three_bar_reversal_bull"|"three_bar_reversal_bear"|"key_reversal_bull"|"key_reversal_bear"|"high52_breakout_retest"): Setups to report. Default: all 12. - horizons (array of integer, default [1, 5, 10]): Forward horizons in bars, measured from the signal bar's close. - start_date (date): Only count setups on or after this date. Indicators use earlier bars. - end_date (date): Only count setups on or before this date. - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"QQQ"} ### POST /v1/patterns — Chart patterns Double tops/bottoms, head & shoulders, triangles, wedges and flags from zigzag swing points, with breakout levels, targets, status, and this symbol's history of what followed confirmed patterns. Units: 5 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - min_move (number, default 0.05): Zigzag reversal size that makes a swing point (0.05 = 5%). Smaller = more, smaller patterns. - tolerance (number, default 0.03): Price tolerance for 'equal' tops/bottoms and flat triangle sides (0.03 = 3%). - lookback_bars (integer, default 250): Return patterns whose last swing point is within this many bars. - types (array of "double_top"|"double_bottom"|"head_and_shoulders"|"inverse_head_and_shoulders"|"ascending_triangle"|"descending_triangle"|"symmetric_triangle"|"rising_wedge"|"falling_wedge"|"bull_flag"|"bear_flag"): Pattern types to look for. Default: all 11. - horizons (array of integer, default [10, 20]): Forward horizons (bars) for the historical statistics after confirmed breakouts. - limit (integer, default 20): Maximum patterns to return (most recent first). - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"AAPL"} ### POST /v1/entry-exit — Entry & exit plan ATR, chandelier and swing stops, R-multiple and level targets, reward/risk, position size for your account and risk, and how often the stop or the 2R target was hit first in the past. Units: 3 (intraday allowed, x5) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - side ("long" | "short", default "long"): Trade direction. - entry_price (number): Planned entry. Default: the last close. - stop_method ("atr" | "chandelier" | "swing", default "atr"): Stop used for targets and sizing: atr (entry -/+ atr_mult x ATR), chandelier (extreme of chandelier_bars -/+ chandelier_mult x ATR) or swing (nearest swing low/high). - atr_period (integer, default 14): ATR period in bars. - atr_mult (number, default 2.0): ATR multiple for the atr stop. - chandelier_bars (integer, default 22): Lookback for the chandelier stop's highest high / lowest low. - chandelier_mult (number, default 3.0): ATR multiple for the chandelier stop. - risk_per_trade (number, default 0.01): Share of the account risked if the stop is hit (0.01 = 1%). - account_size (number): Account value, for the position size. - targets_r (array of number, default [1.0, 2.0, 3.0]): Profit targets as multiples of the risk (R). - sim_target_r (number, default 2.0): Target (in R) for the historical stop-vs-target test. - max_bars (integer, default 60): Bars a simulated trade may last before it counts as neither. - sim_years (integer, default 10): Years of history for the simulation (daily). - interval (string, default "1day"): "1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday. Example body: {"symbol":"MSFT","account_size":100000} ### POST /v1/trends — Trend analysis Regression channels (slope per year, R², position), trend age vs the 200-day average, ADX and DI, swing structure (higher highs/lows) and a daily/weekly/monthly trend table. Units: 2 (daily only) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - channels (array of integer, default [50, 100, 200]): Regression-channel lengths in bars. - end_date (date): Compute as of this date (YYYY-MM-DD). Default: the latest bar. Example body: {"symbol":"AAPL"} ### POST /v1/intraday-vwap — Intraday VWAP Session VWAP with 1 and 2 standard-deviation bands, time above VWAP, current deviation, an anchored VWAP and the VWAP of previous sessions, on 1min or 5min bars. Units: 3 x intraday multiplier (intraday allowed, x5) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - interval ("1min" | "5min", required): Bar size: "1min" (about 5 days of history) or "5min" (30 days). Units are multiplied by the intraday multiplier (5). - date (date): Session to analyse (YYYY-MM-DD). Default: the latest session. - anchor_time (string (HH:MM)): Optional anchored-VWAP start, HH:MM US/Eastern (e.g. "10:30"). - prev_sessions (integer, default 5): Earlier sessions whose final VWAP and close are listed. - max_points (integer, default 400): Maximum points of the VWAP/band series. Example body: {"symbol":"SPY","interval":"5min"} ### POST /v1/intraday-levels — Intraday levels Opening ranges (5/15/30 min) and breakouts, prior-day high/low/close, gap, floor pivots, round numbers and the distance to each, plus opening-range breakout follow-through over earlier sessions. Units: 3 x intraday multiplier (intraday allowed, x5) Parameters: - symbol (string, required): Ticker symbol, e.g. AAPL, SPY, BTC-USD. - interval ("1min" | "5min", required): Bar size: "1min" (about 5 days of history) or "5min" (30 days, more sessions for the breakout statistics). - date (date): Session (YYYY-MM-DD). Default: the latest. - opening_range_minutes (array of integer, default [5, 15, 30]): Opening-range lengths in minutes from 09:30. - stats_or_minutes (integer, default 30): Opening range used for the breakout follow-through statistics over earlier sessions. - sessions (integer, default 20): Earlier sessions to include in the statistics (limited by the interval's history). Example body: {"symbol":"AAPL","interval":"5min"} ### POST /v1/pairs — Pairs analysis Hedge ratio (static and rolling), spread and z-score, Engle-Granger cointegration with a MacKinnon p-value, half-life, correlation, z-band signals and a no-look-ahead backtest. Units: 5 (daily only) Parameters: - symbol_a (string, required): First symbol (the one regressed). - symbol_b (string, required): Second symbol (the hedge). - start_date (date): First date (YYYY-MM-DD). When given, lookback_days is ignored. - end_date (date): Last date to include (YYYY-MM-DD). Default: the latest bar. - lookback_days (integer, default 504): Most recent common trading days when start_date is not given. - use_log (boolean, default true): Regress log prices (true) or price levels (false). - hedge_window (integer, default 60): Window of the rolling hedge ratio used by the backtest. - z_window (integer, default 60): Window of the rolling spread z-score. - entry_z (number, default 2.0): Open a trade when |z| exceeds this. - exit_z (number, default 0.5): Close when z comes back inside +/- this. - stop_z (number, default 4.0): Close when |z| exceeds this (null = no stop). - fee_bps (number, default 0.0): Cost per leg per side in basis points. - max_points (integer, default 120): Points of the spread / z series to return. Example body: {"symbol_a":"EWA","symbol_b":"EWC"} ### POST /v1/signal-dashboard — Signal dashboard A matrix of 13 scored signals per symbol (trend, momentum, RSI, MACD, Bollinger, stochastic, 52-week range, volume, volatility, MA cross, z-score, ADX) with a composite score, breadth and sorting. Units: 1 per symbol (daily only) Parameters: - symbols (array of string): Up to 50 symbols. - universe ("us.top100" | "us.etf.top100"): Or a small universe (us.top100 or us.etf.top100) instead of symbols. - sort ("composite" | "trend" | "momentum_3m" | "momentum_12m" | "rsi" | "macd" | "bollinger" | "stochastic" | "range_52w" | "volume" | "volatility" | "ma_cross" | "zscore" | "adx", default "composite"): Sort by the composite score or one signal's score. - order ("asc" | "desc", default "desc"): desc = most bullish first. - limit (integer, default 50): Rows to return. Example body: {"symbols":["AAPL","MSFT","NVDA","GOOGL","AMZN","META","TSLA","AVGO"]} ### POST /v1/rank — Multi-factor rank Rank a list or universe by a weighted composite of z-scored metrics (momentum, volatility, Sharpe, drawdown, RSI, distance from high, liquidity) or your own expressions, with ranks and percentiles. Units: 1 per 10 symbols (daily only) Parameters: - universe ("us.top100" | "us.top500" | "us.top1000" | "us.etf.top100" | "us.etf.top500", default "us.top100"): Universe to rank (ignored when symbols is given). - symbols (array of string): Your own list (2-1000). - factors (array of object, default [{"metric": "momentum_12_1", "weight": 1.0}, {"metric": "volatility", "weight": 0.5}]): Weighted factors [{metric | expr, weight, higher_is_better}]. Metrics: momentum_1m/3m/6m/12m, momentum_12_1, volatility, sharpe_1y, max_drawdown_1y, rsi, dist_52w_high, liquidity. Each item: {metric?, expr?, name?, weight?, higher_is_better?}. - order ("asc" | "desc", default "desc"): desc = best composite first. - missing ("zero" | "drop", default "zero"): zero = a missing factor counts as average (z 0); drop = leave the symbol out. - limit (integer, default 50): Rows to return. Example body: [] All operations also accept `async: true` (returns 202 with job_id; poll GET /v1/jobs/{id}) and `webhook_url` (https). ## Free endpoints GET /v1/me, /v1/usage?days=30, /v1/symbols?q=, /v1/universes, /v1/catalog (no key), /v1/jobs, /v1/jobs/{id}; DELETE /v1/jobs/{id}; POST /v1/webhooks/test; GET /v1/webhooks/deliveries?limit=. ## Expression language Used by screen (where, select, sort), event-study (condition), backtest (entry, exit) and query (select, where). Evaluated per bar over the history; parsed by the ClickAPIs engine, never executed as code. Operators: + - * / ; comparisons < <= > >= == != (1 or 0); and, or, not; x[n] = value n bars ago; 10% = 0.10. A condition is true when > 0; null is false. Name columns with `expr as name`. Windows are whole-number literals. Limits: 2000 chars, 60 calls, windows <= 5000 bars. Fields: - open (o): Opening price of the bar. - high (h): High of the bar. - low (l): Low of the bar. - close (c, price): Closing price (split- and dividend-adjusted on daily bars). - volume (v): Volume. - dollar_volume: close × volume. - hl2: (high + low) / 2. - hlc3: (high + low + close) / 3. - range: high / low − 1: the bar’s range as a decimal. - gap: open / previous close − 1. - ret: Bar return: close / previous close − 1. - day: Day of the month, 1–31. - weekday: 1 = Monday … 7 = Sunday. - month: 1–12. - year: Calendar year. - bar: Bar number from the start of the history (0, 1, 2 …). - pi: The constant π. Functions: - abs(x): Absolute value. - adx(n=14): Average directional index (trend strength, 0-100). - atr(n=14): Average true range (Wilder). - atr_pct(n=14): ATR as a fraction of close. - bb_lower(n=20, k=2): Bollinger band lower (n=20, k=2). - bb_mid(n=20, k=2): Bollinger band mid (n=20, k=2). - bb_pct(n=20, k=2): Bollinger band pct (n=20, k=2). - bb_upper(n=20, k=2): Bollinger band upper (n=20, k=2). - bb_width(n=20, k=2): Bollinger band width (n=20, k=2). - between(x, lo, hi): 1 if lo <= x <= hi. - cci(n=20): Commodity channel index. - change([x,] n): x - x[n]. - count(cond, n): How many of the last n bars the condition was true. count(close > open, 10). - cross_above(a, b): 1 on the bar where a crosses above b. cross_above(sma(50), sma(200)). - cross_below(a, b): 1 on the bar where a crosses below b. - dist_high(n=252): close / highest(high, n) - 1. dist_high(252) = distance from 52-week high. - dist_low(n=252): close / lowest(low, n) - 1. - drawdown(): Distance from the running all-time high of close (0 = at high, -0.2 = 20% below). - ema([x,] n): Exponential moving average. - falling([x,] n): 1 if x is lower than n bars ago. - highest([x,] n): Highest value in the last n bars (default series: high). - log(x): Natural log. - lowest([x,] n): Lowest value in the last n bars (default series: low). - macd(fast=12, slow=26, signal=9): MACD line: ema(12) - ema(26). - macd_hist(12, 26, 9): MACD histogram (line - signal). - macd_signal(12, 26, 9): MACD signal line. - max(a, b): Element-wise maximum of two series. - mfi(n=14): Money flow index, 0-100. - min(a, b): Element-wise minimum of two series. - obv(): On-balance volume. - pct_rank([x,] n): Percentile (0-100) of today's value within the last n bars (n<=1000). - prev(x, n=1): Value n bars ago (same as x[n]). - ret(n) | ret(x, n): Total return over n bars: close / close[n] - 1. ret(20) > 10%. - rising([x,] n): 1 if x is higher than n bars ago. - roc([x,] n): Rate of change: x / x[n] - 1. - rsi([x,] n=14): Wilder RSI, 0-100. rsi(14), rsi(x, 14). - rvol(n=20): Relative volume: volume / sma(volume, n). - sign(x): -1, 0 or 1. - sma([x,] n): Simple moving average. sma(50) = 50-bar average close; sma(volume, 20). - sqrt(x): Square root. - stdev([x,] n): Rolling sample standard deviation. - stoch(n=14): Stochastic %K, 0-100. - streak([x]): Consecutive up (+) or down (-) closes. - sum([x,] n): Rolling sum over n bars. - vol(n=20): Annualised realised volatility of daily log returns over n bars (0.25 = 25%). - vwap(n=20): Rolling volume-weighted average price over n bars. - williams_r(n=14): Williams %R, -100..0. - wma([x,] n): Linearly weighted moving average. - zscore([x,] n): (x - sma(x,n)) / stdev(x,n). Examples: - rsi(14) < 30 and close > sma(200) - cross_above(sma(50), sma(200)) - ret(20) > 15% and rvol(20) > 2 - close > prev(highest(high, 252), 1) - count(close > open, 10) >= 8 - streak() == -3 ## Universes us.top100, us.top500, us.top1000 (US common stocks by market cap), us.etf.top100, us.etf.top500 (ETFs by dollar volume). Or pass `symbols`. ## Intraday interval: "1day" (default) | "1hour" (180 days) | "30min" (60 days) | "15min" (60 days) | "5min" (30 days) | "1min" (5 days). Allowed on query, performance, drawdowns, levels, distribution, event-study (one symbol), backtest. Units x5. meta.partial_last_bar marks a forming bar. ## Limits event-study symbols <= 100; risk <= 100; correlation 2-50; compare 2-20; screen symbols <= 1000; screen/movers limit <= 500; query limit <= 5000; 10 open jobs; ~10 requests/s per key. Calls estimated above 1000 units run as jobs automatically. ## Errors 400 BAD_PARAMS, BAD_EXPRESSION (with position), BAD_SYMBOL, BAD_INTERVAL; 401 BAD_KEY; 402 INSUFFICIENT_CREDITS; 403 ACCOUNT_SUSPENDED; 404 UNKNOWN_SYMBOL, NOT_FOUND; 409 NOT_CANCELLABLE; 422 NO_DATA; 429 RATE_LIMITED, TOO_MANY_JOBS; 500 INTERNAL; 503 MAINTENANCE. Failed calls are not charged. ## Webhooks POST to webhook_url with headers X-ClickAPIs-Timestamp and X-ClickAPIs-Signature = "sha256=" + hex HMAC-SHA256(account webhook secret, timestamp + "." + raw_body). Also X-ClickAPIs-Event (job.done | job.failed) and X-ClickAPIs-Delivery (uuid, the same on every retry; use it to skip duplicates). Body: {event, job_id, status, op, data, meta} or {event, job_id, status: "failed", op, error}. Answer 2xx within 10 s; up to 3 attempts; no redirects; public https addresses only. Test a receiver for free: POST /v1/webhooks/test {url, event?: "job.done"|"job.failed", op?} sends a signed sample with "test": true and returns {delivered, status_code, ms, response_excerpt, signature_header, timestamp, body_sent}. 10 per hour. ## MCP URL https://clickapis.com/mcp, Streamable HTTP, Authorization: Bearer . Tools: one per operation (hyphens become underscores, e.g. event_study) plus symbol_search and expression_help. Claude Code: claude mcp add --transport http clickapis https://clickapis.com/mcp --header "Authorization: Bearer $CLICKAPIS_KEY" ## Use The standard service is for personal and internal business use. Redistribution, resale, public display of market data, use in products for other businesses and index creation need a written agreement. Results are analytics, not investment advice.