Copy-paste prompts for ChatGPT, Claude, and other AI assistants. Hand one to the AI, swap in your API key and tickers, and let it do the download and analysis for you.
hfd_…. Free, instant, 100 downloads/minute.Pulls the entire historical record (2002–present) for a single ticker as a parquet file, loads it with pandas, and prints a summary.
Download high-frequency stock data from the HF Data Library and give me a summary.
Configuration:
ticker = AAPL
version = clean # "clean" = filtered, "raw" = as-received
api_key = YOUR_API_KEY
Step 1 — Download the parquet file (entire history, ~24 years, single request):
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.hfdatalibrary.com/v1/bars/AAPL?version=clean" \
-o AAPL.parquet
Step 2 — Load with pandas:
import pandas as pd
df = pd.read_parquet("AAPL.parquet")
Columns: datetime (Eastern Time, tz-naive), open, high, low, close, volume, source.
"source" is "pitrading" for pre-2022-03-04 and "iex" for post-2022-03-07.
Step 3 — Report:
- total bars
- date range (first and last datetime)
- mean / min / max close price
- number of trading days with at least one bar
- first 5 rowsLoops through a list of tickers, downloads each, and concatenates into a single long-format DataFrame.
Download one-minute OHLCV data from the HF Data Library for several tickers and combine them into a single DataFrame.
Configuration:
tickers = AAPL, MSFT, GOOG, NVDA, AMZN, META, TSLA
version = clean
api_key = YOUR_API_KEY
For each ticker, fetch the parquet:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.hfdatalibrary.com/v1/bars/${TICKER}?version=clean" \
-o "${TICKER}.parquet"
Combine in Python:
import pandas as pd, glob, os
dfs = []
for path in sorted(glob.glob("*.parquet")):
d = pd.read_parquet(path)
d["ticker"] = os.path.basename(path).replace(".parquet", "")
dfs.append(d)
combined = pd.concat(dfs, ignore_index=True)
combined = combined[["ticker", "datetime", "open", "high", "low", "close", "volume", "source"]]
Report:
- bars per ticker
- shared (overlapping) date range across all tickers
- mean daily volume per ticker
- total combined row count and memory footprintsleep between requests.
Downloads a ticker, slices to a specific window client-side, and computes daily realized volatility from one-minute log returns.
Download HF Data Library data for one ticker, slice to a specific date range, and compute daily realized volatility.
Configuration:
ticker = NVDA
version = clean
start_date = 2024-10-01
end_date = 2024-12-31
api_key = YOUR_API_KEY
Step 1 — Download (the API ships entire-ticker files; slice client-side):
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.hfdatalibrary.com/v1/bars/NVDA?version=clean" \
-o NVDA.parquet
Step 2 — Slice and compute realized variance (sum of squared 1-min log returns per day):
import numpy as np, pandas as pd
df = pd.read_parquet("NVDA.parquet")
df["datetime"] = pd.to_datetime(df["datetime"])
window = df[(df.datetime >= "2024-10-01") & (df.datetime < "2025-01-01")].copy()
window["date"] = window.datetime.dt.date
window["log_ret"] = np.log(window.close).diff()
daily_rv = window.groupby("date")["log_ret"].apply(lambda r: (r**2).sum())
Report:
- highest-RV trading day and its value
- the 5 trading days with the largest absolute close-to-close moves
- mean RV across the window
- a simple chart of daily RV over the windowFor ChatGPT, Claude, etc. without code execution. The AI writes the curl; you paste it into your terminal.
I have an HF Data Library API key (https://hfdatalibrary.com) and need a shell command to download 1-minute OHLCV bars for a ticker.
Configuration:
ticker = AAPL
version = clean
api_key = YOUR_API_KEY
The endpoint is:
GET https://api.hfdatalibrary.com/v1/bars/{TICKER}?version={VERSION}
Header: X-API-Key: YOUR_API_KEY
Give me a single curl command that:
1. authenticates with X-API-Key
2. downloads the parquet file to ./AAPL_clean.parquet
3. fails with a non-zero exit code on HTTP error (so the shell knows it broke)
4. prints a short success message with the file size on completion
Also give me the equivalent commands in:
- Python (using requests, save to disk)
- R (using httr2 or curl, save to disk)
No explanation, just the four commands.Hand the AI a list of tickers (or ask it to fetch one), download each, and assemble a sector-level dataset.
Build a one-minute OHLCV dataset for a sector / index from the HF Data Library.
Configuration:
bundle = Magnificent 7 # or: S&P 500, Dow 30, sector-tech, sector-financials
tickers = AAPL, MSFT, GOOG, NVDA, AMZN, META, TSLA
version = clean
api_key = YOUR_API_KEY
out_dir = mag7_data/
If the bundle name is recognized but no tickers are supplied, look up the constituents (you can use https://hfdatalibrary.com/pages/tickers as a reference or a public source for index membership).
Download each ticker, throttled to ~1 request/second to stay under the 100/min rate limit:
mkdir -p mag7_data
for T in AAPL MSFT GOOG NVDA AMZN META TSLA; do
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.hfdatalibrary.com/v1/bars/${T}?version=clean" \
-o "mag7_data/${T}.parquet"
sleep 1
done
Then in Python:
import pandas as pd, glob, os
files = sorted(glob.glob("mag7_data/*.parquet"))
combined = pd.concat([
pd.read_parquet(f).assign(ticker=os.path.basename(f).replace(".parquet",""))
for f in files
], ignore_index=True)
combined.to_parquet("mag7_combined.parquet")
Report total bars, ticker count, date range, and combined-file size.The 1-minute endpoint is the simplest path. For other timeframes you use the two-step signed-URL flow.
Download HF Data Library data at a non-1-minute timeframe. The /v1/bars/{TICKER} endpoint only serves 1min — for other intervals, use the signed-URL flow.
Configuration:
ticker = SPY
version = clean
timeframe = 5min # allowed: 1min, 5min, 15min, 30min, hourly, daily, weekly, monthly
format = parquet # or csv
api_key = YOUR_API_KEY
Step 1 — Request a signed download URL (the token is valid 10 minutes):
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.hfdatalibrary.com/v1/download-token/SPY?version=clean&timeframe=5min&format=parquet"
Response (JSON):
{
"url": "https://api.hfdatalibrary.com/v1/download/SPY?token=...",
"expires_at": "...",
"version": "clean", "timeframe": "5min", "format": "parquet"
}
Step 2 — Fetch the `url` value (no auth header needed; the token authorizes it):
curl "" -o SPY_clean_5min.parquet
Then load with pandas as in prompt 1. Show me the first 5 rows and confirm the inter-bar spacing is 5 minutes. sleep between requests; the AI usually does this without being asked.datetime (Eastern Time, tz-naive), open, high, low, close, volume, source. No timezone metadata is embedded — if you localize, use America/New_York.source == "pitrading" for pre-2022-03-04, source == "iex" for post-2022-03-07. Some research questions only want one or the other; the column makes that filter trivial.