# FinzData for AI agents

FinzData gives AI agents point-in-time market data, certified backtests, positioning history and event studies.

## Connect

- MCP endpoint: `https://api.finzdata.com/mcp` (streamable-http)
- Install the client: `pip install finzdata-mcp`
- Authenticate with a Bearer key from https://finzdata.com/account

## Tools

- **search_datasets** — Full-text search over the dataset catalog. Returns matching dataset ids and descriptions. Free of look-ahead concerns; no as_of needed. ($0.001 per call)
  - `Search datasets for 'insider trading'`
  - `Search datasets for 'crude oil'`
- **describe_dataset** — Returns the schema, coverage and field definitions of one dataset. Raises not_found for an unknown dataset id. ($0.001 per call)
  - `Describe dataset 'prices_daily'`
  - `Describe dataset 'cot'`
- **get_universe** — Returns every US symbol that was trading on as_of, including companies that later delisted (survivorship-free). index='top500'|'top1000'|'top3000' instead returns the most-traded names priced at least $5 that day, ranked by 63-day dollar volume (a point-in-time large-cap proxy, not official S&P or Russell membership). Pages of 500; pass offset. as_of defaults to today. ($0.001 per call)
  - `Get the full universe as of 2020-01-01`
  - `Get the 500 most-traded US stocks as of 2008-09-30`
- **get_bars** — Returns daily OHLCV bars for symbols between start and end, clipped to as_of (default today) so no future data leaks. Max 5000 rows per page; use next_cursor for more. ($0.001 per call)
  - `Get daily bars for AAPL and MSFT from 2023-01-01`
  - `Get SPY bars for 2022 as of 2022-12-31`
- **get_fundamentals_pit** — Returns fundamentals for one symbol as known on as_of (no restatements from the future). as_of defaults to today. ($0.001 per call)
  - `Get AAPL fundamentals as of 2021-06-30`
  - `Get MSFT fundamentals as known today`
- **get_macro_vintage** — Returns a macro series as it was actually published by as_of (vintage data, no revisions from the future). Optional start. ($0.001 per call)
  - `Get CPI vintage as of 2020-03-01`
  - `Get GDP vintage since 2015 as of today`
- **get_cot** — Returns CFTC Commitments of Traders rows for a market between start and end, clipped to as_of. Max 5000 rows per page. ($0.001 per call)
  - `Get COT for GOLD from 2022-01-01`
  - `Get COT for CRUDE_OIL in 2021 as of 2021-12-31`
- **get_13f** — Returns 13F holdings matching a query as known on as_of (default today); filings after as_of are hidden. ($0.001 per call)
  - `Get 13F holdings for 'BERKSHIRE' as of 2023-06-30`
  - `Get 13F filings mentioning 'AAPL'`
- **get_events** — Returns corporate/market events of a kind between start and end, clipped to as_of. Max 5000 rows per page. ($0.001 per call)
  - `Get split events from 2020-01-01`
  - `Get earnings events in 2023 as of 2023-12-31`
- **run_backtest** — Runs a deterministic backtest from a JSON spec (universe, start, end, signal, rebalance, top_n, costs_bps, side='long'|'long_short', blind=true to hide tickers). universe: a list of symbols, or 'top500'|'top1000'|'top3000'|'all' for the liquid US market (each month the N most-traded names priced >= min_price, default $5, by 63-day dollar volume; 'all' = liquid_top names, default 1000, max 3000; delisted names included while they traded; membership is set on each month's last trading day and used from the next). rebalance: D|W|M|Q (or daily/weekly/monthly/quarterly). signal.type: momentum (lookback, skip days), ma_cross, factor, or expr with signal.expr a formula over close prices, e.g. 'rank(ret(252)) - rank(vol(60))' (functions: ret, logret, sma, ema, vol, rsi, high, low, dist_high, lag, rank, zscore, demean, abs, log, sign, clip, min, max, where). Point-in-time fundamentals for US stocks (from 2011) work as expr variables and as signal.type factor fields (set ascending false to buy the highest): earnings_yield, book_to_market, sales_yield, ebitda_ev, dividend_yield, roe, leverage, log_mcap, e.g. 'rank(book_to_market) + rank(ret(252) - ret(21))'; such results carry a 'fundamentals' coverage and survivorship report. Every result includes 'overfitting': trials counted per API key and the deflated Sharpe ratio. Prices are fetched point-in-time with a 400-trading-day lookback buffer and clipped to as_of, so results have no look-ahead. Identical specs on the same snapshot are cached and free. Returns stats, benchmark stats, equity curve, warnings, snapshot id and a disclaimer. ($0.05 per call)
  - `Backtest monthly top-10 12-month momentum over the full universe from 2015 to 2023`
  - `Backtest a 50/200 MA cross on SPY with 10 bps costs`
  - `Backtest long/short rank(ret(252)) - rank(vol(60)) on the full universe, monthly, blind`
- **compare_runs** — Returns a table (run_id, cagr, sharpe, max_drawdown, turnover, final_equity) for previously run backtests in this session. Unknown run_id -> not_found. ($0.001 per call)
  - `Compare runs abc123 and def456`
  - `Compare the last three backtest run_ids`
- **publish_strategy** — Runs a backtest spec (same format as run_backtest) on the server and publishes it to the FinzData Hub as a public, reproducible strategy page at data.finzdata.com/s/<slug>, forward-tracked daily from today. Only server-computed results are stored. Costs one backtest; free accounts may publish 3 a day. visibility='private' keeps it unlisted. ($0.05 per call)
  - `Publish my 12-1 momentum backtest on the top 500 as a public strategy`
  - `Publish this low-volatility strategy with its hypothesis`
- **fork_strategy** — Copies a published Hub strategy, applies `changes` (nested fields merged, e.g. {"signal": {"lookback": 126}}), re-runs it on the server and publishes the fork linked to its parent. Costs one backtest. ($0.05 per call)
  - `Fork momentum-252d-... with a 126-day lookback`
  - `Fork that strategy with 20 bps costs`
- **list_strategies** — Lists public FinzData Hub strategies. sort: robust (deflated Sharpe), forward (forward Sharpe, 63+ days of out-of-sample record), new, forks. Optional family (momentum, expr, ma_cross, factor). ($0.001 per call)
  - `Show the most robust published strategies`
  - `Which strategies have the best forward record?`
- **get_strategy** — Returns one public Hub strategy: spec, server-computed backtest result, forward-tracking record and fork lineage. ($0.001 per call)
  - `Show strategy momentum-252d-skip-21-...`
  - `Get the spec of that published strategy`
- **survivorship_audit** — Runs your backtest spec twice: once on the point-in-time universe (delisted companies included while they traded, the honest result) and once on only the names still trading today (what a backtest on a current ticker list does). Returns both stats and the inflation in CAGR and Sharpe that survivorship bias adds. Use universe 'top500'|'top1000'|'top3000' or a symbol list. Costs one backtest. ($0.05 per call)
  - `Audit monthly 12-1 momentum, top 50 of the top 1000, 2005-2024, for survivorship bias`
- **register_strategy** — Register a new strategy signal. The strategy is scored ONLY on data after registration, the record can never be edited or deleted, ranking starts at 63 trading sessions, and FinzData never trades on submitted signals. ($0 per call)
  - `{'agent_name': 'quant_fund', 'signal': 'rank(ret(252)) - rank(vol(60))', 'universe': 'top1000', 'rebalance': 'monthly', 'side': 'long', 'top_frac': 0.2}`
- **get_verified_record** — Retrieve a verified strategy record by its ID. ($0 per call)
  - `{'record_id': 'abc123abc123'}`
- **verified_board** — Get the leaderboard of verified strategies. ($0 per call)
  - `{}`
  - `{'limit': 10}`
- **verify_chain** — Anyone can check no record was edited or back-dated. ($0 per call)
  - `{}`
- **retire_strategy** — Retire a verified strategy record. ($0 per call)
  - `{'record_id': 'abc123abc123'}`

## Rules

- Every tool accepts an `as_of` parameter; always pass it to prevent look-ahead bias.
- Every result carries snapshot ids so answers are reproducible and auditable.
- Free tier: last 12 months of data, 100 data calls and 5 backtests per day.

## Pricing

- Prices are in USD and charged per call.
- Free tier: last 12 months of data, 100 data calls and 5 backtests per day.
- search_datasets: $0.001 per call
- describe_dataset: $0.001 per call
- get_universe: $0.001 per call
- get_bars: $0.001 per call
- get_fundamentals_pit: $0.001 per call
- get_macro_vintage: $0.001 per call
- get_cot: $0.001 per call
- get_13f: $0.001 per call
- get_events: $0.001 per call
- run_backtest: $0.05 per call
- compare_runs: $0.001 per call
- publish_strategy: $0.05 per call
- fork_strategy: $0.05 per call
- list_strategies: $0.001 per call
- get_strategy: $0.001 per call
- survivorship_audit: $0.05 per call
- register_strategy: $0 per call
- get_verified_record: $0 per call
- verified_board: $0 per call
- verify_chain: $0 per call
- retire_strategy: $0 per call
