← ClaudeAtlas

lib-fredapilisted

fredapi wraps FRED/ALFRED and is the primary anti-look-ahead tool in macro - and three of its four vintage methods are buggy in source. TRIGGER - fredapi, "from fredapi import Fred", Fred(api_key=), FRED_API_KEY, get_series, get_series_all_releases, get_series_as_of_date, get_series_first_release, get_series_vintage_dates, realtime_start, realtime_end, ALFRED, vintage, data revision, revised GDP, CPI or payrolls, Philadelphia Fed Real-Time Data Set, full-fred, DBnomics, "Bad Request. The value for variable api_key is not registered". Frozen at 0.5.2 since 2024-05, so these bugs are current behaviour, not history you remember from an old version. SKIP for lib-edgartools, which is the skill for company filings and fundamentals. SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
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