A Python pipeline for collecting and analyzing market data from Polymarket.
- Python 3.8+
- Required packages: pandas, python-dotenv
- Polymarket API credentials
- Create a
.envfile in the project root - Add your Polymarket private key:
PK=your_private_key_here
polymarket_data_collector/
├── historical_data/
│ ├── raw_data/ # All market data
│ └── open_markets/ # Only open markets
├── get_polymarket_data.py # Fetches all markets
├── get_open_markets.py # Filters for open markets
└── pipeline_all_poly.py # Main pipeline script
python pipeline_all_poly.pyThis will:
- Create necessary directories if they don't exist
- Fetch all Polymarket data (~30k+ markets)
- Filter for currently open markets
- Save results in CSV format with date stamps
- Raw data:
historical_data/raw_data/polymarket_data_YYYYMMDD.csv - Open markets:
historical_data/open_markets/open_markets_YYYYMMDD.csv
- Typical runtime: ~45 seconds
- Handles pagination automatically
- Processes 30,000+ markets efficiently
BD_Harold