US 30-Year Mortgage Historical Data API: Timeseries, Charts & Downloads

US 30-Year Mortgage Historical Data API: Timeseries, Charts & Downloads

Understanding the Importance of Mortgage Rate Data

In the world of finance, accurate and timely data is crucial for making informed decisions. For developers building fintech applications, economists analyzing market trends, and quantitative analysts conducting financial modeling, access to reliable mortgage rate data is essential. The US 30-Year Mortgage Historical Data API from Interest Rates API provides a comprehensive solution for retrieving mortgage rate data, enabling users to perform time series analysis, generate charts, and download historical data.

This blog post will explore the features of the US 30-Year Mortgage Historical Data API, focusing on the various endpoints available for accessing mortgage rate data, including time series, historical values, and fluctuation statistics. We will also provide practical code examples and discuss the implications of using this data in financial applications.

API Overview

The US 30-Year Mortgage Historical Data API is designed to provide developers and financial analysts with access to historical mortgage rate data. The API supports various endpoints that allow users to retrieve the latest rates, historical values, time series data, and fluctuation statistics. The base URL for all API requests is https://interestratesapi.com/api/v1/, and all requests must use the GET method with the api_key query parameter for authentication.

Key Endpoints and Their Usage

1. Latest Mortgage Rates

The /latest endpoint retrieves the most recent mortgage rates, including the 30-Year Fixed Mortgage Rate. This endpoint is essential for applications that require up-to-date mortgage rate information.

cURL Example:

curl "https://interestratesapi.com/api/v1/latest?symbols=MORTGAGE_30Y&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"date": "2026-06-09",
"base": "MIXED",
"rates": {
"MORTGAGE_30Y": 5.33
},
"dates": {
"MORTGAGE_30Y": "2026-06-09"
},
"currencies": {
"MORTGAGE_30Y": "USD"
}
}

This response indicates that the latest 30-Year Mortgage Rate is 5.33% as of June 9, 2026. Developers can use this data to inform users about current mortgage rates when making financial decisions.

2. Historical Mortgage Rates

The /historical endpoint allows users to retrieve the mortgage rate for a specific date. This is particularly useful for analyzing trends over time or for point-in-time assessments.

cURL Example:

curl "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=MORTGAGE_30Y&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"date": "2025-06-15",
"base": "USD",
"rates": {
"MORTGAGE_30Y": 5.33
},
"currencies": {
"MORTGAGE_30Y": "USD"
}
}

This response shows that on June 15, 2025, the 30-Year Mortgage Rate was also 5.33%. This endpoint is valuable for historical analysis and for understanding how rates have changed over time.

3. Time Series Data

The /timeseries endpoint provides a series of mortgage rates between two specified dates. This is particularly useful for developers looking to create visualizations or conduct detailed analyses over a range of dates.

cURL Example:

curl "https://interestratesapi.com/api/v1/timeseries?start=2025-06-09&end=2026-06-09&symbols=MORTGAGE_30Y&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"base": "USD",
"start_date": "2025-06-09",
"end_date": "2026-06-09",
"rates": {
"MORTGAGE_30Y": {
"2025-01-02": 5.33,
"2025-01-03": 5.33,
"2025-01-06": 5.33
}
},
"frequencies": {
"MORTGAGE_30Y": "daily"
},
"currencies": {
"MORTGAGE_30Y": "USD"
}
}

This response provides daily mortgage rates for the specified date range. Developers can use this data to create time series charts, analyze trends, and make predictions based on historical performance.

4. Fluctuation Statistics

The /fluctuation endpoint allows users to analyze the change in mortgage rates over a specified date range. This is useful for understanding volatility and making informed decisions based on rate changes.

cURL Example:

curl "https://interestratesapi.com/api/v1/fluctuation?start=2025-06-09&end=2026-06-09&symbols=MORTGAGE_30Y&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"rates": {
"MORTGAGE_30Y": {
"start_date": "2025-06-09",
"end_date": "2026-06-09",
"start_value": 5.50,
"end_value": 5.33,
"change": -0.17,
"change_pct": -3.09,
"high": 5.50,
"low": 5.25
}
}
}

This response indicates that the mortgage rate decreased from 5.50% to 5.33% over the specified period, representing a change of -0.17% or -3.09%. This data is crucial for financial analysts assessing market conditions and making strategic decisions.

5. OHLC Data for Candlestick Charts

The /ohlc endpoint provides Open, High, Low, and Close (OHLC) data for mortgage rates, which is essential for creating candlestick charts used in technical analysis.

cURL Example:

curl "https://interestratesapi.com/api/v1/ohlc?symbols=MORTGAGE_30Y&period=monthly&start=2025-06-09&end=2026-06-09&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"period": "monthly",
"start_date": "2025-06-09",
"end_date": "2026-06-09",
"rates": {
"MORTGAGE_30Y": [
{
"period": "2025-01",
"open": 5.50,
"high": 5.50,
"low": 5.33,
"close": 5.33,
"data_points": 23
}
]
}
}

This response provides monthly OHLC data for the 30-Year Mortgage Rate, which can be used to create candlestick charts for visual analysis. Developers can integrate this data into financial applications to enhance user experience and provide valuable insights.

Building a Data Pipeline with Python

To effectively utilize the mortgage rate data, developers can build a data pipeline using Python. This pipeline can fetch data from the API, process it, and export it to formats like CSV or Parquet for further analysis.

Python Code Example:

import requests
import pandas as pd

# Fetching the latest mortgage rates
response = requests.get(
'https://interestratesapi.com/api/v1/latest',
params=dict(symbols='MORTGAGE_30Y', api_key='YOUR_KEY')
)

data = response.json()

# Creating a DataFrame
df = pd.DataFrame(data['rates'], index=[data['date']])

# Exporting to CSV
df.to_csv('mortgage_rates.csv')

This code snippet demonstrates how to fetch the latest mortgage rates and export them to a CSV file. Developers can extend this pipeline to include historical data retrieval and analysis.

Challenges and Considerations in Time Series Analysis

When working with time series data, developers must be aware of several challenges, including missing dates, frequency considerations, and data point interpretations. For instance, when using the /timeseries endpoint, it is essential to handle weekends and holidays when the market is closed, as these can lead to gaps in the data.

Additionally, understanding the frequency of the data (daily vs. monthly) is crucial for accurate analysis. Developers should ensure that their applications can handle these variations and provide users with meaningful insights based on the available data.

Conclusion

The US 30-Year Mortgage Historical Data API from Interest Rates API offers a powerful tool for accessing mortgage rate data, enabling developers and financial analysts to build robust applications and conduct in-depth analyses. By leveraging the various endpoints available, users can retrieve the latest rates, historical values, time series data, and fluctuation statistics, all of which are essential for making informed financial decisions.

As the financial landscape continues to evolve, having access to accurate and timely mortgage rate data will remain a critical component for success in the fintech industry. By integrating this API into their applications, developers can enhance user experience, provide valuable insights, and ultimately drive better financial outcomes.

To get started with the US 30-Year Mortgage Historical Data API, visit Interest Rates API today!

Ready to get started?

Get your API key and start validating bank data in minutes.

Get API Key

Related posts