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.pemin project root directory - Add your Kalshi private key to this file
- Update
key_idin configuration
Pipeline Components
Core Scripts
openeventscollector.py: Fetches open events from Kalshiopenmarketcollector.py: Collects detailed market dataprocessopenevents.py: Processes and formats event dataprocessmarketdetails.py: Analyzes and processes market detailspipelineallkalshi.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