Back to Blog
Kalshi API: The Complete Getting Started Guide (2026)
Guidekalshi apikalshi api documentationkalshi api getting startedkalshi python sdkkalshi api key

Kalshi API: The Complete Getting Started Guide (2026)

How to use the Kalshi API — market data endpoints, RSA API key authentication, the Python SDK, WebSockets, and the demo environment. With code examples.

July 17, 2026Last Updated: July 17, 20264 min readJoseph Francia

Kalshi is the largest CFTC-regulated prediction market in the US, and its API is one of the most complete in the industry — REST, WebSockets, FIX, official Python and TypeScript SDKs, and even a demo environment with fake money. This guide gets you from zero to your first API call, then points you to what matters for real projects.



What You Can Do with the Kalshi API

  • Read market data — events, markets, order books, candlesticks, trades. No authentication required.
  • Trade programmatically — place, amend, and cancel orders; manage positions. Requires an API key.
  • Stream in real time — WebSocket channels for tickers, order book deltas, public trades, and your own fills.
  • Backtest — historical candlesticks and trade data going back through Kalshi's archive endpoints.


Base URLs and Environments

EnvironmentREST base URL
Productionhttps://api.elections.kalshi.com/trade-api/v2
Demo (paper money)https://demo-api.kalshi.co/trade-api/v2

The demo environment is a genuinely underrated feature: you can test order logic end-to-end without risking a cent. Create a separate demo account and demo API key to use it.



Your First Request: No Auth Needed

Market data endpoints are public. This works in your terminal right now:

curl "https://api.elections.kalshi.com/trade-api/v2/markets?limit=5&status=open"

In Python:

import requests

resp = requests.get(
    "https://api.elections.kalshi.com/trade-api/v2/markets",
    params={"limit": 10, "status": "open"},
)
for m in resp.json()["markets"]:
    print(m["ticker"], "-", m["title"], f"yes: {m['yes_bid']}¢")

Note that Kalshi prices are expressed in cents (1–99), which map directly to implied probability.



The Kalshi Data Hierarchy: Series → Events → Markets

Kalshi organizes everything in three levels:

  • Series — a recurring template, e.g., "Monthly Jobs Report" (GET /series)
  • Event — one instance of that series, e.g., the March report (GET /events)
  • Market — a specific binary outcome inside an event, identified by a ticker like CONTROLH-2026-D (GET /markets)

Key public endpoints:

EndpointDescription
GET /eventsAll events, with pagination
GET /events/{ticker}One event and its markets
GET /marketsAll markets, filterable by status
GET /markets/{ticker}One market
GET /markets/{ticker}/orderbookLive order book
GET /markets/{ticker}/candlesticksOHLC history (1m / 1h / 1d)
GET /markets/tradesAll public trades

One quirk worth knowing: Kalshi's order book returns yes bids and no bids only — no asks. In a binary market, a bid for Yes at price X is equivalent to an ask for No at 100−X, so the two sides fully describe the book.



Authentication: RSA API Keys

Trading and portfolio endpoints require an API key. Kalshi uses RSA key pairs rather than simple bearer tokens:

  1. Generate an API key in your account settings (Kalshi can generate the key pair for you, or you provide your own RSA public key).
  2. Store the private key securely — it's shown once and can't be retrieved again.
  3. Sign each request: every authenticated call includes your key ID, a timestamp, and an RSA signature of the request in the headers.

The signing logic is fiddly to hand-roll, which is why the easiest path is the official SDK:

pip install kalshi-python
# Quickstart pattern with the official Python SDK — see docs.kalshi.com for full setup
from kalshi_python import KalshiClient

client = KalshiClient(
    api_key_id="YOUR_KEY_ID",
    private_key_path="kalshi-private-key.pem",
)

balance = client.get_balance()
print("Balance (cents):", balance["balance"])

There's also an official TypeScript SDK and a FIX API for institutional connectivity.



WebSockets: Real-Time Data

Kalshi runs all streaming through a single WebSocket connection with subscribable channels: market ticker, order book deltas, public trades, and (authenticated) your own orders and fills. Note that the WebSocket connection itself requires API key authentication, even for channels that carry public data — a common stumbling block.



Rate Limits

Kalshi uses tiered rate limits with token-based costs per endpoint — your tier determines your read/write budget. Check GET /account/api-limits for your current tier, and consult the rate limits page in the official docs before building anything high-frequency.



Kalshi Is One Platform. Your Users Compare Several.

The Kalshi API is excellent for Kalshi — but Kalshi's price is only half the story. The same event usually trades on Polymarket, PredictIt, and others, at different prices. If you're building a dashboard, bot, or research tool, you'll end up integrating several APIs with incompatible auth schemes (RSA signing here, wallet signatures on Polymarket, plain REST elsewhere) and manually matching PRES-2028-DEM to presidential-2028.

The Prediction Hunt API does that unification for you: 23 endpoints and 7 WebSocket channels across 6 platforms, with a single X-API-Key header and automatic cross-platform entity resolution.

curl -H "X-API-Key: YOUR_API_KEY" \
  "https://prediction.com/api/v2/events"

Start free — 1,000 requests/month, no credit card.



FAQ

Is the Kalshi API free? Market data is free and public. Trading endpoints are free to use but require a funded Kalshi account and an API key.

How do I get a Kalshi API key? In your Kalshi account settings, generate an API key. You'll receive an RSA private key — store it securely; it cannot be retrieved again.

Does Kalshi have a Python SDK? Yes — kalshi-python, plus a TypeScript SDK. Both are documented at docs.kalshi.com.

Can I test without real money? Yes. The demo environment (demo-api.kalshi.co) is a full paper-trading sandbox.

How do I get Kalshi historical data? Candlestick endpoints cover live markets; archived markets move to dedicated /historical/ endpoints after a cutoff.

Building something that needs Kalshi AND Polymarket data? Get a free Prediction Hunt API key and pull both — plus 4 more platforms — in a single call.

Build with this data

Automate your strategies, create arb bots, or build your own dashboard. Free tier includes 1,000 requests/mo across all prediction market platforms.

Related Posts