↓ Skip to main content
All methods

kalshi_data reference

Every class, method and function in stakepd.kalshi_data on its own page, with parameters, returned columns and examples.

from stakepd import kalshi_data as kd

client = kd.KalshiClient()
markets = client.get_markets(status="open", series_ticker="KXHIGHNY")

New to the module? Start with the Kalshi API guide, which covers installation, authentication and how the data is shaped. ★ marks the methods you’ll use most.

Client

Create a client. Market data needs no API key; portfolio data does.

KalshiClientCreate a client for the Kalshi Trade API v2.
KalshiClient.from_envCreate an authenticated client from environment variables.

Market data

Public data: works with or without an API key.

KalshiClient.get_markets ★List markets, one row per market.
KalshiClient.get_market ★Get one market.
KalshiClient.get_orderbookGet the current order book for a market, in long format.
KalshiClient.get_trades ★List public trades, newest first.
KalshiClient.get_candlesticks ★Get OHLC price history for a market as a time-indexed DataFrame.
KalshiClient.get_eventsList events, one row per event.
KalshiClient.get_eventGet one event.
KalshiClient.get_series_listList series, to discover what Kalshi offers.
KalshiClient.get_seriesGet one series.
KalshiClient.get_series_ticker_for_marketLook up which series a market belongs to.
KalshiClient.get_exchange_statusCheck whether the exchange is open and trading.

Portfolio data

Your own account. Needs an authenticated client (see Authentication).

KalshiClient.get_balanceGet your account balance.
KalshiClient.get_positions ★List your positions, one row per market.
KalshiClient.get_event_positionsList your positions added up per event.
KalshiClient.get_fills ★List your fills, newest first.
KalshiClient.get_ordersList your orders, newest first.
KalshiClient.get_settlementsList markets you held when they settled, and what they paid out.

Utilities

Lower-level helpers, also exported from stakepd.kalshi_data.

to_unix_secondsConvert any supported time argument to Unix seconds.
load_private_keyLoad an RSA or Ed25519 PEM private key.
KalshiAuthA requests authentication handler that adds Kalshi’s signature headers.

Exceptions

Everything the module raises inherits from KalshiError.

KalshiErrorBase class for every exception raised by stakepd.kalshi_data.
KalshiAuthErrorRaised when credentials are missing, incomplete or unreadable.
KalshiAPIErrorRaised when Kalshi returns an HTTP error.