Kalshi Backtest & Historical Data: Order Books & Trades
Backtest Kalshi with AymarData’s live-recorded series — pull daily Parquet files over REST, start from free samples, then graduate to full-day shards.
Kalshi recording is forward-only from 2026-10-01 (~1.10M messages as of 2026-10-25). Daily files via GET /v1/files are the reliable research path while REST market listing expands.
Series pages under /data/kalshi document tickers, schema and drivers for crypto, indices, macro and more.
Inputs
What you need to backtest Kalshi properly
What a serious backtest needs beyond candles.
Series + contract tickers
Kalshi markets are contract-specific (e.g. KXBTCD-…). Use series hubs to understand the ladder, then pull files for the day you care about.
YES/NO book semantics
Prices are probabilities in dollars (0–1). Treat fees and settlement rules explicitly in P&L.
Forward-only history
Do not assume pre-2026-10-01 history. Coverage grows daily.
Coverage
Live Kalshi coverage
Per-series weighted counts are on /data/kalshi/* pages.
Messages recorded
~1.10M
Since 2026-10-01
Days covered
25
Forward-only
Avg events/day
44,000
As of
2026-10-25
Code
End-to-end Kalshi data pull (REST + requests)
Lists Kalshi files for a date and downloads a trades (or assets) Parquet shard.
import os
import requests
API = "https://api.aymardata.com/v1"
KEY = os.environ["AYMARDATA_API_KEY"] # export AYMARDATA_API_KEY=ad_live_…
H = {"Authorization": f"Bearer {KEY}", "User-Agent": "aymardata-backtest/1.0"}
# Kalshi books/trades over REST are expanding; daily files are queryable now.
# End-to-end: list Kalshi files for a date, prefer trades, fall back to assets.
def list_files(source: str, date: str):
r = requests.get(
f"{API}/files",
headers=H,
params={"source": source, "date": date},
timeout=60,
)
r.raise_for_status()
return r.json()["data"]
DATE = "2026-10-24"
files = list_files("kalshi", DATE)
trades = [f for f in files if "/table=trades/" in f["path"]]
assets = [f for f in files if "/table=assets/" in f["path"]]
pick = (trades or assets)[0]
print(f"kalshi files={len(files)} trades={len(trades)} assets={len(assets)}")
print("fetching", pick["path"])
blob = requests.get(pick["url"], timeout=120)
blob.raise_for_status()
out = f"/tmp/kalshi-{DATE}.parquet"
open(out, "wb").write(blob.content)
print("saved", out, "bytes", len(blob.content))
try:
import pyarrow.parquet as pq
table = pq.read_table(out)
print("columns", table.column_names[:12])
print("rows", table.num_rows)
except Exception as e:
print("parquet inspect skipped:", e)
API base https://api.aymardata.com. Set AYMARDATA_API_KEY from your dashboard. Examples use requests. Any P&L, win-rate, or edge figure derived from these snippets is illustrative output — not a real result.
Free samples
Download sample CSV / Parquet
No key required — small files for schema and local smoke tests.
FAQ
Common questions
Can I query a single Kalshi ticker over /v1/trades today?
Market listing is expanding. The supported research path right now is /v1/files for the date, plus the free sample files on this page.
Where do I see series-level docs?
Start at the Kalshi data hub, then open series such as KXBTCD.
Related
Data pages and guides
Catalog leaves for schema and samples; guides for longer walkthroughs.
Run your first backtest with real ticks
Get a key, paste the snippet above, then expand to the full catalog.
Educational content, not trading or investment advice. Past data doesn't predict future results.