Understanding the NBS Historical Data API: Timeseries, Charts & Downloads
In the fast-paced world of finance, accurate and timely data is crucial for making informed decisions. For developers building fintech applications, economists analyzing trends, and quantitative analysts seeking insights, the ability to access reliable interest rate data is paramount. The NBS Historical Data API from Interest Rates API provides a comprehensive solution for retrieving interest rate data, including central bank rates, interbank rates, and financial time series analysis. This blog post will delve into the capabilities of the NBS Historical Data API, focusing on the National Bank of Serbia's key rate (NBS_RATE) and how to effectively utilize its endpoints for various financial analyses.
Why Use the NBS Historical Data API?
The NBS Historical Data API addresses several business challenges faced by financial professionals:
- Data Accessibility: Financial analysts often struggle to gather accurate interest rate data from multiple sources. The NBS API consolidates this data, allowing users to access it through a single interface.
- Time Efficiency: Manually collecting and processing interest rate data can be time-consuming. The API automates this process, enabling users to focus on analysis rather than data gathering.
- Historical Insights: Understanding historical trends in interest rates is essential for forecasting and decision-making. The API provides access to historical data, allowing users to analyze trends over time.
- Real-Time Data: The API offers the latest interest rate values, ensuring that users have access to the most current information for their analyses.
Key Features of the NBS Historical Data API
The NBS Historical Data API offers several endpoints that cater to different data retrieval needs. Below, we will explore each endpoint in detail, providing examples and practical use cases.
1. Retrieve Available Symbols
The first step in utilizing the NBS API is to retrieve the available symbols. This can be done using the /api/v1/symbols endpoint. This endpoint allows users to filter symbols based on categories such as central bank rates, interbank rates, and more.
cURL Example:
curl "https://interestratesapi.com/api/v1/symbols?category=central_bank&base=USD&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"count": 2,
"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 provides a list of available symbols, including the NBS_RATE, which is essential for further data retrieval.
2. Fetch Latest Interest Rate Values
To obtain the most recent interest rate values, the /api/v1/latest endpoint can be used. This endpoint returns the latest values for specified symbols.
cURL Example:
curl "https://interestratesapi.com/api/v1/latest?symbols=NBS_RATE&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"date": "2026-07-12",
"base": "MIXED",
"rates": {
"NBS_RATE": 5.33
},
"dates": {
"NBS_RATE": "2026-07-12"
},
"currencies": {
"NBS_RATE": "RSD"
}
}
This response indicates that the latest NBS_RATE is 5.33% as of July 12, 2026. This data is crucial for real-time financial analysis and decision-making.
3. Historical Data Retrieval
For point-in-time lookups, the /api/v1/historical endpoint allows users to retrieve interest rate values for a specific date. This is particularly useful for analyzing historical trends and making comparisons.
cURL Example:
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.33
},
"currencies": {
"NBS_RATE": "RSD"
}
}
This response shows that on June 15, 2025, the NBS_RATE was 5.33%. Such historical data is invaluable for economists and analysts looking to understand past monetary policy decisions.
4. Time Series Data
The /api/v1/timeseries endpoint allows users to fetch a series of interest rate values between two specified dates. This is particularly useful for analyzing trends over time.
cURL Example:
curl "https://interestratesapi.com/api/v1/timeseries?start=2025-07-12&end=2026-07-12&symbols=NBS_RATE&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"base": "RSD",
"start_date": "2025-07-12",
"end_date": "2026-07-12",
"rates": {
"NBS_RATE": {
"2025-07-12": 5.33,
"2025-07-13": 5.33,
"2025-07-14": 5.33
}
},
"frequencies": {
"NBS_RATE": "daily"
},
"currencies": {
"NBS_RATE": "RSD"
}
}
This response provides daily rates for the NBS_RATE between the specified dates, allowing for detailed time series analysis. Analysts can visualize this data to identify trends and patterns.
5. Fluctuation Analysis
The /api/v1/fluctuation endpoint provides change statistics over a specified date range. This is useful for understanding how interest rates have fluctuated over time.
cURL Example:
curl "https://interestratesapi.com/api/v1/fluctuation?start=2025-07-12&end=2026-07-12&symbols=NBS_RATE&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"rates": {
"NBS_RATE": {
"start_date": "2025-07-12",
"end_date": "2026-07-12",
"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 NBS_RATE decreased from 5.50% to 5.33% over the specified period, providing insights into the monetary policy direction of the National Bank of Serbia.
6. OHLC Data for Candlestick Charts
The /api/v1/ohlc endpoint allows users to retrieve Open, High, Low, and Close (OHLC) data for specified symbols. This data is essential for creating candlestick charts, which are widely used in financial analysis.
cURL Example:
curl "https://interestratesapi.com/api/v1/ohlc?symbols=NBS_RATE&period=monthly&start=2025-07-12&end=2026-07-12&api_key=YOUR_KEY"
JSON Response Example:
{
"success": true,
"period": "monthly",
"start_date": "2025-07-12",
"end_date": "2026-07-12",
"rates": {
"NBS_RATE": [
{
"period": "2025-07",
"open": 5.50,
"high": 5.50,
"low": 5.33,
"close": 5.33,
"data_points": 23
}
]
}
}
This response provides monthly OHLC data for the NBS_RATE, which can be used to create candlestick charts using libraries like Chart.js or Plotly. Below is a simple integration snippet using Chart.js:
const ctx = document.getElementById('myChart').getContext('2d');
const myChart = new Chart(ctx, {
type: 'candlestick',
data: {
datasets: [{
label: 'NBS_RATE',
data: [
{ x: '2025-07', o: 5.50, h: 5.50, l: 5.33, c: 5.33 }
]
}]
}
});
Building a Data Pipeline with Python
For developers looking to integrate the NBS Historical Data API into their applications, Python provides a robust environment for data manipulation. Below is a complete example of how to fetch NBS_RATE data, load it into a Pandas DataFrame, and export it to CSV or Parquet format.
import requests
import pandas as pd
# Fetching time series data
response = requests.get(
'https://interestratesapi.com/api/v1/timeseries',
params=dict(start='2025-07-12', end='2026-07-12', symbols='NBS_RATE', api_key='YOUR_KEY')
)
data = response.json()
# Extracting rates into a DataFrame
dates = data['rates']['NBS_RATE']
df = pd.DataFrame(list(dates.items()), columns=['Date', 'Rate'])
# Exporting to CSV
df.to_csv('nbs_rate_data.csv', index=False)
# Exporting to Parquet
df.to_parquet('nbs_rate_data.parquet', index=False)
This code snippet demonstrates how to efficiently retrieve and store interest rate data for further analysis.
Common Pitfalls in Time Series Analysis
When working with time series data, several challenges can arise:
- Missing Dates: Financial data may not be available for every date, especially on weekends or holidays. It is essential to handle these gaps appropriately in your analysis.
- Frequency Considerations: Understanding the frequency of the data (daily vs. monthly) is crucial for accurate analysis. Ensure that your analysis aligns with the frequency of the data retrieved.
- Data Points Interpretation: The
data_pointsfield in the OHLC response indicates the number of data points used to calculate the OHLC values. This can impact the reliability of the data, especially in volatile markets.
Conclusion
The NBS Historical Data API from Interest Rates API provides a powerful tool for accessing and analyzing interest rate data. With endpoints for retrieving available symbols, latest values, historical data, time series, fluctuation analysis, and OHLC data, users can gain valuable insights into financial trends. By leveraging this API, developers and analysts can streamline their data retrieval processes, enabling them to focus on analysis and decision-making. For more information and to explore the features of the NBS Historical Data API, get started with Interest Rates API today!




