Read-only public data from Kalshi, a CFTC-regulated US prediction-market exchange whose contract prices read directly as event probabilities, covering live and archived markets. Market data needs no account or API key; the margin_* functions read your own perps account with one.
Kalshi is a CFTC-regulated exchange for event contracts. A contract pays $1 if its question resolves YES and $0 if it resolves NO, so its price is the market's implied probability of that outcome.
How the data is shaped
Kalshi nests in three levels, and nearly every question starts by picking one at the top:
- Series — a recurring question, such as KXBTCD for the Bitcoin daily price. This is the level the
series table lists, and its ticker is the key almost everything else requires.
- Event — one occurrence of a series, with a single resolution date.
- Market — one strike within an event. This is what actually trades, and its ticker is what the per-market lookups take.
Reading prices
Every *_dollars column is dollars per contract between 0 and 1, so a best bid of 0.62 is a 62% implied probability. They are DECIMAL, never DOUBLE: Kalshi sends exact fixed-point strings, and rounding them through a float would throw that away silently. Contract counts (*_fp) are decimals for the same reason.
Access
No credentials are needed for market data. Kalshi's whole market-data surface is public. The four margin_* functions (margin_positions, margin_balance, margin_risk, margin_funding_history) read the key holder's own perps account and need a kalshi secret; RSA and Ed25519 keys both work, and a read-only key is the right kind. Order entry and transfers are out of reach: the worker has no write verb and its account paths are a fixed allowlist. Read-only by construction, not by configuration.
Rate limits
Unauthenticated traffic is limited tightly enough that a handful of back-to-back requests draws an HTTP 429. A correlated LATERAL issues one request per input row, so a join across a whole series is hundreds of calls. Requests are retried with exponential backoff, and the per-market functions take a cache_ttl argument that turns repeated lookups of the same ticker into cache hits when a few seconds of staleness is acceptable.
Sources
- Kalshi — the exchange this data comes from.
- Kalshi API documentation — the public Trade API v2 this worker reads (
https://api.elections.kalshi.com/trade-api/v2): series, events, markets, order books, candlesticks, trades, exchange status and the historical archive.
- Rate limits and tiers — the request budget that
cache_ttl and the retry backoff are built around.
- API keys — needed for the
margin_* account functions, or to sign market-data requests at a higher rate-limit tier, via a kalshi secret.
- Perps API — the
/margin endpoints the account functions read.
Terms of use
The market data is Kalshi Inc.'s, not covered by this worker's MIT license, and is subject to the Kalshi Data Terms of Use and the Kalshi Developer Agreement. The Developer Agreement limits API use to facilitating a member's own trading on the exchange and restricts storing, aggregating or sharing the data without Kalshi's written authorization; read both before using this worker. This worker is not affiliated with or endorsed by Kalshi.