CBI Historical Data API: Timeseries, Charts & Downloads

CBI Historical Data API: Timeseries, Charts & Downloads

Introduction

In the rapidly evolving world of finance, access to accurate and timely interest rate data is crucial for developers, economists, and financial analysts. The CBI Historical Data API from Interest Rates API provides a comprehensive solution for retrieving central bank rates, interbank rates, and financial time series data. This blog post will delve into the various endpoints of the API, focusing on the Central Bank of Iceland Rate (CBI_RATE), and explore how developers can leverage this data for fintech applications, economic analysis, and quantitative research.

Understanding the CBI Historical Data API

The CBI Historical Data API offers a range of endpoints that allow users to access historical and current interest rate data. This API is particularly valuable for those involved in financial modeling, risk assessment, and economic forecasting. The API supports various functionalities, including retrieving the latest rates, historical data, time series data, and even fluctuation statistics over specified periods.

Key Features of the CBI Historical Data API

Here are the primary features of the CBI Historical Data API:

  • Latest Rates: Retrieve the most recent interest rates for specified symbols.
  • Historical Data: Access interest rates for specific dates.
  • Time Series Data: Fetch a series of interest rates between two dates.
  • Fluctuation Statistics: Analyze changes in interest rates over a specified period.
  • OHLC Data: Obtain open, high, low, and close data for candlestick charting.
  • Conversion: Compare loan interest costs between different rates.

Retrieving Latest Rates

The first step in utilizing the CBI Historical Data API is to retrieve the latest interest rates. This can be done using the /latest endpoint. The request format is straightforward, and it allows for multiple symbols to be queried simultaneously.

Endpoint: GET /api/v1/latest

To get the latest rates for the CBI_RATE and another symbol, you can use the following cURL command:

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

The expected JSON response will look like this:

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

In this response:

  • success: Indicates whether the request was successful.
  • date: The date of the latest rates.
  • base: The base currency for the rates.
  • rates: An object containing the latest rates for the requested symbols.
  • dates: The dates corresponding to each rate.
  • currencies: The currency codes for each rate.

Accessing Historical Data

For point-in-time lookups, the /historical endpoint allows users to retrieve interest rates for specific dates. This is particularly useful for analyzing historical trends and making informed decisions based on past data.

Endpoint: GET /api/v1/historical

To access historical data for the CBI_RATE on a specific date, use the following cURL command:

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

The expected JSON response will be:

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

In this response:

  • date: The date for which the historical rate is requested.
  • rates: Contains the interest rate for the requested symbol.
  • currencies: Indicates the currency of the rate.

Fetching Time Series Data

The /timeseries endpoint is essential for developers looking to analyze trends over time. This endpoint allows users to retrieve a series of interest rates between two specified dates.

Endpoint: GET /api/v1/timeseries

To fetch time series data for the CBI_RATE, use the following cURL command:

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

The expected JSON response will look like this:

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

In this response:

  • start_date: The beginning date of the time series.
  • end_date: The end date of the time series.
  • rates: An object containing the daily rates for the requested symbol.
  • frequencies: Indicates the frequency of the data points.
  • currencies: The currency of the rates.

Analyzing Fluctuation Statistics

The /fluctuation endpoint provides valuable insights into how interest rates change over a specified period. This can help in understanding market volatility and making strategic decisions.

Endpoint: GET /api/v1/fluctuation

To analyze fluctuations for the CBI_RATE, use the following cURL command:

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

The expected JSON response will be:

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

In this response:

  • start_date: The beginning date of the fluctuation analysis.
  • end_date: The end date of the fluctuation analysis.
  • start_value: The interest rate at the start date.
  • end_value: The interest rate at the end date.
  • change: The absolute change in the interest rate.
  • change_pct: The percentage change in the interest rate.
  • high: The highest rate during the period.
  • low: The lowest rate during the period.

Creating Candlestick Charts with OHLC Data

The /ohlc endpoint allows developers to create candlestick charts, which are essential for visualizing financial data. This endpoint computes open, high, low, and close values from daily data.

Endpoint: GET /api/v1/ohlc

To obtain OHLC data for the CBI_RATE, use the following cURL command:

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

The expected JSON response will be:

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

In this response:

  • period: The frequency of the OHLC data.
  • open: The opening rate for the period.
  • high: The highest rate during the period.
  • low: The lowest rate during the period.
  • close: The closing rate for the period.
  • data_points: The number of data points used to calculate the OHLC values.

Building a Python Data Pipeline

For developers looking to integrate the CBI Historical Data API into their applications, building a data pipeline using Python can be an effective approach. Below is a sample code snippet that demonstrates how to fetch data, convert 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-05-14', end='2026-05-14', symbols='CBI_RATE', api_key='YOUR_KEY')
)

data = response.json()

# Converting to DataFrame
df = pd.DataFrame(data['rates']['CBI_RATE']).T
df.index = pd.to_datetime(df.index)

# Exporting to CSV
df.to_csv('cbi_rate_data.csv')

# Exporting to Parquet
df.to_parquet('cbi_rate_data.parquet')

This code snippet demonstrates how to:

  • Fetch time series data for the CBI_RATE.
  • Convert the JSON response into a pandas DataFrame.
  • Export the DataFrame to CSV and Parquet formats for further analysis.

Common Pitfalls in Time Series Analysis

When working with time series data, developers should be aware of several common pitfalls:

  • Missing Dates: Ensure that the data covers all expected dates, especially when dealing with monthly symbols.
  • Frequency Considerations: Be mindful of the frequency of the data (daily vs. monthly) when performing analyses.
  • Data Points Interpretation: Understand how the number of data points affects the reliability of the OHLC values.

Conclusion

The CBI Historical Data API from Interest Rates API provides a robust framework for accessing and analyzing interest rate data. By leveraging its various endpoints, developers can build powerful fintech applications, conduct economic research, and perform quantitative analyses. Whether you are retrieving the latest rates, analyzing historical data, or creating visualizations, this API offers the tools necessary to make informed financial decisions.

To get started with the CBI Historical Data API, visit Explore Interest Rates API features and begin integrating these valuable data points into your applications.

For more information, check out Try Interest Rates API and Get started with Interest Rates API.

Ready to get started?

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

Get API Key

Related posts