How to build a Kalshi bot
A practical outline for building a bot on the Kalshi API, with links to the official docs and to public Kalshi bots you can study.
Last updated . Facts below come from the official documentation linked at the end, checked Oct 13, 2026. This is not financial advice; check that the platform is available to you and read its terms.
Steps
- Read the API docs. Kalshi publishes REST and WebSocket APIs at docs.kalshi.com.
- Start in the demo environment. Kalshi offers a demo environment with mock funds at demo.kalshi.co. Its REST root is
https://external-api.demo.kalshi.co/trade-api/v2. Demo and production credentials are separate. - Create an API key. In account settings, create a key pair (Ed25519 by default, or RSA). Save the private key immediately: Kalshi does not store it and it cannot be shown again.
- Sign each request. Send
KALSHI-ACCESS-KEY,KALSHI-ACCESS-TIMESTAMP(ms) andKALSHI-ACCESS-SIGNATURE. The signature covers timestamp + HTTP method + path, without query parameters. - Read market data, then place small orders. Pull markets and order books, log everything, and test order logic in demo before using real funds.
- Study working code. The public examples below show how others structured market makers, arbitrage scanners and forecasting agents.
Public examples to learn from (37 on this site)
- Prediction market analysis framework and dataset (Data & analytics; Python, Parquet)
- CloddsBot autonomous trading agent (Forecasting agents; TypeScript, LLMs)
- PMXT: 'CCXT for prediction markets' (Data & analytics; TypeScript)
- Weather temperature market bot (News & event trading; Python, weather forecasts)
- Awesome Prediction Market Tools list (Other; list)
- Kalshi AI trading toolkit (Forecasting agents; Python, LLMs)
- Rust copy-trading toolkit (Copy trading & alerts; Rust)
- Rust Polymarket–Kalshi arbitrage engine (Arbitrage; Rust)
- Simple Kalshi market maker (Market making; Python, Kalshi API)
- AI-native Kalshi research CLI (Forecasting agents; TypeScript, LLMs)
- Cross-venue arbitrage scanner (Arbitrage; Python)
- BTC hourly arbitrage detector (Arbitrage; Python)
FAQ
Does Kalshi have a test environment?
Yes. Kalshi documents a demo environment with mock funds; its credentials are separate from production.
How are Kalshi API requests authenticated?
Each request is signed with your private key and sent with the key ID, a millisecond timestamp and the signature, per Kalshi’s API key docs.
What language should I use?
Kalshi’s docs show Python and JavaScript samples. Most public Kalshi examples on this site use Python.
Official documentation
Get the weekly digest
New public Kalshi & Polymarket builds, each with a source. No spam.
Form not loading? Subscribe on beehiiv. Handled by beehiiv; see privacy. Unsubscribe any time.