Skip to main content

kalshieye

Python client for Kalshi Eye flat files. Kalshi: daily Parquet for the order book (book_l2), 1-second top-10 book snapshots (book_snap_1s), top of book (bbo), one-minute bars (bbo_1m), trades, crypto spot (spot), and the reference tables (markets, settlements, series, incidents). Polymarket: polymarket_l2, polymarket_trades, polymarket_fills, polymarket_markets. Limitless: limitless_l2, limitless_markets. Chainlink prices: chainlink. replay_book rebuilds Kalshi books from book_l2.

pip install "kalshieye[pandas]"      # or kalshieye[polars], or plain kalshieye
export KALSHIEYE_API_KEY=clab_...     # create one at https://kalshieye.com/app/api/
from kalshieye import Client, replay_book

kx = Client()
kx.datasets()                                             # schemas, coverage, required plan
# 2026-10-13 is a free sample day: any key gets every dataset for it.
kx.estimate(["bbo_1m", "trades"], "2026-10-13", "2026-10-13", series=["KXBTC*"])

kx.download(["bbo_1m", "trades"], "2026-10-13", "2026-10-13",
            series=["KXBTC*"], progress=True)               # into ./kalshieye-data

df = kx.load("bbo_1m", "2026-10-13", "2026-10-13", series="KXBTC15M")
fills = kx.load("trades", "2026-10-13", "2026-10-13", tickers=["KXBTC15M-26OCT131200-00"])

# Rebuild the book from book_l2 rows (Full book; free on sample days)
book = kx.load("book_l2", "2026-10-13", "2026-10-13", tickers=["KXBTC15M-26OCT131200-00"])
for ts, ticker, bids, asks in replay_book(book):
    ...

# One event in one zip: the datasets on your plan, metadata.json, settlement.json
kx.bundle("KXBTC15M-26OCT131200")

# CSV.gz copy of a single file
f = next(kx.files("trades", "2026-10-13", "2026-10-13", series="KXBTC15M"))
kx.csv(f["key"])

# S3 sync (aws s3 sync, rclone, DuckDB, boto3) is coming soon: create_s3_key() answers 503 until then.
  • Files land under dest (default kalshieye-data) in the lake layout (bbo_1m/date=2026-10-13/series=KXBTC15M/...parquet), so DuckDB, Polars, and Spark can read the folder as a hive-partitioned dataset. spot and chainlink are partitioned by asset= instead of series=.
  • Every file is checked against its sha256. Files already on disk are skipped and do not count toward your monthly download allowance.
  • series accepts wildcards (KXBTC*). categories keeps the Kalshi series in those categories, named as /api/v1/categories returns them (Crypto, Climate and Weather, ...). tickers picks the series files holding those markets, and load keeps only their rows.
  • Every call counts toward your plan's API limits (Explorer: 100 requests a day, 30 a minute); see https://kalshieye.com/docs/authentication/.
  • bundle, csv, and replay are built on the server the first time; the client waits for them.
  • Errors raise kalshieye.ApiError. Use err.code to tell plan limits (plan_required, history_limited, download_quota) apart.

Without an account

replay_book works on any book_l2 rows, including the free one-day sample on Hugging Face (KalshiEye/kalshi-order-book-sample), which DuckDB reads in place:

# pip install "kalshieye[pandas]" duckdb
import duckdb
from kalshieye import replay_book

# Bills vs Rams, YES if Buffalo wins: every book change up to 11 PM Eastern
book = duckdb.sql("""
  SELECT * FROM 'hf://datasets/KalshiEye/kalshi-order-book-sample/kalshieye-data/book_l2/*/series=KXNFLGAME/*.parquet'
  WHERE ticker = 'KXNFLGAME-26OCT12BUFLAR-BUF'
    AND ts_recv::TIMESTAMPTZ <= '2026-10-13 03:00:00+00'::TIMESTAMPTZ
  ORDER BY ts_recv, seq
""").df()

*_, (ts, ticker, bids, asks) = replay_book(book, levels=3)
print(bids)  # [(0.51, 155253.51), (0.5, 405328.0), (0.49, 15126.0)]
print(asks)  # [(0.52, 960851.07), (0.53, 862817.41), (0.54, 113351.03)]

More runnable examples (a backtest, spreads and depth, calibration) are in KalshiEye/kalshieye-examples. Every column is described in the data dictionary.

Metadata

Release files for kalshieye 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kalshieye 0.2.3
File Size Uploaded Provenance Actions
kalshieye-0.2.3.tar.gz 13.0 kB With provenance Details for kalshieye-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kalshieye 0.2.3
File Interpreter ABI Platform Actions
kalshieye-0.2.3-py3-none-any.whl Python 3 none any Details for kalshieye-0.2.3-py3-none-any.whl

Total release size: 23.9 kB

Release files / kalshieye-0.2.3.tar.gz

Download URL kalshieye-0.2.3.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1f8659661062346db9ff3af587a3f64c12e59dee3ed1f0c5f07772f17deca2ea
BLAKE2b-256 checksum
How to use checksums
0942eb1f14996d9a27c73ed32b0b88c35a36257207bf91307913903b52147f43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Release files / kalshieye-0.2.3-py3-none-any.whl

Download URL kalshieye-0.2.3-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
063a7d53f1ff8acc0af34fe5573e4f6484543cadf5f79422d751a5fc352b2b29
BLAKE2b-256 checksum
How to use checksums
2be805fbe7f93d944bbaa24e33272a088c0f39e963a48865ec301cc3cbbae5e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Security for kalshieye 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kalshieye-0.2.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page