↓ Skip to main content
All methods

stakepd.kalshi_data.KalshiClient.get_candlesticks

★ Most used → DataFrame
Signature
client.get_candlesticks(ticker, start, end=None, *, interval="1h", series_ticker=None)

Get OHLC price history for a market as a time-indexed DataFrame.

The result is ready to plot or resample. Kalshi allows at most 5,000 candles per request, so longer ranges are split into several requests and joined automatically. For example, a month of 1-minute candles takes about 9 requests. Times accept a str, datetime, date, pandas.Timestamp or Unix seconds. See Time arguments.

Parameters

ticker:str
Market ticker.
start:time
Start of the range.
end:time, optional
End of the range. Defaults to now.
interval:{'1m', '1h', '1d'} or int, default '1h'
Candle length. The equivalent minutes 1, 60 and 1440 also work.
series_ticker:str, optional
The market’s series ticker. If you leave it out, it’s looked up for you, which costs two extra requests. Pass it when you fetch many markets from the same series.

Returns

pandas.DataFrame
Indexed by end_period_ts (a UTC DatetimeIndex, the end of each candle) and sorted oldest first.
Main columns
ColumnTypeDescription
price_open, price_high, price_low, price_closefloatOHLC of traded prices. NaN in candles with no trades.
price_meanfloatMean traded price within the candle
price_previousfloatLast traded price before this candle
yes_bid_open, yes_bid_high, yes_bid_low, yes_bid_closefloatOHLC of the best YES bid (quoted, so defined even without trades)
yes_ask_open, yes_ask_high, yes_ask_low, yes_ask_closefloatOHLC of the best YES ask
volumefloatContracts traded in the candle
open_interestfloatOpen interest at the end of the candle

Raises

ValueError
If interval isn’t recognised, or start isn’t before end.

See also

KalshiClient.get_trades
The individual trades behind the candles.
KalshiClient.get_series_ticker_for_market
Look up which series a market belongs to.
KalshiClient.get_markets
List markets, one row per market.

Examples
#

from stakepd import kalshi_data as kd

client = kd.KalshiClient()          # market data is public: no API key needed

Example:

candles = client.get_candlesticks("KXHIGHNY-26NOV27-B57.5", start="2026-11-26",
                                  interval="1h", series_ticker="KXHIGHNY")
print(candles[["price_open", "price_high", "price_low", "price_close", "volume"]].dropna().tail(4))
Output:
                           price_open  price_high  price_low  price_close   volume
end_period_ts
2026-11-27 04:00:00+00:00        0.30        0.69       0.30         0.50  3198.40
2026-11-27 05:00:00+00:00        0.51        0.57       0.51         0.57   594.85
2026-11-27 06:00:00+00:00        0.57        0.77       0.57         0.74  3850.81
2026-11-27 07:00:00+00:00        0.74        0.76       0.70         0.72  2390.41

Plot, mid-price and local time:

# Plot the probability over time
candles["price_close"].ffill().plot(ylabel="P(YES)")

# Mid-price is defined even when nothing traded
candles["mid"] = (candles.yes_bid_close + candles.yes_ask_close) / 2

# Convert to New York time
candles.index = candles.index.tz_convert("America/New_York")

Downsample 1-minute candles to 5-minute candles:

m1 = client.get_candlesticks(ticker, start="2026-11-26", interval="1m", series_ticker="KXHIGHNY")
m5 = m1.resample("5min").agg({"price_open": "first", "price_high": "max",
                              "price_low": "min", "price_close": "last", "volume": "sum"})

Price history for every market in an event:

markets = client.get_markets(event_ticker="KXHIGHNY-26NOV27")
closes = pd.DataFrame({
    row.yes_sub_title: client.get_candlesticks(row.ticker, start="2026-11-25", interval="1h",
                                               series_ticker="KXHIGHNY")["price_close"]
    for row in markets.itertuples()
}).ffill()
closes.plot(ylabel="P(YES)")

This method is also covered, alongside the rest of the module, in the overview guide.