Introduction
In the rapidly evolving world of fintech, access to accurate and timely financial data is crucial for developers, economists, and analysts. One of the key data points in the mortgage market is the 15-Year Fixed Mortgage Rate, which can significantly impact lending decisions and financial planning. Integrating this data into your application can provide users with valuable insights into mortgage trends and help them make informed decisions. This blog post serves as a comprehensive guide to integrating the US 15-Year Mortgage data using the Interest Rates API from interestratesapi.com. We will cover all relevant endpoints, provide code examples, and discuss best practices for implementation.
Understanding the Interest Rates API
The Interest Rates API provides a wealth of information regarding various interest rates, including central bank rates, interbank rates, and reference rates like the 15-Year Fixed Mortgage Rate. This API is essential for developers building applications that require real-time financial data, as it allows for seamless integration of interest rate information into various financial applications.
In this guide, we will focus on the following endpoints:
- GET /api/v1/symbols
- GET /api/v1/latest
- GET /api/v1/historical
- GET /api/v1/timeseries
- GET /api/v1/fluctuation
- GET /api/v1/ohlc
- GET /api/v1/convert
1. GET /api/v1/symbols
This endpoint provides a catalogue of available rate symbols, which is essential for understanding what data you can access through the API.
cURL Example:
curl "https://interestratesapi.com/api/v1/symbols?category=reference&base=USD&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"count": 1,
"symbols": [
{
"symbol": "MORTGAGE_15Y",
"name": "US 15-Year Fixed Mortgage Rate",
"category": "reference",
"country_code": "US",
"currency_code": "USD",
"frequency": "weekly",
"description": "The average interest rate for a 15-year fixed mortgage."
}
]
}
This response indicates that the MORTGAGE_15Y symbol is available for use, along with its description and other relevant details.
2. GET /api/v1/latest
The latest endpoint retrieves the most recent value for specified symbols, allowing you to display current mortgage rates in your application.
cURL Example:
curl "https://interestratesapi.com/api/v1/latest?symbols=MORTGAGE_15Y&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"date": "2026-07-23",
"base": "USD",
"rates": {
"MORTGAGE_15Y": 5.33
},
"dates": {
"MORTGAGE_15Y": "2026-07-23"
},
"currencies": {
"MORTGAGE_15Y": "USD"
}
}
This response provides the latest mortgage rate, which can be displayed prominently in your application to inform users of current borrowing costs.
3. GET /api/v1/historical
To analyze trends over time, the historical endpoint allows you to retrieve the mortgage rate for a specific date.
cURL Example:
curl "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=MORTGAGE_15Y&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"date": "2025-06-15",
"base": "USD",
"rates": {
"MORTGAGE_15Y": 5.25
},
"currencies": {
"MORTGAGE_15Y": "USD"
}
}
This data can be used to create historical charts or reports, helping users understand how mortgage rates have changed over time.
4. GET /api/v1/timeseries
The timeseries endpoint provides a series of mortgage rates between two specified dates, which is useful for trend analysis.
cURL Example:
curl "https://interestratesapi.com/api/v1/timeseries?start=2025-01-01&end=2026-01-01&symbols=MORTGAGE_15Y&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"base": "USD",
"start_date": "2025-01-01",
"end_date": "2026-01-01",
"rates": {
"MORTGAGE_15Y": {
"2025-01-02": 5.30,
"2025-01-03": 5.32,
"2025-01-06": 5.31
}
},
"frequencies": {
"MORTGAGE_15Y": "daily"
},
"currencies": {
"MORTGAGE_15Y": "USD"
}
}
This endpoint is particularly useful for applications that require detailed analysis of mortgage rate fluctuations over time.
5. GET /api/v1/fluctuation
The fluctuation endpoint provides statistics on the change in mortgage rates over a specified date range, which can help users understand market volatility.
cURL Example:
curl "https://interestratesapi.com/api/v1/fluctuation?start=2025-01-01&end=2026-01-01&symbols=MORTGAGE_15Y&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"rates": {
"MORTGAGE_15Y": {
"start_date": "2025-01-01",
"end_date": "2026-01-01",
"start_value": 5.30,
"end_value": 5.33,
"change": 0.03,
"change_pct": 0.57,
"high": 5.35,
"low": 5.25
}
}
}
This data can be used to inform users about the stability or volatility of mortgage rates, aiding in their decision-making process.
6. GET /api/v1/ohlc
The OHLC endpoint provides open, high, low, and close data for mortgage rates over a specified period, which is essential for technical analysis.
cURL Example:
curl "https://interestratesapi.com/api/v1/ohlc?symbols=MORTGAGE_15Y&period=monthly&start=2025-01-01&end=2026-01-01&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"period": "monthly",
"start_date": "2025-01-01",
"end_date": "2026-01-01",
"rates": {
"MORTGAGE_15Y": [
{
"period": "2025-01",
"open": 5.30,
"high": 5.35,
"low": 5.25,
"close": 5.33,
"data_points": 20
}
]
}
}
This endpoint is particularly useful for financial analysts who want to perform technical analysis on mortgage rate trends.
7. GET /api/v1/convert
The convert endpoint allows you to compare the total interest cost of a loan at different rates, which can be invaluable for users considering various mortgage options.
cURL Example:
curl "https://interestratesapi.com/api/v1/convert?from=MORTGAGE_15Y&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"amount": 100000,
"term_months": 12,
"from": {
"symbol": "MORTGAGE_15Y",
"rate": 5.33,
"date": "2026-07-23",
"total_interest": 5330.00,
"total_payment": 105330.00
},
"to": {
"symbol": "ECB_MRO",
"rate": 4.50,
"date": "2026-07-23",
"total_interest": 4500.00,
"total_payment": 104500.00
},
"difference": {
"rate_spread": 0.83,
"interest_saved": 830.00
}
}
This endpoint can help users make informed decisions about their mortgage options by comparing the costs associated with different interest rates.
Error Handling
When integrating with the Interest Rates API, it's essential to handle errors gracefully. Here are some common error responses you may encounter:
- 401: Missing api_key, invalid or revoked key, user not found.
- 403: Account without active plan.
- 404: No symbols matched or no data for requested date/range.
- 422: Validation error (e.g., wrong date format, invalid symbol).
- 429: Request quota exhausted.
For error handling, you should check the success field in the response. If it is false, you can log the error message for debugging purposes.
Rate Limit Headers
The Interest Rates API provides rate limit headers that can help you manage your API usage effectively:
- X-RateLimit-Limit: The maximum number of requests you're allowed to make in a given time period.
- X-RateLimit-Remaining: The number of requests remaining in the current time period.
- X-RateLimit-Reset: The time when the rate limit will reset, in UTC epoch seconds.
By monitoring these headers, you can implement logic in your application to handle rate limits, such as retrying requests after a certain period or notifying users when limits are reached.
Mini End-to-End Project: Node.js/Express Endpoint
To demonstrate how to fetch, cache, and serve MORTGAGE_15Y rate data, here’s a simple Node.js/Express application:
const express = require('express');
const fetch = require('node-fetch');
const app = express();
const PORT = process.env.PORT || 3000;
app.get('/mortgage-rate', async (req, res) => {
const apiKey = 'YOUR_KEY';
const response = await fetch(`https://interestratesapi.com/api/v1/latest?symbols=MORTGAGE_15Y&api_key=${apiKey}`);
const data = await response.json();
if (!data.success) {
return res.status(500).json({ error: data.error });
}
res.json(data);
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
This simple Express server fetches the latest mortgage rate and serves it to clients. You can expand this application by adding caching mechanisms, error handling, and more endpoints as needed.
Conclusion
Integrating the US 15-Year Mortgage data into your application using the Interest Rates API from interestratesapi.com is a straightforward process that can provide significant value to your users. By leveraging the various endpoints available, you can access real-time and historical mortgage rate data, perform trend analysis, and offer comparative insights on loan costs. This guide has covered the essential steps and provided code examples to help you get started. For more information, visit Explore Interest Rates API features and Get started with Interest Rates API.




