Introduction
In the world of finance, understanding interest rates is crucial for making informed decisions regarding loans and investments. For developers building fintech applications, economists analyzing monetary policy, and financial data engineers, having access to accurate and timely interest rate data is essential. This blog post will focus on the Swiss National Bank (SNB) policy rate and how it can be utilized to compare loan costs across different benchmarks using the Interest Rates API. We will explore the API's capabilities, particularly the /convert endpoint, which allows users to calculate interest savings when comparing different loan rates.
Understanding the SNB Policy Rate
The SNB policy rate is the interest rate set by the Swiss National Bank, which influences the overall interest rates in the Swiss economy. It serves as a benchmark for various financial products, including loans and mortgages. By comparing the SNB policy rate with other central bank rates, borrowers can make more informed decisions about their financing options.
For instance, a business looking to secure a loan may want to compare the SNB policy rate with the European Central Bank's (ECB) main refinancing operations (MRO) rate or the Bank of England's (BOE) bank rate. This comparison can help the business understand potential interest savings and total loan costs.
Using the Interest Rates API
The Interest Rates API provides a comprehensive set of endpoints to access various interest rate data, including the SNB policy rate. The API allows users to retrieve the latest rates, historical data, and perform comparisons between different rates. In this blog post, we will focus on the /convert endpoint, which is particularly useful for calculating loan interest costs.
Endpoint Overview
The following endpoints are available in the Interest Rates API:
- /api/v1/symbols: Retrieve a catalogue of available rate symbols.
- /api/v1/latest: Get the latest value per symbol.
- /api/v1/historical: Retrieve the value on a specific date.
- /api/v1/timeseries: Get a series of rates between two dates.
- /api/v1/fluctuation: Get change statistics over a range.
- /api/v1/ohlc: Retrieve OHLC candlestick data.
- /api/v1/convert: Compare loan interest costs between two rates.
Loan Interest Cost Comparison with /convert
The /convert endpoint is designed to compare the total interest cost of a simple loan at the latest rate of each symbol. This is particularly useful for borrowers who want to understand how different interest rates will affect their loan payments. The endpoint requires the following parameters:
- from: The symbol of the interest rate to compare from (e.g., SNB_POLICY_RATE).
- to: The symbol of the interest rate to compare to (e.g., ECB_MRO).
- amount: The loan amount (numeric, >= 0).
- term_months: The loan term in months (default is 12).
Here’s an example of how to use the /convert endpoint to compare the SNB policy rate with the ECB MRO rate:
curl "https://interestratesapi.com/api/v1/convert?from=SNB_POLICY_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY"
The response will provide detailed information about the loan costs, including:
- total_interest: The total interest paid over the loan term.
- total_payment: The total amount paid back, including principal and interest.
- rate_spread: The difference between the two interest rates.
- interest_saved: The amount saved by choosing the lower interest rate.
Example Response
Here’s an example of a JSON response from the /convert endpoint:
{
"success": true,
"amount": 100000,
"term_months": 12,
"from": {
"symbol": "SNB_POLICY_RATE",
"rate": 5.33,
"date": "2026-08-06",
"total_interest": 5330.00,
"total_payment": 105330.00
},
"to": {
"symbol": "ECB_MRO",
"rate": 4.50,
"date": "2026-08-06",
"total_interest": 4500.00,
"total_payment": 104500.00
},
"difference": {
"rate_spread": 0.83,
"interest_saved": 830.00
}
}
Breaking Down the Response Fields
Understanding the response fields is crucial for interpreting the results of the loan comparison:
- total_interest: This field indicates the total interest that will be paid over the loan term based on the specified interest rate. In our example, the total interest for the SNB policy rate is 5330.00.
- total_payment: This is the total amount that the borrower will pay back, including both the principal and the interest. For the SNB policy rate, the total payment is 105330.00.
- rate_spread: This field shows the difference between the two interest rates being compared. A smaller spread indicates a more favorable rate for the borrower.
- interest_saved: This field represents the amount saved by choosing the lower interest rate. In our example, the borrower would save 830.00 by opting for the ECB MRO rate over the SNB policy rate.
Implementing a Reusable Calculator Function
To streamline the process of comparing loan costs, developers can create a reusable function that wraps the /convert endpoint. Below are examples in Python and JavaScript:
Python Example
import requests
def compare_loan_costs(from_symbol, to_symbol, amount, term_months, api_key):
response = requests.get(
'https://interestratesapi.com/api/v1/convert',
params=dict(from=from_symbol, to=to_symbol, amount=amount, term_months=term_months, api_key=api_key)
)
return response.json()
# Example usage
result = compare_loan_costs('SNB_POLICY_RATE', 'ECB_MRO', 100000, 12, 'YOUR_KEY')
print(result)
JavaScript Example
async function compareLoanCosts(fromSymbol, toSymbol, amount, termMonths, apiKey) {
const response = await fetch(
`https://interestratesapi.com/api/v1/convert?from=${fromSymbol}&to=${toSymbol}&amount=${amount}&term_months=${termMonths}&api_key=${apiKey}`
);
const data = await response.json();
return data;
}
// Example usage
compareLoanCosts('SNB_POLICY_RATE', 'ECB_MRO', 100000, 12, 'YOUR_KEY').then(console.log);
Use Cases for the /convert Endpoint
The /convert endpoint can be utilized in various scenarios, including:
- Mortgage Comparison Tools: Fintech applications can integrate this endpoint to help users compare mortgage rates from different lenders, allowing them to choose the most cost-effective option.
- Interbank Lending Cost Analysis: Financial institutions can use the endpoint to analyze the cost of borrowing between different central bank rates, aiding in decision-making for interbank lending.
- Fintech Lending Apps: Developers can build applications that provide users with insights into potential savings by comparing different loan products based on current interest rates.
Conclusion
The Interest Rates API, particularly the /convert endpoint, offers a powerful tool for comparing loan costs across different interest rates. By leveraging the SNB policy rate and other central bank rates, developers can create applications that provide valuable insights to borrowers, helping them make informed financial decisions. For more information on how to implement these features, visit Try Interest Rates API, Explore Interest Rates API features, and Get started with Interest Rates API.




