CNB Historical Data API: Timeseries, Charts & Downloads

CNB Historical Data API: Timeseries, Charts & Downloads

Understanding the Importance of Interest Rate Data

In the world of finance, accurate and timely interest rate data is crucial for a variety of stakeholders, including developers building fintech applications, economists analyzing market trends, quantitative analysts conducting financial modeling, and data engineers managing financial datasets. The ability to access historical and real-time interest rate data allows these professionals to make informed decisions, optimize financial strategies, and enhance their applications.

This blog post will explore the capabilities of the Interest Rates API, focusing specifically on the Czech National Bank Repo Rate (CNB_REPO_RATE). We will delve into various endpoints that facilitate the retrieval of interest rate data, including timeseries analysis, historical data lookups, and data visualization techniques.

Getting Started with the Interest Rates API

The Interest Rates API provides a comprehensive suite of endpoints that allow users to access a wide range of interest rate data. The base URL for all API requests is:

https://interestratesapi.com/api/v1/

All requests utilize the GET method, and authentication is handled through the api_key query parameter. For example:

https://interestratesapi.com/api/v1/latest?api_key=YOUR_KEY

Endpoint Overview

Below are the key endpoints available in the Interest Rates API:

  • /symbols - Retrieve a catalogue of available rate symbols.
  • /latest - Get the latest value per symbol.
  • /historical - Fetch the value on a specific date.
  • /timeseries - Retrieve a series of values between two dates.
  • /fluctuation - Get change statistics over a range.
  • /ohlc - Obtain OHLC candlestick data.
  • /convert - Compare loan interest costs between two rates.

Fetching Available Symbols

The first step in utilizing the Interest Rates API is to retrieve the available symbols. This can be done using the /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 fetch central bank symbols:

curl "https://interestratesapi.com/api/v1/symbols?category=central_bank&base=USD&api_key=YOUR_KEY"

The expected JSON response will look like this:

{
"success": true,
"count": 2,
"symbols": [
{
"symbol": "FED_FUNDS",
"name": "US Federal Funds Rate",
"category": "central_bank",
"country_code": "US",
"currency_code": "USD",
"frequency": "daily",
"description": "The interest rate at which depository institutions lend reserve balances to each other overnight"
}
]
}

Retrieving Latest Interest Rates

To get the most recent interest rates, you can use the /latest endpoint. This endpoint allows you to specify multiple symbols to retrieve their latest values.

For example, to fetch the latest values for the CNB Repo Rate and the ECB MRO, you would use the following request:

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

The response will provide the latest rates along with their respective dates:

{
"success": true,
"date": "2026-05-22",
"base": "MIXED",
"rates": {
"CNB_REPO_RATE": 5.33,
"ECB_MRO": 4.50
},
"dates": {
"CNB_REPO_RATE": "2026-05-22",
"ECB_MRO": "2026-05-22"
},
"currencies": {
"CNB_REPO_RATE": "USD",
"ECB_MRO": "EUR"
}
}

Accessing Historical Data

For point-in-time lookups, the /historical endpoint is invaluable. This endpoint allows you to retrieve the interest rate for a specific date. It is particularly useful for analyzing historical trends and making comparisons over time.

To fetch the CNB Repo Rate for June 15, 2025, you would execute the following request:

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

The expected response will include the rate for that specific date:

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

Time Series Analysis with the Timeseries Endpoint

The /timeseries endpoint is particularly powerful for conducting multi-year data fetches. It allows users to retrieve a series of interest rates between two specified dates, which is essential for time series analysis.

For instance, to get the CNB Repo Rate from May 22, 2025, to May 22, 2026, you would use the following request:

curl "https://interestratesapi.com/api/v1/timeseries?start=2025-05-22&end=2026-05-22&symbols=CNB_REPO_RATE&api_key=YOUR_KEY"

The response will include daily rates for the specified period:

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

Analyzing Rate Fluctuations

The /fluctuation endpoint provides insights into the change statistics over a specified date range. This is useful for understanding the volatility of interest rates and making informed decisions based on historical performance.

To analyze fluctuations in the CNB Repo Rate from May 22, 2025, to May 22, 2026, you would execute:

curl "https://interestratesapi.com/api/v1/fluctuation?start=2025-05-22&end=2026-05-22&symbols=CNB_REPO_RATE&api_key=YOUR_KEY"

The response will provide details such as the start and end values, percentage change, and the highest and lowest rates during that period:

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

Visualizing Data with OHLC Candlestick Charts

The /ohlc endpoint allows users to obtain Open, High, Low, and Close (OHLC) data, which is essential for creating candlestick charts. This visualization technique is widely used in financial analysis to represent price movements over time.

To retrieve monthly OHLC data for the CNB Repo Rate, you can use the following request:

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

The response will include the OHLC data for the specified period:

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

To visualize this data using Chart.js, you can integrate the following snippet:

const ctx = document.getElementById('myChart').getContext('2d');
const myChart = new Chart(ctx, {
type: 'candlestick',
data: {
datasets: [{
label: 'CNB Repo Rate',
data: [
{ x: '2025-01', o: 5.50, h: 5.50, l: 5.33, c: 5.33 }
]
}]
}
});

Comparing Loan Interest Costs

The /convert endpoint allows users to compare the total interest cost of a simple loan at the latest rate of each symbol. This is particularly useful for financial analysts and developers building applications that require loan comparisons.

For example, to compare the CNB Repo Rate with the ECB MRO for a loan amount of 100,000 over 12 months, you would use:

curl "https://interestratesapi.com/api/v1/convert?from=CNB_REPO_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY"

The response will provide a detailed comparison:

{
"success": true,
"amount": 100000,
"term_months": 12,
"from": {
"symbol": "CNB_REPO_RATE",
"rate": 5.33,
"date": "2026-05-22",
"total_interest": 5330.00,
"total_payment": 105330.00
},
"to": {
"symbol": "ECB_MRO",
"rate": 4.50,
"date": "2026-05-22",
"total_interest": 4500.00,
"total_payment": 104500.00
},
"difference": {
"rate_spread": 0.83,
"interest_saved": 830.00
}
}

Common Pitfalls in Time Series Analysis

When working with time series data, there are several pitfalls to be aware of:

  • Missing Dates: Ensure that your analysis accounts for weekends and holidays, as these can lead to gaps in data.
  • Frequency Considerations: Understand the implications of using daily versus monthly data, as this can affect the interpretation of trends.
  • Data Points Interpretation: Be cautious when interpreting the number of data points, especially for monthly symbols where the last day of the month is used.

Building a Data Pipeline with Python

To create a data pipeline that fetches CNB Repo Rate data, processes it into a pandas DataFrame, and exports it as a CSV or Parquet file, you can use the following Python code:

import requests
import pandas as pd

# Fetch timeseries data
response = requests.get(
'https://interestratesapi.com/api/v1/timeseries',
params=dict(start='2025-05-22', end='2026-05-22', symbols='CNB_REPO_RATE', api_key='YOUR_KEY')
)

data = response.json()

# Process data into DataFrame
dates = data['rates']['CNB_REPO_RATE']
df = pd.DataFrame(list(dates.items()), columns=['Date', 'Rate'])

# Export to CSV
df.to_csv('cnb_repo_rate.csv', index=False)

# Export to Parquet
df.to_parquet('cnb_repo_rate.parquet', index=False)

Conclusion

The Interest Rates API is a powerful tool for accessing and analyzing interest rate data, particularly the CNB Repo Rate. By leveraging the various endpoints, developers and financial professionals can retrieve historical data, conduct time series analysis, visualize trends, and compare loan costs effectively.

For more information and to explore the features of the Interest Rates API, visit Interest Rates API. Start building your financial applications today!

Ready to get started?

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

Get API Key

Related posts