Introduction
In the rapidly evolving fintech landscape, access to accurate and timely interest rate data is crucial for developers, economists, and financial analysts. The Interest Rates API from interestratesapi.com provides a comprehensive solution for integrating various interest rate data into applications. This guide focuses on the National Bank of Serbia Key Rate (NBS_RATE), detailing how to effectively utilize the API to access central bank rates, interbank rates, and financial time series analysis.
This blog post will walk you through the integration process step-by-step, covering all seven endpoints available in the Interest Rates API. By the end of this guide, you will have a solid understanding of how to implement the NBS_RATE data into your applications, complete with code examples in cURL, Python, JavaScript, and PHP.
Understanding the Importance of Interest Rate Data
Interest rates are a fundamental aspect of the financial ecosystem, influencing everything from loan costs to investment returns. For developers building fintech applications, having access to reliable interest rate data is essential for:
- Making informed lending decisions.
- Conducting accurate financial analyses.
- Providing users with real-time data for better financial planning.
- Enhancing the functionality of financial applications through data-driven insights.
Without access to such APIs, developers face challenges like data inaccuracy, outdated information, and the complexity of building and maintaining their own data sources. The Interest Rates API simplifies these challenges by providing a robust and reliable data source.
Getting Started with the Interest Rates API
To begin using the Interest Rates API, you need to familiarize yourself with the available endpoints. The API provides a variety of functionalities, including retrieving the latest rates, historical data, time series data, and more. Below, we will explore each endpoint in detail, starting with the symbols endpoint.
1. Fetching Available Symbols
The first step in integrating the NBS_RATE data is to retrieve the available symbols using the /api/v1/symbols endpoint. This endpoint allows you to filter symbols based on categories such as central bank rates, interbank rates, and more.
Here’s how to make a request to this endpoint:
curl "https://interestratesapi.com/api/v1/symbols?category=central_bank&base=RSD&api_key=YOUR_KEY"
JSON response example:
{
"success": true,
"count": 1,
"symbols": [
{
"symbol": "NBS_RATE",
"name": "National Bank of Serbia Key Rate",
"category": "central_bank",
"country_code": "RS",
"currency_code": "RSD",
"frequency": "monthly",
"description": "The interest rate set by the National Bank of Serbia."
}
]
}
This response indicates that the NBS_RATE is available for use, along with its details such as frequency and description.
2. Retrieving the Latest Rates
Once you have confirmed the availability of the NBS_RATE symbol, the next step is to retrieve the latest interest rate data using the /api/v1/latest endpoint. This endpoint provides the most recent values for specified symbols.
Here’s how to make a request:
curl "https://interestratesapi.com/api/v1/latest?symbols=NBS_RATE&api_key=YOUR_KEY"
JSON response example:
{
"success": true,
"date": "2026-06-22",
"base": "RSD",
"rates": {
"NBS_RATE": 5.33
},
"currencies": {
"NBS_RATE": "RSD"
}
}
This response provides the latest NBS_RATE value, which can be utilized in your application for various financial calculations.
3. Accessing Historical Data
To analyze trends over time, you may need to access historical data for the NBS_RATE. The /api/v1/historical endpoint allows you to retrieve the interest rate for a specific date.
Here’s how to make a request:
curl "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=NBS_RATE&api_key=YOUR_KEY"
JSON response example:
{
"success": true,
"date": "2025-06-15",
"base": "RSD",
"rates": {
"NBS_RATE": 5.25
},
"currencies": {
"NBS_RATE": "RSD"
}
}
This response provides the NBS_RATE for the specified date, allowing you to perform historical analyses.
4. Analyzing Time Series Data
For a more comprehensive analysis, you can retrieve time series data using the /api/v1/timeseries endpoint. This endpoint allows you to get a series of rates between two specified dates.
Here’s how to make a request:
curl "https://interestratesapi.com/api/v1/timeseries?start=2025-06-01&end=2026-06-01&symbols=NBS_RATE&api_key=YOUR_KEY"
JSON response example:
{
"success": true,
"base": "RSD",
"start_date": "2025-06-01",
"end_date": "2026-06-01",
"rates": {
"NBS_RATE": {
"2025-06-01": 5.25,
"2025-07-01": 5.30,
"2025-08-01": 5.33
}
},
"frequencies": {
"NBS_RATE": "monthly"
},
"currencies": {
"NBS_RATE": "RSD"
}
}
This response provides a series of NBS_RATE values over the specified date range, which can be useful for trend analysis and forecasting.
5. Evaluating Rate Fluctuations
To understand how the NBS_RATE has changed over a specific period, you can use the /api/v1/fluctuation endpoint. This endpoint provides statistics on the rate changes, including the percentage change and the highest and lowest values during the period.
Here’s how to make a request:
curl "https://interestratesapi.com/api/v1/fluctuation?start=2025-06-01&end=2026-06-01&symbols=NBS_RATE&api_key=YOUR_KEY"
JSON response example:
{
"success": true,
"rates": {
"NBS_RATE": {
"start_date": "2025-06-01",
"end_date": "2026-06-01",
"start_value": 5.25,
"end_value": 5.33,
"change": 0.08,
"change_pct": 1.52,
"high": 5.35,
"low": 5.20
}
}
}
This response provides valuable insights into the fluctuations of the NBS_RATE, which can inform financial decision-making.
6. Obtaining OHLC Data
For applications that require candlestick data, the /api/v1/ohlc endpoint provides Open, High, Low, and Close (OHLC) data for the NBS_RATE over a specified period.
Here’s how to make a request:
curl "https://interestratesapi.com/api/v1/ohlc?symbols=NBS_RATE&period=monthly&start=2025-06-01&end=2026-06-01&api_key=YOUR_KEY"
JSON response example:
{
"success": true,
"period": "monthly",
"start_date": "2025-06-01",
"end_date": "2026-06-01",
"rates": {
"NBS_RATE": [
{
"period": "2025-06",
"open": 5.25,
"high": 5.30,
"low": 5.20,
"close": 5.33,
"data_points": 30
}
]
}
}
This response provides OHLC data for the NBS_RATE, which is essential for technical analysis in trading applications.
7. Comparing Loan Interest Costs
Finally, the /api/v1/convert endpoint allows you to compare the total interest cost between two rates, which is particularly useful for loan comparisons.
Here’s how to make a request:
curl "https://interestratesapi.com/api/v1/convert?from=NBS_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY"
JSON response example:
{
"success": true,
"amount": 100000,
"term_months": 12,
"from": {
"symbol": "NBS_RATE",
"rate": 5.33,
"date": "2026-06-22",
"total_interest": 5330.00,
"total_payment": 105330.00
},
"to": {
"symbol": "ECB_MRO",
"rate": 4.50,
"date": "2026-06-22",
"total_interest": 4500.00,
"total_payment": 104500.00
},
"difference": {
"rate_spread": 0.83,
"interest_saved": 830.00
}
}
This response provides a detailed comparison of the interest costs associated with two different rates, helping users make informed financial decisions.
Error Handling and Common Responses
When working 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 rate limit errors (429), the response will include headers such as:
- X-RateLimit-Limit: The maximum number of requests allowed in a given time period.
- X-RateLimit-Remaining: The number of requests remaining in the current time window.
- X-RateLimit-Reset: The time when the rate limit will reset.
Understanding these error responses and headers will help you build robust applications that can handle API interactions effectively.
Building a Mini Project: Node.js/Express Endpoint
To demonstrate the practical application of the Interest Rates API, let’s create a simple Node.js/Express endpoint that fetches and serves the NBS_RATE data. This example will include caching for efficiency.
const express = require('express');
const fetch = require('node-fetch');
const app = express();
const PORT = process.env.PORT || 3000;
app.get('/nbs-rate', async (req, res) => {
const apiKey = 'YOUR_KEY';
const url = `https://interestratesapi.com/api/v1/latest?symbols=NBS_RATE&api_key=${apiKey}`;
try {
const response = await fetch(url);
const data = await response.json();
if (!data.success) {
return res.status(404).json({ error: 'Data not found' });
}
res.json(data);
} catch (error) {
res.status(500).json({ error: 'Internal Server Error' });
}
});
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
This simple Express application fetches the latest NBS_RATE data and serves it through an endpoint. You can expand this project by adding caching mechanisms and error handling as needed.
Conclusion
Integrating interest rate data into your applications is made easy with the Interest Rates API from interestratesapi.com. By following the steps outlined in this guide, you can effectively utilize the NBS_RATE data for various financial applications. Whether you are analyzing trends, comparing loan costs, or providing real-time data to users, the API offers a robust solution for accessing critical financial information.
For more information and to explore the features of the Interest Rates API, visit Explore Interest Rates API features and Get started with Interest Rates API.




