Kalshi API and Polymarket API: a practical guide to market data (and bots)
Which endpoints give you markets, prices, order books and price history on Kalshi and Polymarket, what needs an API key, and the gotchas we hit running both in production.
Both big prediction markets publish free APIs. You can read markets, prices, order books and price history from Kalshi and Polymarket without an account; you need keys only to trade. We run both in production for this site (live markets, the resolution calendar, the spread scanner and Trends), so this guide focuses on what actually works and what tends to trip people up.
Endpoints and limits as of October 2026. Both companies update their APIs; their official documentation is the final word.
Kalshi API vs Polymarket API at a glance
| Kalshi | Polymarket (global) | |
|---|---|---|
| Base URL for market data | api.elections.kalshi.com/trade-api/v2 | gamma-api.polymarket.com (markets), clob.polymarket.com (prices and books) |
| Public data without a key | Yes | Yes |
| Trading auth | API key + RSA signature on each request | Wallet-signed credentials (L1/L2) |
| Prices | Cents and dollar strings ("0.5600") | Decimals 0–1 |
| Volume unit | Contracts ($1 face value each) | Dollars (USDC) |
| Live data | WebSocket feed | WebSocket feed |
| Test environment | Demo environment with fake money | None; test with small size |
Kalshi API: markets, order books and history
Kalshi organises data as series (a recurring question, like the monthly CPI), events (one instance, like October's CPI) and markets (each Yes/No contract inside the event). The most useful public calls:
# Open events with their markets, 200 per page
curl "https://api.elections.kalshi.com/trade-api/v2/events?status=open&with_nested_markets=true&limit=200"
# Order book for one market
curl "https://api.elections.kalshi.com/trade-api/v2/markets/TICKER/orderbook"
# Hourly candles for the last week (start/end are Unix seconds)
curl "https://api.elections.kalshi.com/trade-api/v2/series/SERIES/markets/TICKER/candlesticks?start_ts=1760000000&end_ts=1760600000&period_interval=60"
Things to know:
- Pagination uses a cursor. Each response returns a
cursor; pass it back to get the next page until it comes back empty. A full read of all open events takes dozens of pages. - Prices come twice. Older integer fields in cents (
yes_bid: 56) sit next to newer dollar strings (yes_bid_dollars: "0.5600"). Read the dollar field and fall back to cents. - Counts can be strings. Newer responses add fixed-point fields such as
volume_fpas strings. Parse them as numbers. - The order book lists bids only. You get bids for Yes and bids for No. A No bid at 40¢ is a Yes ask at 60¢.
- Rate limits are tiered. A basic account allows a limited number of requests per second. Pace pagination and back off on HTTP 429.
To trade, you create an API key in your account settings. Kalshi gives you a key ID and a private RSA key; each request is signed with the private key and sent with the key ID and a timestamp in request headers. Start in Kalshi's demo environment, which mirrors the real API with play money.
Polymarket API: Gamma, CLOB and Data
Polymarket splits its API into three services:
- Gamma API (gamma-api.polymarket.com): the catalogue of events and markets, with titles, tags, volumes and current prices.
- CLOB API (clob.polymarket.com): the order book exchange: books, prices, price history and order placement.
- Data API (data-api.polymarket.com): trades, positions and activity for users and markets.
# Most traded open events
curl "https://gamma-api.polymarket.com/events?closed=false&active=true&order=volume24hr&ascending=false&limit=100"
# Order book for one outcome (token)
curl "https://clob.polymarket.com/book?token_id=TOKEN_ID"
# One week of price history, a point every 2 hours
curl "https://clob.polymarket.com/prices-history?market=TOKEN_ID&interval=1w&fidelity=120"
Gotchas:
- JSON inside JSON. On Gamma markets,
outcomes,outcomePricesandclobTokenIdsare JSON-encoded strings. Parse them a second time. - Pages cap at 100. Asking for a bigger
limitstill returns 100. Step youroffsetby what you actually received, or you will skip markets. - Token IDs, not market IDs. Each outcome has its own token; order books and price history use the token ID from
clobTokenIds. - Multi-outcome events. An election with ten candidates is ten Yes/No markets. Events flagged
negRiskhave exactly one winner.
To trade, orders are signed by your wallet. The official clients (py-clob-client for Python and @polymarket/clob-client for TypeScript) derive API credentials from a wallet signature and handle order signing for you. Polymarket US, the regulated US exchange, is a separate venue with its own accounts; check its own developer documentation.
Building a trading bot: start read-only
Most profitable "bots" are boring: they watch prices and alert a human. Before automating orders:
- Log prices for a few weeks. You will learn how thin some books are and how fast prices move on news.
- Model fees and slippage. A strategy that wins 1¢ per contract before fees often loses after them. See Polymarket fees vs Kalshi fees and what slippage means.
- Use the demo (Kalshi) or tiny size (Polymarket). Bugs in order logic are expensive.
- Watch resolution rules. Two markets with the same title on two platforms can resolve differently. This is the main trap in cross-platform arbitrage.
Kalshi and Polymarket API: frequently asked questions
Is the Kalshi API free?
Yes. Market data is public, and trading through the API costs the same exchange fees as trading in the app.
Do I need an API key for Polymarket data?
No. Gamma, CLOB market data and the Data API are public. You need wallet-derived credentials only to place orders.
Where are the Polymarket API docs?
On Polymarket's developer documentation site, which covers the Gamma, CLOB and Data APIs and the official clients.
Can I get historical prices?
Yes: Kalshi candlesticks per market, and Polymarket's prices-history endpoint per outcome token.
Can I use the APIs to compare prices across platforms?
Yes, that is exactly what our Compare page and spread scanner do, so you can skip building it.



