fred
FRED API helpers for borrowing-rate data.
fetch_fred_series(series_id, api_key, limit=None)
Fetch a stationary FRED series and return (date, value) pairs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
series_id
|
str
|
FRED series identifier (e.g., "MORTGAGE30US"). |
required |
api_key
|
str
|
Your FRED API key. |
required |
limit
|
int | None
|
Maximum number of observations to fetch. Defaults to the service limit. |
None
|
Returns:
| Type | Description |
|---|---|
list[tuple[str, float]]
|
Observations sorted newest-first, (date, float value). |
Source code in src/refi_calculator/core/market/fred.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |