Forex Historical Data Downloader and Parquet Converter
Python 3.10+ | histdata.com | 66 Currency Pairs | Apache Parquet Output
Features | Quick Start | Usage | Data Format | Pairs | Docs | Community
histdata is a simple Python ETL tool that downloads free Forex historical data from histdata.com and converts it to Apache Parquet format with zstd compression. It is designed for quantitative researchers and trading system developers who need clean, columnar market data without manual download steps.
"One command to download 20+ years of 1-minute Forex data across 66 pairs, ready for pandas, Polars, or any Arrow-compatible tool."
- 66 Currency Pairs - Forex majors, crosses, commodities (WTI, Brent), and indices (S&P 500, Nikkei, DAX, etc.)
- Automatic Download - Two-step token extraction (GET page + POST download) with polite 2-second throttle
- Smart Year Handling - Past years download as single yearly ZIPs; current year downloads month-by-month
- Parquet Output - Apache Parquet with zstd compression, ready for pandas/Polars/DuckDB/Spark
- Typed Schema -
timestamp[ms], open, high, low, close, volume(all float64) - CLI Tool - Install once, run from anywhere via the
histdatacommand - Zero Heavy Dependencies - Only
requests,beautifulsoup4, andpyarrow
pip install git+https://github.com/StratCraftsAI/histdata.gitOr install from source:
git clone https://github.com/StratCraftsAI/histdata.git
cd histdata
pip install -e .- Python: 3.10+
- Dependencies:
requests,beautifulsoup4,pyarrow(installed automatically)
# Download EURUSD 2020-2025 and convert to Parquet
histdata --pairs EURUSD --year-start 2020 --year-end 2025# Single pair
histdata --pairs EURUSD --year-start 2020 --year-end 2025
# Multiple pairs
histdata --pairs EURUSD GBPUSD USDJPY --year-start 2015 --year-end 2025
# All 23 major Forex pairs (default)
histdata --year-start 2020 --year-end 2025
# All 66 pairs (Forex + Commodities + Indices)
histdata --pairs all --year-start 2020 --year-end 2025# Skip download, only convert previously downloaded ZIPs
histdata --skip-download --zip-dir ./downloads| Option | Default | Description |
|---|---|---|
--pairs |
Major Forex (23) | Currency pairs to download. Use all for all 66 |
--year-start |
2020 | First year to download |
--year-end |
2025 | Last year to download |
--timeframe |
M1 | Timeframe: M1 (1-minute bars) or tick |
--output-dir |
./output |
Directory for Parquet output |
--zip-dir |
./downloads |
Directory for downloaded ZIPs |
--skip-download |
off | Skip download, convert existing ZIPs only |
-v, --verbose |
off | Enable debug logging |
from histdata_supplementary.downloader import download_pair
from histdata_supplementary.parser import parse_zip
from histdata_supplementary.converter import write_parquet
import requests
from pathlib import Path
session = requests.Session()
# Download EURUSD 2023
zips = download_pair("EURUSD", 2023, 2023, Path("./downloads"), session=session)
# Parse and convert
for zip_path in zips:
rows = parse_zip(zip_path)
write_parquet(rows, Path(f"./output/EURUSD_M1.parquet"))import pandas as pd
df = pd.read_parquet("output/EURUSD_M1.parquet")
print(df.head())
# timestamp open high low close volume
# 0 2023-01-02 17:00:00 1.07045 1.07048 1.07045 1.07048 0.0
# 1 2023-01-02 17:01:00 1.07045 1.07050 1.07044 1.07050 0.0- Provider: histdata.com (free registration, no API key)
- Format: Generic ASCII CSV, semicolon-delimited
- Layout:
DateTime;OPEN;HIGH;LOW;CLOSE;Volume - Timestamps: EST (Eastern Standard Time, no DST adjustment)
- Timestamp format:
YYYYMMDD HHMMSS - Past years: One ZIP per year
- Current year: One ZIP per month
- Format: Apache Parquet
- Compression: zstd
- Schema:
| Column | Type | Description |
|---|---|---|
timestamp |
timestamp[ms] |
Bar open time (EST) |
open |
float64 |
Open price |
high |
float64 |
High price |
low |
float64 |
Low price |
close |
float64 |
Close price |
volume |
float64 |
Tick volume |
| Majors | Crosses | JPY Crosses |
|---|---|---|
| EURUSD | EURAUD | AUDJPY |
| GBPUSD | EURCAD | CADJPY |
| USDJPY | EURCHF | CHFJPY |
| USDCHF | EURGBP | EURJPY |
| USDCAD | EURNZD | GBPJPY |
| AUDUSD | GBPAUD | NZDJPY |
| NZDUSD | GBPCAD | |
| GBPCHF | ||
| GBPNZD | ||
| AUDNZD |
| Pair | Description |
|---|---|
| BCOUSD | Brent Crude Oil |
| WTIUSD | WTI Crude Oil |
| Pair | Description |
|---|---|
| AUXAUD | ASX 200 |
| FRXEUR | CAC 40 |
| GRXEUR | DAX 30 |
| HKXHKD | Hang Seng |
| JPXJPY | Nikkei 225 |
| NSXUSD | NASDAQ 100 |
| SPXUSD | S&P 500 |
| UDXUSD | US Dollar Index |
| UKXGBP | FTSE 100 |
histdata/
├── histdata_supplementary/
│ ├── __init__.py
│ ├── cli.py # CLI entry point
│ ├── converter.py # OHLCVRow -> PyArrow Table -> Parquet (zstd)
│ ├── downloader.py # GET token + POST download ZIP (2s throttle)
│ ├── pairs.py # 66 currency pair constants
│ └── parser.py # Unzip -> parse ASCII CSV -> OHLCVRow
├── pyproject.toml
├── LICENSE
├── README.md
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
├── SECURITY.md
└── SUPPORT.md
histdata.com ──(GET page)──> Extract Token
│
(POST download)
│
v
ZIP file
│
(unzip + parse CSV)
│
v
list[OHLCVRow]
│
(PyArrow conversion)
│
v
Parquet (zstd compressed)
No. histdata.com provides free data without registration or API keys.
Approximately 2 seconds per ZIP file (polite throttle). Downloading all 66 pairs for 5 years takes roughly 10-15 minutes.
Yes. The Parquet output follows the standard OHLCV schema and can be loaded directly into StratCraft as a data source.
All timestamps are in EST (Eastern Standard Time, UTC-5). histdata.com does not apply DST adjustment.
Pass --timeframe tick to download tick-level data instead of 1-minute bars. Tick data parsing uses the same pipeline.
- CONTRIBUTING.md for contribution guidelines
- SECURITY.md for vulnerability disclosure
- SUPPORT.md for bug reports and questions
- CODE_OF_CONDUCT.md for community standards
- Support: SUPPORT.md
- Contributing: CONTRIBUTING.md
- Security: SECURITY.md
- Code of Conduct: CODE_OF_CONDUCT.md
For questions or collaboration: nonagonal.portal@gmail.com
This project is maintained by StratCraftsAI.
- Issues & Discussions: Welcome for bug reports, data quality questions, and feature ideas
- Pull Requests: Bug fixes welcome (see CONTRIBUTING.md)
- Feature PRs require prior discussion in Issues
MIT License - See LICENSE file.
Built for quantitative researchers who need clean Forex data without the hassle