DNB Historical Data API: Timeseries, Charts & Downloads

DNB Historical Data API: Timeseries, Charts & Downloads

Introduction

In the fast-paced world of finance, access to accurate and timely interest rate data is crucial for developers, economists, and financial analysts. The DNB 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 explore the various endpoints of the DNB Historical Data API, focusing on the DNB_RATE (Danmarks Nationalbank Rate) and how it can be leveraged for effective financial analysis and application development.

Understanding the DNB_RATE

The DNB_RATE represents the monthly interest rate set by Danmarks Nationalbank, the central bank of Denmark. This rate is pivotal for various financial applications, including loan calculations, economic forecasting, and investment analysis. By utilizing the DNB Historical Data API, developers can access historical data, perform time series analysis, and visualize trends through charts.

Key Endpoints of the DNB Historical Data API

The DNB Historical Data API offers several endpoints that allow users to retrieve different types of data. Below, we will discuss each endpoint in detail, providing code examples and JSON response formats.

1. Retrieve Available Symbols

The first step in using the API is to retrieve the available symbols, including DNB_RATE. This can be done using the following endpoint:

GET /api/v1/symbols

Example cURL request:

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

Example JSON response:

{
"success": true,
"count": 1,
"symbols": [
{
"symbol": "DNB_RATE",
"name": "Danmarks Nationalbank Rate",
"category": "central_bank",
"country_code": "DK",
"currency_code": "DKK",
"frequency": "monthly",
"description": "The interest rate set by Danmarks Nationalbank."
}
]
}

This endpoint is essential for developers to understand what data is available for retrieval.

2. Fetch Latest Rates

To get the most recent value of the DNB_RATE, you can use the following endpoint:

GET /api/v1/latest

Example cURL request:

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

Example JSON response:

{
"success": true,
"date": "2026-05-29",
"base": "DKK",
"rates": {
"DNB_RATE": 5.33
},
"dates": {
"DNB_RATE": "2026-05-29"
},
"currencies": {
"DNB_RATE": "DKK"
}
}

This endpoint is crucial for applications that require real-time interest rate data for calculations or analytics.

3. Historical Data Retrieval

For point-in-time lookups, the historical endpoint allows users to fetch the DNB_RATE for a specific date:

GET /api/v1/historical

Example cURL request:

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

Example JSON response:

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

This endpoint is particularly useful for analyzing historical trends and making informed decisions based on past data.

4. Time Series Data

The time series endpoint allows users to retrieve a series of DNB_RATE values between two dates:

GET /api/v1/timeseries

Example cURL request:

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

Example JSON response:

{
"success": true,
"base": "DKK",
"start_date": "2025-01-01",
"end_date": "2026-01-01",
"rates": {
"DNB_RATE": {
"2025-01-01": 5.50,
"2025-02-01": 5.45,
"2025-03-01": 5.40
}
},
"frequencies": {
"DNB_RATE": "monthly"
},
"currencies": {
"DNB_RATE": "DKK"
}
}

This endpoint is essential for developers looking to perform time series analysis, allowing them to visualize trends over time.

5. Fluctuation Analysis

The fluctuation endpoint provides statistics on changes in the DNB_RATE over a specified date range:

GET /api/v1/fluctuation

Example cURL request:

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

Example JSON response:

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

This endpoint is valuable for understanding the volatility of interest rates, which can inform investment strategies and risk assessments.

6. OHLC Data for Candlestick Charts

The OHLC (Open, High, Low, Close) endpoint allows users to retrieve candlestick data for visualizing trends:

GET /api/v1/ohlc

Example cURL request:

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

Example JSON response:

{
"success": true,
"period": "monthly",
"start_date": "2025-01-01",
"end_date": "2026-01-01",
"rates": {
"DNB_RATE": [
{
"period": "2025-01",
"open": 5.50,
"high": 5.50,
"low": 5.45,
"close": 5.45,
"data_points": 30
},
{
"period": "2025-02",
"open": 5.45,
"high": 5.45,
"low": 5.40,
"close": 5.40,
"data_points": 28
}
]
}
}

This endpoint is particularly useful for developers looking to create visualizations, such as candlestick charts, to represent interest rate trends over time.

7. Loan Interest Cost Comparison

The convert endpoint allows users to compare loan interest costs between two rates:

GET /api/v1/convert

Example cURL request:

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

Example JSON response:

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

This endpoint is valuable for financial analysts and developers who need to compare the cost of loans based on different interest rates.

Building a Data Pipeline with Python

To effectively utilize the DNB Historical Data API, developers can build a data pipeline in Python to fetch, process, and export interest rate data. Below is a sample code snippet that demonstrates how to retrieve DNB_RATE data, convert it into a pandas DataFrame, and export it as a CSV file:

import requests
import pandas as pd

# Fetching the time series data
response = requests.get(
'https://interestratesapi.com/api/v1/timeseries',
params=dict(start='2025-01-01', end='2026-01-01', symbols='DNB_RATE', api_key='YOUR_KEY')
)

data = response.json()

# Processing the data into a DataFrame
dates = data['rates']['DNB_RATE']
df = pd.DataFrame(list(dates.items()), columns=['Date', 'Rate'])

# Exporting to CSV
df.to_csv('dnb_rate_data.csv', index=False)

This pipeline allows developers to automate the retrieval and storage of interest rate data 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 required dates, especially when analyzing trends over time.
  • Frequency Considerations: Understand the frequency of the data (daily, monthly) and how it impacts analysis.
  • Data Points Interpretation: Be cautious when interpreting data points, especially for monthly symbols where the last day of the month may not always have data.

Conclusion

The DNB Historical Data API from Interest Rates API provides a robust framework for accessing and analyzing interest rate data. By leveraging the various endpoints, developers can build powerful financial applications that rely on accurate and timely data. Whether you are conducting historical analysis, visualizing trends, or comparing loan costs, the DNB_RATE offers valuable insights that can enhance decision-making processes in the financial sector.

To get started with the DNB Historical Data API, visit Explore Interest Rates API features and begin integrating this powerful tool into your applications.

Ready to get started?

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

Get API Key

Related posts