lib-fredapilisted
Install: claude install-skill howard-lynn-ye/fin-skills
# fredapi
A thin client for FRED and ALFRED. **This is the primary anti-look-ahead tool in macro** — and its
vintage helpers do not do what their docstrings say.
| | |
|---|---|
| pip / import | `fredapi` / `from fredapi import Fred` |
| Version | 0.5.2 (2024-05-05) · 16 releases · last code change 2024; a doc tweak in 2026-01 |
| Licence | Apache-2.0 |
| Status | Stable / low activity, 1,655★. Root URL `https://api.stlouisfed.org/fred`. A **free API key is required** — pass `api_key=`, `api_key_file=`, or set `$FRED_API_KEY` |
Everything below comes from **reading the 0.5.2 source**, not from executing it.
## The trap that costs you money
**GDP, payrolls and CPI are revised for years, and `get_series` returns only today's numbers.**
FRED's own documented example: 2013Q4 GDP was 17102.5 (2014-01-30) → 17080.7 (2014-02-28) → 17089.6
(2014-03-27). Backtesting on the current series trades on figures published up to a decade later.
The second half of the same trap: **use `realtime_start` as your timestamp, not the observation
date.** A January figure is published in February. Indexing the January observation at January is a
one-to-three-month look-ahead. `realtime_start` is effectively the release date, and that is the
correct timestamp for a backtest. (It is also the second, independent reason `pandas_datareader`'s
FRED reader is not research-grade — verified: no `realtime`, `vintage`, `alfred` or `as_of` anywhere
in its source.)
## The four vintage methods
| Method | Re