Skip to main content

kalshieye

Python client for Kalshi Eye flat files: 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).

pip install "kalshieye[pandas]"      # or kalshieye[polars], or plain kalshieye
export KALSHIEYE_API_KEY=clab_...     # create one under API keys
from kalshieye import Client, replay_book

kx = Client()
kx.datasets()                                             # schemas, coverage, required plan
kx.estimate(["bbo_1m", "trades"], "2026-10-12", "2026-10-18", series=["KXBTC*"])

kx.download(["bbo_1m", "trades"], "2026-10-12", "2026-10-18",
            series=["KXBTC*"], dest="data", progress=True)

df = kx.load("bbo_1m", "2026-10-12", "2026-10-18", series="KXBTC15M")
fills = kx.load("trades", "2026-10-12", "2026-10-12", tickers=["KXBTC15M-26OCT121545-45"])

# Rebuild the book from book_l2 rows
book = kx.load("book_l2", "2026-10-12", "2026-10-12", tickers=["KXBTC15M-26OCT121545-45"])
for ts, ticker, bids, asks in replay_book(book):
    ...

# One event in one zip: book, snapshots, trades, spot, metadata.json, settlement.json
kx.bundle("KXBTC15M-26OCT121545")

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

# S3 access (paid plans): a read-only key for aws s3 sync, rclone, DuckDB, boto3
key = kx.create_s3_key("laptop")
print(key["snippets"]["aws_cli"])
  • Files land under dest in the lake layout (bbo_1m/date=2026-10-12/series=KXBTC15M/...parquet), so DuckDB, Polars, and Spark can read the folder as a hive-partitioned dataset. spot is 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 filters by archive category (crypto, politics, ...). tickers picks the series files holding those markets, and load keeps only their rows.
  • 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.1

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.1
File Size Uploaded Provenance
kalshieye-0.2.1.tar.gz 11.9 kB With provenance Details

Built distribution (wheel)

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

Total release size: 22.4 kB

Release files / kalshieye-0.2.1.tar.gz

Download URL kalshieye-0.2.1.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8fb587838f79024aca31051a938e844e9ee7e260fb832a87da298031c1c48368
BLAKE2b-256 checksum
How to use checksums
23ef44aceb76c52d7bf4717df2f48917e8595ee6cfe81e88da63658303157227
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 24, 2026.

Transparency log

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

Download URL kalshieye-0.2.1-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de84040d6452b1509a89724fece8b958508b3c8c35ef071491603bf0462f697c
BLAKE2b-256 checksum
How to use checksums
873009615501959cc008b740b097ba3adb0c1c908bea3a601cd42f370d3a1c30
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 24, 2026.

Transparency log

Security for kalshieye 0.2.1

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kalshieye-0.2.1.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 24, 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.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files Full provenance

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