Kalshi API: The Complete Getting Started Guide (October 2026)
The Kalshi API gives you programmatic access to every event contract on the only CFTC-regulated exchange in the US — market data, order books, order placement, and fills — through a REST interface with RSA-PSS signed authentication. Market data requires an account and API key; trading requires funded positions. This guide covers the parts that matter for building working integrations, with Python examples you can run today.
Kalshi at a glance
| What | Detail |
|---|---|
| Base URL (trading) | trading-api.kalshi.com |
| Auth scheme | RSA-PSS signed API keys |
| Session tokens | Expire every 30 minutes, refresh automatically |
| Official SDKs | Python, TypeScript (handle signing for you) |
| Institutional option | FIX 4.4 protocol |
| Demo environment | Full sandbox with fake funds |
The mental model differs from Polymarket: Kalshi is a traditional exchange with a traditional order book and an authentication layer built like a bank API, while Polymarket is a blockchain CLOB where credentials derive from a wallet key. Kalshi’s approach means no private-key handling in your code — which many teams find easier to audit.
Getting your API keys
In your Kalshi account settings, generate an API key pair. You receive a key ID and a private key (RSA). Every REST request is signed with your private key using RSA-PSS, together with a timestamp, the HTTP method, and the request path. The signature headers prove the request came from you without ever transmitting the private key.
Reading market data in Python
The official Python client handles signing automatically — roughly fifteen lines from import to a live order book:
from kalshi_python import KalshiClient, environments
client = KalshiClient(
host=environments.DEMO, # or PRODUCTION
key="YOUR_KEY_ID",
private_key=open("kalshi_private_key.pem", "rb").read(),
)
# Market data: list active markets in a series
markets = client.get_markets(series_ticker="PRES-2028")
for m in markets.markets:
print(m.ticker, m.yes_bid, m.yes_ask)
Core endpoints worth knowing:
| Endpoint | What it returns |
|---|---|
GET /markets/{ticker}/orderbook |
Full depth for one contract |
GET /markets |
Filterable market lists |
GET /events |
Event groupings with linked markets |
GET /exchange_status |
Trading open/closed |
Placing and cancelling orders
# Place a limit order: buy 10 YES at 54 cents
order = client.create_order(
action="buy",
side="yes",
ticker="PRES-2028-WINNER-DEM",
count=10,
type="limit",
yes_price=54,
)
# Cancel if needed
client.cancel_order(order_id=order.order_id)
Before placing any order, check the book depth first — thin books produce worse fills than the quote suggests, a pattern we cover in depth in the liquidity guide.
WebSockets for real-time data
Kalshi exposes WebSocket channels for order book updates and fills. For any strategy faster than a few minutes, streaming beats polling: lower latency and no rate-limit pressure. The Python SDK includes a WebSocket client that handles reconnection; still, re-request a full order book snapshot after any disconnect so your local state stays consistent.
Why use the demo environment first
The demo environment (environments.DEMO) is a full sandbox with fake funds.
Every strategy should survive paper trading there before touching production
— the API surface is identical, so the migration is a one-line host change.
Most integration bugs (signing, token refresh, order parameter mistakes)
surface identically in demo.
Kalshi vs Polymarket for developers
A quick orientation if you’re coming from Polymarket:
| Kalshi | Polymarket | |
|---|---|---|
| Auth | RSA-PSS API keys | EIP-712 wallet signing → HMAC |
| Settlement | USD (fiat) | USDC on Polygon |
| Regulated | CFTC DCM | Offshore (global) / CFTC via US platform |
| Private key in code | No | Yes (derived credentials) |
| Institutional access | FIX 4.4 | No |
If you build cross-platform tooling, note that the same real-world event trades under different identifiers on each platform — matching those is its own problem, covered in the arbitrage guide.
FAQ
Is the Kalshi API free? Yes. There is no charge for API access; you need a funded account to trade.
Do I need to handle private keys in my code? You hold an RSA private key for signing, but it never leaves your infrastructure and it is not a blockchain key — losing it doesn’t put funds at risk directly, only API access.
What language should I use? Python is the smoothest start — the official client handles RSA-PSS signing and token refresh. TypeScript has an equally official client. Kalshi also speaks FIX 4.4 for institutional-grade latency.
Can I test without real money? Yes — the demo environment provides a full sandbox with fake funds and the identical API surface.
Educational content, not financial advice. Not affiliated with Kalshi. Sources: Kalshi developer documentation, verified October 2026.