Developers
REST API
Build trading bots, market analytics, or anything else. The Kalsshi API is RESTful, JSON, and authenticated with API keys.
Authentication
Generate an API key from your Account & security page, then send it as a Bearer token on every request:
curl https://your-domain/api/positions \ -H "Authorization: Bearer pred_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Base URL
Use the host you're viewing this page on:
https://your-domainEndpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/events | List markets. Filters: ?category=, ?featured=1, ?q= |
| GET | /api/events/[slug] | Single market with options + price history |
| GET | /api/events/by-slug/[slug] | Lightweight lookup (id + title) |
| GET | /api/events/by-slug/[slug]/news | Recent news + AI summary (when keys configured) |
| GET | /api/events/by-slug/[slug]/sponsor | Sponsor metadata if any |
| GET | /api/orderbook/[optionId] | Aggregated bids/asks per side |
| GET | /api/leaderboard | Top profit / volume / predictions |
| POST | /api/trades | Place a market trade { optionId or (eventSlug+optionLabel), side, action, quantity, priceCents } |
| GET | /api/trades?status=open|closed | List your trades |
| POST | /api/limit-orders | Create a limit order { optionId, side, action, quantity, limitPriceCents, expiresInHours? } |
| GET | /api/limit-orders?status=open|history | List your limit orders |
| DELETE | /api/limit-orders/[id] | Cancel a limit order |
| GET | /api/positions | Current positions + portfolio summary |
| POST | /api/positions/[id]/protections | Set stop-loss / take-profit { stopLossProbBps?, takeProfitProbBps? } |
| POST | /api/auth/register | { email, password, firstName?, lastName?, referralCode?, inviteCode? } |
| POST | /api/auth/login | { email, password } — also awards daily streak |
| GET | /api/auth/me | Current user |
| GET | /api/me/streak | Streak counter + next bonus |
| GET | /api/me/badges | Earned + locked badges |
| GET | /api/me/referral | Your referral code, link, count, total earned |
| GET | /api/me/xp | XP + level + progress to next level |
| GET | /api/me/notifications | Notification feed; POST { markAllRead | id } |
| GET | /api/me/trades/export | Download all trades as CSV |
| GET/PATCH | /api/me/preferences | Bio + dark mode |
| POST | /api/me/avatar | Multipart upload (jpeg/png/webp/gif, max 2MB) |
| GET/POST/DELETE | /api/me/trade-notes | Private trading-journal notes |
| GET/POST/DELETE | /api/me/webhooks | Subscribe a URL to event payloads (HMAC signed) |
| GET/POST/DELETE | /api/watchlist | Bookmarked markets |
| POST/DELETE | /api/follow/[userId] | Follow / unfollow another user |
| GET/POST/DELETE | /api/copy-trader | Mirror another trader's trades (scaffolded) |
| GET | /api/users/[username] | Public profile + stats |
| GET | /api/posts?eventSlug=... | Discussion posts for a market |
| POST | /api/posts | Create a post |
| POST | /api/posts/[id]/like | Toggle like |
| GET/POST | /api/posts/[id]/comments | Comments thread |
| POST | /api/reports | Report content { targetType: POST|COMMENT|USER, targetId, reason } |
| GET | /api/trending-users | Currently popular traders |
| GET/POST | /api/challenges | Head-to-head challenges |
| POST | /api/challenges/[code]/accept | Accept a challenge by invite code |
| GET/POST | /api/market-suggestions | Suggest a new market for admin review |
| POST | /api/events/[id]/dispute | Dispute a resolution { reason, evidenceUrl? } |
| GET | /api/tournaments | Active tournaments |
| GET | /api/tournaments/[slug] | Tournament + leaderboard |
| POST | /api/tournaments/[slug]/join | Join a tournament |
| GET | /api/cricket/live | Live cricket matches (when CricketAPI configured) |
| POST | /api/deposits | Submit a deposit (currently disabled — pre-launch) |
| POST | /api/withdrawals | Request a withdrawal (currently disabled — pre-launch) |
| GET | /api/payment-gateways?mode=deposit | Available payment methods |
| GET | /api/flags | Public feature-flag map for client-side checks |
Example: place a trade
curl -X POST https://your-domain/api/trades \
-H "Authorization: Bearer pred_..." \
-H "Content-Type: application/json" \
-d '{
"eventSlug": "fed-rate-cut-june",
"optionLabel": "Yes",
"side": "YES",
"action": "BUY",
"quantity": 10,
"priceCents": 34
}'Rate limit: 60 requests / minute. Errors return JSON with an error field and an appropriate HTTP status (400 for validation, 401 for auth, 402 for insufficient funds, 409 for state conflicts).