Your product needs the Danmarks Nationalbank policy rate inside code, not in a PDF. By the end of this guide you will query the DNB_RATE symbol from the Interest Rates API, interpret monthly effective dates correctly, cache responses safely, compute spreads and payments from the returned value, and wire seven production endpoints into dashboards, loan tools, and risk models.
What the DNB_RATE represents and how it’s expressed
DNB_RATE is the Danmarks Nationalbank policy rate delivered by the Interest Rates API as a numeric percentage (annualized) in DKK and updated on a monthly frequency. In practice, you read it as “X percent per annum,” suitable for macro analysis, loan pricing spreads, and treasury dashboards. Monthly frequency means you will see one effective value for each month, with the effective date aligned to the last business day (or the last day with data) in that month.
Key implications for your integration:
- Units: numeric percentage, annualized (e.g., 2.10 interpreted as 2.10% per annum).
- Effective date: for monthly symbols, the API associates the rate to the last day with data within that month.
- Currency: DKK for DNB_RATE (verify via the currencies map in responses).
- Business days: the same monthly value will appear across business days in that period when requested via daily or timeseries endpoints.
How to find the symbol and its metadata
Use the catalogue endpoint to browse available rates and confirm category, frequency, and currency. While the example below lists a US rate for illustration, you will use this endpoint to discover DNB_RATE as a central bank symbol in DKK with monthly frequency.
Endpoint: GET /api/v1/symbols
Filters help narrow results by currency, category, or provider.
curl -s "https://interestratesapi.com/api/v1/latest?api_key=YOUR_API_KEY&symbols=DNB_RATE"
{
"success": true,
"date": "2026-10-31",
"base": "DKK",
"rates": {
"DNB_RATE": 2.1
},
"dates": {
"DNB_RATE": "2026-10-31"
},
"currencies": {
"DNB_RATE": "DKK"
},
"base_filter_note": null
}
The fields you will rely on:
- symbol: the code used in all other endpoints (e.g., DNB_RATE).
- frequency: tells you how to interpret dates (monthly for DNB_RATE).
- currency_code: should be DKK for DNB_RATE.
Explore the catalogue or jump straight to building with DNB_RATE using the documentation at Interest Rates API MCP and the main site interestratesapi.com.
Get the latest DNB_RATE
The latest endpoint returns the current monthly value, its effective date, and currency. The following cURL and JSON are the official sample and must match your implementation format. Authentication is by query parameter api_key. All endpoints use GET.
Endpoint: GET /api/v1/latest
How to read this:
- rates.DNB_RATE: the rate value in percent (2.1 → 2.10% p.a.).
- dates.DNB_RATE: the effective date for this monthly value (2026-10-31).
- currencies.DNB_RATE: DKK, confirming the currency basis of the rate.
Latest in Python (requests)
import requests
resp = requests.get(
"https://interestratesapi.com/api/v1/latest",
params={"symbols": "DNB_RATE", "api_key": "YOUR_API_KEY"}
)
data = resp.json()
rate = data["rates"]["DNB_RATE"]
effective_date = data["dates"]["DNB_RATE"]
currency = data["currencies"]["DNB_RATE"]
print(f"DNB_RATE: {rate}% (effective {effective_date}, currency {currency})")
Latest in JavaScript (fetch)
const response = await fetch(
"https://interestratesapi.com/api/v1/latest?symbols=DNB_RATE&api_key=YOUR_API_KEY"
);
const data = await response.json();
const rate = data.rates.DNB_RATE;
const effectiveDate = data.dates.DNB_RATE;
const currency = data.currencies.DNB_RATE;
console.log(`DNB_RATE: ${rate}% (effective ${effectiveDate}, currency ${currency})`);
Latest in PHP
<?php
$url = "https://interestratesapi.com/api/v1/latest?symbols=DNB_RATE&api_key=YOUR_API_KEY";
$json = file_get_contents($url);
$data = json_decode($json, true);
$rate = $data["rates"]["DNB_RATE"];
$effective = $data["dates"]["DNB_RATE"];
$ccy = $data["currencies"]["DNB_RATE"];
echo "DNB_RATE: {$rate}% (effective {$effective}, currency {$ccy})";
?>
Point-in-time queries for monthly rates
When you need the policy rate as of a specific date (for example, to backfill a loan reset on a statement date), use the historical endpoint. For monthly symbols, the API returns the month’s value using the last day with data in that month. The following examples use illustrative values; rely on your live calls for actual numbers.
Endpoint: GET /api/v1/historical
Notes:
- date: your requested calendar date (the month is what matters for monthly series).
- rates.DNB_RATE: monthly value effective in that month (illustrative in this sample).
- currencies map: confirms the currency basis for each symbol.
Historical in Python (requests)
import requests
resp = requests.get(
"https://interestratesapi.com/api/v1/historical",
params={"date": "2025-06-15", "symbols": "DNB_RATE", "api_key": "YOUR_API_KEY"}
)
data = resp.json()
value = data["rates"]["DNB_RATE"]
print("DNB_RATE on 2025-06-15:", value)
Historical in JavaScript (fetch)
const resp = await fetch(
"https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=DNB_RATE&api_key=YOUR_API_KEY"
);
const hist = await resp.json();
console.log("DNB_RATE on 2025-06-15:", hist.rates.DNB_RATE);
Historical in PHP
<?php
$u = "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=DNB_RATE&api_key=YOUR_API_KEY";
$d = json_decode(file_get_contents($u), true);
echo "DNB_RATE on 2025-06-15: ".$d["rates"]["DNB_RATE"];
?>
Time series for charts, models, and backtesting
Time series pulls values between start and end dates. For monthly DNB_RATE, you will typically see one distinct value per month repeated across business days in the range. The example below is illustrative.
Endpoint: GET /api/v1/timeseries
Fields to integrate:
- rates.DNB_RATE: date-to-value map you can plot directly.
- frequencies: confirms how often values occur in the range.
- start_date/end_date: useful for labeling charts and validating inputs.
Timeseries in Python (requests)
import requests
resp = requests.get(
"https://interestratesapi.com/api/v1/timeseries",
params={
"start": "2025-11-14",
"end": "2026-11-14",
"symbols": "DNB_RATE",
"api_key": "YOUR_API_KEY",
}
)
series = resp.json()["rates"]["DNB_RATE"]
for d, v in series.items():
print(d, v)
Timeseries in JavaScript (fetch)
const ts = await fetch(
"https://interestratesapi.com/api/v1/timeseries?start=2025-11-14&end=2026-11-14&symbols=DNB_RATE&api_key=YOUR_API_KEY"
).then(r => r.json());
Object.entries(ts.rates.DNB_RATE).forEach(([date, value]) => {
console.log(date, value);
});
Timeseries in PHP
<?php
$url = "https://interestratesapi.com/api/v1/timeseries?start=2025-11-14&end=2026-11-14&symbols=DNB_RATE&api_key=YOUR_API_KEY";
$data = json_decode(file_get_contents($url), true);
foreach ($data["rates"]["DNB_RATE"] as $date => $val) {
echo $date." ".$val.PHP_EOL;
}
?>
Fluctuation statistics over a period
Use fluctuation to summarize changes in DNB_RATE between two dates: the start and end values, absolute and percent change, and range high/low. Sample below uses illustrative values.
Endpoint: GET /api/v1/fluctuation
Fields you’ll plot or alert on:
- start_value/end_value: the level at each boundary date.
- change/change_pct: absolute and percentage moves across the period.
- high/low: range extremes you can lay behind candlesticks or distribution views.
Fluctuation in Python (requests)
import requests
resp = requests.get(
"https://interestratesapi.com/api/v1/fluctuation",
params={"start": "2025-11-14", "end": "2026-11-14", "symbols": "DNB_RATE", "api_key": "YOUR_API_KEY"}
)
fx = resp.json()["rates"]["DNB_RATE"]
print(f"Δ {fx['change']} ({fx['change_pct']}%), high={fx['high']}, low={fx['low']}")
Fluctuation in JavaScript (fetch)
const f = await fetch(
"https://interestratesapi.com/api/v1/fluctuation?start=2025-11-14&end=2026-11-14&symbols=DNB_RATE&api_key=YOUR_API_KEY"
).then(r => r.json());
const s = f.rates.DNB_RATE;
console.log(`Δ ${s.change} (${s.change_pct}%), range ${s.low}–${s.high}`);
Fluctuation in PHP
<?php
$u = "https://interestratesapi.com/api/v1/fluctuation?start=2025-11-14&end=2026-11-14&symbols=DNB_RATE&api_key=YOUR_API_KEY";
$d = json_decode(file_get_contents($u), true)["rates"]["DNB_RATE"];
echo "Change {$d["change"]} ({$d["change_pct"]}%), high {$d["high"]}, low {$d["low"]}";
?>
OHLC for charting monthly candles
The OHLC endpoint builds candles on the fly from underlying daily data. It’s especially helpful when you want compact monthly visuals for DNB_RATE alongside other benchmarks. Values below are illustrative.
Endpoint: GET /api/v1/ohlc
Integrate these fields:
- period: YYYY-MM key for monthly candles.
- open/high/low/close: values you feed to your charting library.
- data_points: number of data rows aggregated in that period.
OHLC in Python (requests)
import requests
resp = requests.get(
"https://interestratesapi.com/api/v1/ohlc",
params={"symbols": "DNB_RATE", "period": "monthly", "start": "2025-11-14", "end": "2026-11-14", "api_key": "YOUR_API_KEY"}
)
bars = resp.json()["rates"]["DNB_RATE"]
for bar in bars:
print(bar["period"], bar["open"], bar["high"], bar["low"], bar["close"])
OHLC in JavaScript (fetch)
const ohlc = await fetch(
"https://interestratesapi.com/api/v1/ohlc?symbols=DNB_RATE&period=monthly&start=2025-11-14&end=2026-11-14&api_key=YOUR_API_KEY"
).then(r => r.json());
(ohlc.rates.DNB_RATE || []).forEach(c => {
console.log(c.period, c.open, c.high, c.low, c.close, c.data_points);
});
OHLC in PHP
<?php
$u = "https://interestratesapi.com/api/v1/ohlc?symbols=DNB_RATE&period=monthly&start=2025-11-14&end=2026-11-14&api_key=YOUR_API_KEY";
$d = json_decode(file_get_contents($u), true)["rates"]["DNB_RATE"];
foreach ($d as $row) {
echo "{$row["period"]} O={$row["open"]} H={$row["high"]} L={$row["low"]} C={$row["close"]} (n={$row["data_points"]})".PHP_EOL;
}
?>
Compare loan interest costs and compute spreads
If you need a simple comparison of total interest costs for a notional loan priced at DNB_RATE versus another benchmark, use convert. It returns the latest level of each symbol and computes total interest for a simple loan over a specified term. The API response below is illustrative.
Endpoint: GET /api/v1/convert
Usage notes:
- amount: principal for the comparison.
- term_months: simple term used for interest calculation in the response.
- difference.rate_spread: arithmetic spread between the two latest rates.
Convert in Python (requests)
import requests
resp = requests.get(
"https://interestratesapi.com/api/v1/convert",
params={"from": "DNB_RATE", "to": "ECB_MRO", "amount": 100000, "term_months": 12, "api_key": "YOUR_API_KEY"}
)
cmp = resp.json()
print("Spread:", cmp["difference"]["rate_spread"], "Interest saved:", cmp["difference"]["interest_saved"])
Convert in JavaScript (fetch)
const cmp = await fetch(
"https://interestratesapi.com/api/v1/convert?from=DNB_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_API_KEY"
).then(r => r.json());
console.log(`Spread: ${cmp.difference.rate_spread}, Interest saved: ${cmp.difference.interest_saved}`);
Convert in PHP
<?php
$u = "https://interestratesapi.com/api/v1/convert?from=DNB_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_API_KEY";
$d = json_decode(file_get_contents($u), true);
echo "Spread ".$d["difference"]["rate_spread"].", Interest saved ".$d["difference"]["interest_saved"];
?>
Read the responses correctly: dates, currencies, and caching
Every endpoint returns fields that help you validate and cache data safely:
- rates map: symbol-to-value or date-to-value mappings you chart and compute with.
- dates map (latest): per-symbol effective date — essential for monthly series like DNB_RATE.
- currencies map: confirms the basis (DKK for DNB_RATE). Do not assume currency.
- frequencies map (timeseries): precise frequency of the returned data.
- OHLC data_points: count of input rows aggregated into the candle.
- fluctuation change_pct: percentage move relative to start_value (null if start_value is 0).
Caching guidance for production:
- Latest: cache for the business day; DNB_RATE is monthly, so cache until the next publication cycle or until you detect a new effective date via a daily poll.
- Historical: values are stable after publication; cache aggressively per (symbol, month).
- Timeseries/OHLC/Fluctuation: cache per parameter tuple. Bust cache when your polling detects a new effective month for DNB_RATE.
- Respect rate limits; on 429, observe Retry-After and X-RateLimit-* headers.
Error handling and reliability
Plan for the following standardized errors:
- 401: Missing or invalid api_key.
- 403: Account without an active plan.
- 404: Unknown symbol or no data in the requested date range (may include a details field with available ranges).
- 422: Validation error (e.g., wrong date format).
- 429: Request quota exhausted; back off based on Retry-After, X-RateLimit-Reset.
All requests must be GET to interestratesapi.com with api_key as a query parameter. Do not send the key in a header.
Practical computations from DNB_RATE
With monthly central bank rates, you typically compute:
- Static spread: spread = benchmark_bps – DNB_RATE_bps. Use rates from /latest or /historical; never hardcode.
- Monthly interest from annual rate: monthly_rate = (annual_percent / 100) / 12; interest_this_month = principal × monthly_rate.
- Payment on an amortizing loan: payment = P × r_m / (1 – (1 + r_m)^(-n)), where r_m is the monthly decimal rate derived from DNB_RATE.
These formulas are deterministic and do not require you to invent rate levels. Always take the actual percent value from the API, convert to decimal (divide by 100), and then annual-to-monthly (divide by 12) when you need a monthly charge.
Publication cadence, business days, and timezones
For DNB_RATE (monthly):
- Publication frequency: monthly. You will see one effective value per month.
- Effective date: the last day with data in that month, as returned in dates.DNB_RATE on /latest.
- Business days: when querying ranges, the same monthly value may appear on multiple business days within the month.
- Timezones: dates are UTC calendar dates in API responses; align your application’s timezone to avoid off-by-one issues at month-end.
Putting it all together: seven endpoints you will ship
This section recaps each endpoint for DNB_RATE with cURL and language calls you can paste. Values shown outside the official latest sample are illustrative; your runtime responses will differ.
1) Catalogue: /api/v1/symbols
import requests
r = requests.get("https://interestratesapi.com/api/v1/symbols",
params={"category": "central_bank", "base": "DKK", "api_key": "YOUR_API_KEY"})
print([s["symbol"] for s in r.json().get("symbols", [])])
const resp = await fetch("https://interestratesapi.com/api/v1/symbols?category=central_bank&base=DKK&api_key=YOUR_API_KEY");
const list = await resp.json();
console.log(list.symbols?.map(s => s.symbol));
<?php
$u = "https://interestratesapi.com/api/v1/symbols?category=central_bank&base=DKK&api_key=YOUR_API_KEY";
$d = json_decode(file_get_contents($u), true);
foreach (($d["symbols"] ?? []) as $s) { echo $s["symbol"].PHP_EOL; }
?>
2) Latest: /api/v1/latest
Use the official cURL and JSON above in this article for validation; here are the language patterns again for quick paste.
import requests
response = requests.get(
'https://interestratesapi.com/api/v1/latest',
params=dict(symbols='DNB_RATE', api_key='YOUR_API_KEY')
)
data = response.json()
const response = await fetch(
'https://interestratesapi.com/api/v1/latest?symbols=DNB_RATE&api_key=YOUR_API_KEY'
);
const data = await response.json();
<?php
echo file_get_contents("https://interestratesapi.com/api/v1/latest?symbols=DNB_RATE&api_key=YOUR_API_KEY");
?>
3) Historical (point-in-time): /api/v1/historical
import requests
r = requests.get("https://interestratesapi.com/api/v1/historical",
params={"date":"2025-06-15","symbols":"DNB_RATE","api_key":"YOUR_API_KEY"})
print(r.json())
const r = await fetch("https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=DNB_RATE&api_key=YOUR_API_KEY");
console.log(await r.json());
<?php
echo file_get_contents("https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=DNB_RATE&api_key=YOUR_API_KEY");
?>
4) Timeseries: /api/v1/timeseries
import requests
r = requests.get("https://interestratesapi.com/api/v1/timeseries",
params={"start":"2025-11-14","end":"2026-11-14","symbols":"DNB_RATE","api_key":"YOUR_API_KEY"})
print(r.json())
const r = await fetch("https://interestratesapi.com/api/v1/timeseries?start=2025-11-14&end=2026-11-14&symbols=DNB_RATE&api_key=YOUR_API_KEY");
console.log(await r.json());
<?php
echo file_get_contents("https://interestratesapi.com/api/v1/timeseries?start=2025-11-14&end=2026-11-14&symbols=DNB_RATE&api_key=YOUR_API_KEY");
?>
5) Fluctuation: /api/v1/fluctuation
import requests
r = requests.get("https://interestratesapi.com/api/v1/fluctuation",
params={"start":"2025-11-14","end":"2026-11-14","symbols":"DNB_RATE","api_key":"YOUR_API_KEY"})
print(r.json())
const r = await fetch("https://interestratesapi.com/api/v1/fluctuation?start=2025-11-14&end=2026-11-14&symbols=DNB_RATE&api_key=YOUR_API_KEY");
console.log(await r.json());
<?php
echo file_get_contents("https://interestratesapi.com/api/v1/fluctuation?start=2025-11-14&end=2026-11-14&symbols=DNB_RATE&api_key=YOUR_API_KEY");
?>
6) OHLC: /api/v1/ohlc
import requests
r = requests.get("https://interestratesapi.com/api/v1/ohlc",
params={"symbols":"DNB_RATE","period":"monthly","start":"2025-11-14","end":"2026-11-14","api_key":"YOUR_API_KEY"})
print(r.json())
const r = await fetch("https://interestratesapi.com/api/v1/ohlc?symbols=DNB_RATE&period=monthly&start=2025-11-14&end=2026-11-14&api_key=YOUR_API_KEY");
console.log(await r.json());
<?php
echo file_get_contents("https://interestratesapi.com/api/v1/ohlc?symbols=DNB_RATE&period=monthly&start=2025-11-14&end=2026-11-14&api_key=YOUR_API_KEY");
?>
7) Convert (loan comparison): /api/v1/convert
import requests
r = requests.get("https://interestratesapi.com/api/v1/convert",
params={"from":"DNB_RATE","to":"ECB_MRO","amount":100000,"term_months":12,"api_key":"YOUR_API_KEY"})
print(r.json())
const r = await fetch("https://interestratesapi.com/api/v1/convert?from=DNB_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_API_KEY");
console.log(await r.json());
<?php
echo file_get_contents("https://interestratesapi.com/api/v1/convert?from=DNB_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_API_KEY");
?>
Real-world use cases
- Interest rate dashboards: display DNB_RATE alongside other policy rates with /latest and /timeseries; use /ohlc for compact monthly charts.
- Lending and mortgage pricing: compute spreads over DNB_RATE and derive monthly charges; validate historical resets with /historical.
- Treasury and ALM: monitor regime shifts using /fluctuation and create alerts on change_pct thresholds.
- Macro research and quant pipelines: backtest policy cycles from /timeseries; summarize turning points with OHLC and high/low.
- Fintech apps: compare borrower costs across benchmarks with /convert to inform rate selection policies.
Build and ship with the docs at MCP, and create your key via Register. You can also explore more content on interestratesapi.com.
Operational tips for DNB_RATE in production
- Polling: monthly rates don’t need intraday polling; a daily check at month-end is typically enough to detect a new dates.DNB_RATE.
- Idempotence: cache by the tuple (endpoint, symbols, start, end, date) to avoid duplicate network traffic.
- Validation: ensure DNB_RATE appears in your symbols list and that currencies.DNB_RATE is DKK before accepting the value.
- Failures: on transient HTTP errors or 429, implement exponential backoff observing Retry-After.
- Logging: persist success flag and timestamps alongside the numeric rate to audit policy changes over time.
FAQ
Q: How often does DNB_RATE update?
A: Monthly. You should expect one effective value per month, with the effective date set to the last day with data in that month.
Q: What does the rate number represent?
A: It is an annualized percentage (e.g., 2.1 means 2.10% p.a.) in DKK. Convert to decimal (divide by 100) and, if needed, to a monthly rate (divide by 12) for month-level computations.
Q: How should I interpret the date for monthly series?
A: Use dates.DNB_RATE from /latest (or the response date in /historical). For monthly symbols, that date corresponds to the last day with data in that month.
Q: Can I compute spreads between DNB_RATE and another benchmark?
A: Yes. Pull both latest values and subtract to get a spread. For a simple cost comparison over a term, use /convert with from=DNB_RATE and your comparison symbol.
Q: What happens if I request a historical date without data?
A: For monthly symbols, the API maps that date to the month’s final data day. If no data exists for the requested period, you’ll receive a 404 (and possibly a details field with available ranges).
Ship your DNB_RATE integration now. Create your API key with Register and keep the MCP open while you code. If you prefer, you can also Get started with Interest Rates API today.