harrodyuan
kalshi-data-collector
Python

Kalshi Data Collection Pipeline

Last updated Jun 3, 2026
17
Stars
2
Forks
1
Issues
0
Stars/day
Attention Score
53
Language breakdown
Python 100.0%
โ–ธ Files click to expand
README

Kalshi Data Collection Pipeline

A robust Python tool for collecting and analyzing market data from Kalshi.

Setup

Prerequisites

  • Python 3.8+
  • Required packages: Install using pip install -r requirements.txt

Authentication

  • Create private_key.pem in project root directory
  • Add your Kalshi private key to this file
  • Update key_id in configuration

Pipeline Components

Core Scripts

  • openeventscollector.py: Fetches open events from Kalshi
  • openmarketcollector.py: Collects detailed market data
  • processopenevents.py: Processes and formats event data
  • processmarketdetails.py: Analyzes and processes market details
  • pipelineallkalshi.py: Main pipeline orchestrator

Directory Structure

historical_data/
โ”œโ”€โ”€ open_events/           # Raw event data
โ”œโ”€โ”€ open_markets/         # Raw market data
โ”œโ”€โ”€ openmarketsindividual/  # Individual market details
โ”œโ”€โ”€ processed_events/     # Processed event data (CSV)
โ””โ”€โ”€ processed_markets/    # Processed market data (CSV)

Usage

Run Complete Pipeline

To execute the entire data collection and processing pipeline:
python pipelineallkalshi.py

This will:

  • Collect all open events
  • Gather market data
  • Process events into CSV format
  • Process market details with statistics

Output

The pipeline generates:
  • JSON files containing raw data
  • CSV files with processed data
  • Summary statistics for markets

Pipeline Steps

  • Event Collection: Fetches current open events
  • Market Collection: Gathers detailed market data
  • Event Processing: Converts events to structured format
  • Market Processing: Analyzes market details and statistics

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท harrodyuan/kalshi-data-collector ยท Updated daily from GitHub