30-Year Mortgage Rate
Get the weekly average 30-Year Fixed Rate Mortgage from FRED (Freddie Mac’s Primary Mortgage Market Survey).
The 30-year fixed mortgage rate is the primary interest rate US households actually borrow at for home purchases, and is one of the clearest single transmission points from Federal Reserve policy to the real economy: it moves with (but is not identical to) the 10-year Treasury yield plus a credit/prepayment spread, and directly drives housing affordability and demand. It is the natural interest-rate complement to Housing Starts (see get_housing_starts) - rate moves here lead construction activity, since higher borrowing costs price marginal buyers out of the market before builders scale back new projects.
The rate is weekly (week ending Thursday), returned as a decimal fraction per annum (0.0648 for 6.48%) and not seasonally adjusted. FRED publishes it in percentage points; it is rescaled here so that every rate the Finance Toolkit returns is a decimal fraction.
Requires a free FRED API key, see the fred_api_key parameter of the Economics class.
See definition: https://fred.stlouisfed.org/series/MORTGAGE30US
Also known as: 30-year mortgage rate, Freddie Mac PMMS rate.
No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the 30-Year Mortgage Rate for you. Just ask in plain English.
Calculate the 30-Year Mortgage Rate in Python
The 30-Year Mortgage Rate is available in the Economics module of the open-source Finance Toolkit. Install it with:
pip install financetoolkit -U
Then call get_mortgage_rate_30_year as shown below.
from financetoolkit import Economics
economics = Economics(start_date='2020-01-01', fred_api_key='FRED_API_KEY')
economics.get_mortgage_rate_30_year()
Which returns:
| Date | United States |
|---|---|
| 2026-07-02 | 0.0643 |
| 2026-07-09 | 0.0649 |
| 2026-07-16 | 0.0655 |
| 2026-07-23 | 0.0658 |
| 2026-07-30 | 0.0666 |
Parameters
get_mortgage_rate_30_year accepts the following parameters:
- rolling (int, optional): The rolling window size to use for smoothing the data (simple moving average). Defaults to None.
- trailing (int, optional): The trailing window size to use for summing the data over trailing periods. Defaults to None.
- growth (bool, optional): Whether to return the growth data or the actual data.
- lag (int, optional): The number of periods to lag the data by.
- standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.
- rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.
Related Finance
The Economics module page introduces the module, and the sidebar lists all of its functions.