Skip to main content
Kalshi logo

Overview

Add Kalshi to any ModuleX agent or workflow. Access Kalshi prediction markets and trade event contracts against the Kalshi Trade API v2 (api.elections.kalshi.com/trade-api/v2). Retrieve markets, events, series, orderbooks, trades, and candlesticks; manage your balance, positions, orders, fills, and settlements; check exchange status; and place, cancel, or amend orders.
Categories: Finance & Payments · Prediction Markets · Data Analytics · Auth: API Key · Actions: 22

Authentication

API Key Authentication

Authenticate with a Kalshi API key id and its RSA private key. Each request is signed with the private key (RSA-PSS over SHA-256); the signing material never leaves the runtime.
1

Step 1

Sign in at https://kalshi.com and open Account → API Keys.
2

Step 2

Create a new API key; download the RSA private key (PEM) and copy the Key ID.
3

Step 3

Paste the Key ID into KALSHI_KEY_ID below.
4

Step 4

Paste the full PEM private key into KALSHI_PRIVATE_KEY below.

Required Credentials

Available Actions

Parameters

string
Filter by market status: “unopened”, “open”, “closed”, “settled”
string
Filter by series ticker
string
Filter by event ticker
integer
Min created timestamp (Unix seconds)
integer
Max created timestamp (Unix seconds)
integer
Min updated timestamp (Unix seconds)
integer
Min close timestamp (Unix seconds)
integer
Max close timestamp (Unix seconds)
integer
Min settled timestamp (Unix seconds)
integer
Max settled timestamp (Unix seconds)
string
Comma-separated list of market tickers
string
Multivariate event filter: “only” or “exclude”
integer
Number of results to return (1-1000)
string
Pagination cursor from a previous response

Response

Parameters

string
required
Market ticker identifier (e.g., ‘KXBTC-24DEC31’)

Response

Parameters

string
Filter by event status: “open”, “closed”, “settled”
string
Filter by series ticker
string
Include nested markets: “true” or “false”
string
Include milestones: “true” or “false”
integer
Min close timestamp (Unix seconds)
integer
Number of results to return (1-200)
string
Pagination cursor from a previous response

Response

Parameters

string
required
Event ticker identifier
string
Include nested markets: “true” or “false”

Response

Parameters

string
required
Kalshi API Key ID (provided by the credential system)
string
required
Kalshi RSA private key in PEM format (provided by the credential system)

Response

Parameters

string
required
Kalshi API Key ID (provided by the credential system)
string
required
Kalshi RSA private key in PEM format (provided by the credential system)
string
Filter by market ticker
string
Filter by event ticker (max 10, comma-separated)
string
Comma-separated non-zero fields: position, total_traded
string
Subaccount identifier
integer
Number of results to return (1-1000)
string
Pagination cursor from a previous response

Response

Parameters

string
required
Kalshi API Key ID (provided by the credential system)
string
required
Kalshi RSA private key in PEM format (provided by the credential system)
string
Filter by market ticker
string
Filter by event ticker (max 10, comma-separated)
string
Filter by status: “resting”, “canceled”, “executed”
string
Minimum timestamp filter (Unix timestamp)
string
Maximum timestamp filter (Unix timestamp)
string
Subaccount identifier
integer
Number of results to return (1-1000)
string
Pagination cursor from a previous response

Response

Parameters

string
required
Kalshi API Key ID (provided by the credential system)
string
required
Kalshi RSA private key in PEM format (provided by the credential system)
string
required
Order ID to retrieve

Response

Parameters

string
required
Market ticker identifier
integer
Number of price levels to return

Response

Parameters

string
Filter by market ticker
integer
Minimum timestamp (Unix seconds)
integer
Maximum timestamp (Unix seconds)
integer
Number of results to return (1-1000)
string
Pagination cursor from a previous response

Response

Parameters

string
required
Series ticker identifier
string
required
Market ticker identifier
integer
required
Start timestamp (Unix seconds)
integer
required
End timestamp (Unix seconds)
integer
required
Period interval: 1 (minute), 60 (hour), 1440 (day)

Response

Parameters

string
required
Series ticker identifier
string
required
Event ticker identifier
integer
required
Start timestamp (Unix seconds)
integer
required
End timestamp (Unix seconds)
integer
required
Period interval: 1 (minute), 60 (hour), 1440 (day)

Response

Parameters

string
required
Kalshi API Key ID (provided by the credential system)
string
required
Kalshi RSA private key in PEM format (provided by the credential system)
string
Filter by market ticker
string
Filter by order ID
integer
Minimum timestamp (Unix seconds)
integer
Maximum timestamp (Unix seconds)
string
Subaccount identifier
integer
Number of results to return (1-1000)
string
Pagination cursor from a previous response

Response

Parameters

string
required
Kalshi API Key ID (provided by the credential system)
string
required
Kalshi RSA private key in PEM format (provided by the credential system)
string
Filter by market ticker
string
Filter by event ticker
integer
Min settled timestamp (Unix seconds)
integer
Max settled timestamp (Unix seconds)
string
Subaccount number (0 primary, 1-63)
integer
Number of results to return (1-1000)
string
Pagination cursor from a previous response

Response

Parameters

string
required
Series ticker identifier
string
Include volume data: “true” or “false”

Response

Parameters

string
Filter by category
string
Filter by comma-separated tags
string
Include product metadata: “true” or “false”
string
Include volume data: “true” or “false”
integer
Min updated timestamp (Unix seconds)

Response

Response

Response

Response

Parameters

string
required
Kalshi API Key ID (provided by the credential system)
string
required
Kalshi RSA private key in PEM format (provided by the credential system)
string
required
Market ticker identifier
string
required
Order side: “yes” or “no”
string
required
Action type: “buy” or “sell”
integer
Number of contracts to trade (provide count or count_fp)
string
Order type: “limit” or “market” (default “limit”)
integer
Yes price in cents (1-99)
integer
No price in cents (1-99)
string
Yes price in dollars (e.g., ‘0.56’)
string
No price in dollars (e.g., ‘0.56’)
string
Custom order identifier
integer
Unix timestamp for order expiration
string
TIF: fill_or_kill / good_till_canceled / immediate_or_cancel
integer
Maximum cost in cents (auto-enables fill_or_kill)
boolean
Maker-only order
boolean
Position reduction only
string
Self-trade prevention: ‘taker_at_cross’ or ‘maker’
string
Associated order group ID
string
Count in fixed-point for fractional contracts
boolean
Cancel order on market pause
string
Subaccount to use for the order

Response

Parameters

string
required
Kalshi API Key ID (provided by the credential system)
string
required
Kalshi RSA private key in PEM format (provided by the credential system)
string
required
Order ID to cancel

Response

Parameters

string
required
Kalshi API Key ID (provided by the credential system)
string
required
Kalshi RSA private key in PEM format (provided by the credential system)
string
required
Order ID to amend
string
required
Market ticker identifier
string
required
Order side: “yes” or “no”
string
required
Action type: “buy” or “sell”
string
Original client-specified order ID
string
New client-specified order ID
integer
Updated quantity for the order
integer
Updated yes price in cents (1-99)
integer
Updated no price in cents (1-99)
string
Updated yes price in dollars
string
Updated no price in dollars
string
Count in fixed-point for fractional contracts

Response

Limits & Quotas

  • Base URL: https://api.elections.kalshi.com/trade-api/v2.
  • Pricing: prices and counts are returned in cents (and as fixed-point _fp / dollar string variants where the API provides them).
  • Rate limits: Kalshi enforces per-tier request rate limits; consult the official docs for current values. Authenticated portfolio and trading calls are signed per request, so clock skew on the host can cause signature rejections — keep the system clock in sync.
  • Error model: non-2xx responses, timeouts, invalid private keys, and unexpected exceptions are caught and returned as success=False + error rather than raising. On failure the data fields stay at their defaults.

Coinbase

CoinMarketCap

Grafana