Skip to main content

hfdatalibrary (Python)

Python client for the HF Data Library — free, research-grade 1-minute OHLCV data for ~1,391 U.S. equities and ETFs, in both raw and clean versions across eight timeframes.

Install

pip install hfdatalibrary          # add pyarrow for parquet: pip install hfdatalibrary[parquet]

Authenticate

Get a free API key at https://hfdatalibrary.com/pages/account, then:

import hfdatalibrary as hfdl
hfdl.set_key("YOUR_API_KEY")        # or set the HFDL_API_KEY environment variable

Use

hfdl.symbols()                                   # -> ['A', 'AA', 'AAPL', ...]
df = hfdl.get("AAPL")                             # clean 1-minute bars (pandas DataFrame)
df = hfdl.get("AAPL", version="raw", timeframe="daily")
panel = hfdl.get(["AAPL", "MSFT", "SPY"])         # -> {ticker: DataFrame}
df = hfdl.get("AAPL", fmt="csv")                  # CSV instead of parquet (no pyarrow needed)

Parameters: version ∈ {clean, raw}; timeframe ∈ {1min,5min,15min,30min,hourly,daily,weekly,monthly}.

Important: survivorship bias

The universe is a fixed snapshot (~2023) carried back to 2002, so pre-2022 history is survivor-conditioned — companies that delisted before ~2021 are absent. Not suitable for survivorship-sensitive backtests over 2002–2021 without adjustment. See the methodology docs for full limitations (including the post-March-2022 IEX-only volume caveat).

License

MIT (client code). Data is CC BY 4.0 — cite per https://hfdatalibrary.com/pages/cite.

Release files for hfdatalibrary 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hfdatalibrary 0.1.0
File Size Uploaded
hfdatalibrary-0.1.0.tar.gz 8.1 kB Details

Built distribution (wheel)

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

Total release size: 13.9 kB

Release files / hfdatalibrary-0.1.0.tar.gz

Download URL hfdatalibrary-0.1.0.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
20ebfc3d8033d9db443d3e6bd5e6c53e765a6971a878931e98bc17d86fe2481e
BLAKE2b-256 checksum
How to use checksums
2767ac32399bc063c7df048d467c49a85b85b92c709757be70cc736963cf8d62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / hfdatalibrary-0.1.0-py3-none-any.whl

Download URL hfdatalibrary-0.1.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33dac8f1e30cd70606a7d32a56036979662443c58b8195746f557d7882836bfd
BLAKE2b-256 checksum
How to use checksums
de439af352f6f80fbdc88eef8c138f27c6e7100af5fec5da97dad7974f239ccb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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