You need reliable Denmark government yield data that you can pull directly into your models, dashboards, or trading tools. By the end of this article, you will be able to fetch real-time and historical Danish sovereign yields, construct the Denmark yield curve, compute spreads, analyze intraday moves, and manage change statistics programmatically using the Bonds API endpoints.
What you can build with Denmark yield data
Danish government bonds (ISO2: DK) are a core reference for Nordic fixed-income desks, macro researchers, and cross-market relative value strategies. Yields quantify the cost of Denmark’s sovereign funding across the maturity spectrum—from bills to long bonds—and provide the foundation for curve analysis, inflation-linked pricing references, and risk management.
With the endpoints below you can:
- Display the latest yields for specific maturities or the full Denmark curve.
- Pull historical levels and time series for backtesting and factor modeling.
- Compare Denmark yields to benchmarks (for example, US Treasuries) in basis points.
- Ingest intraday snapshots for dashboards and market-monitoring alerts.
- Compute changes, min, and max over custom windows for risk reporting.
All examples target Denmark (DK) and use only GET requests against the Bonds API base URL. Learn more at bonds-api.com and explore the interactive MCP tooling at MCP.
Authentication, units, and timestamps
All Bonds API calls are made to https://bonds-api.com/api/v1/ using GET. Authenticate by sending your API key in the X-API-Key request header. Yields are returned as percentages (for example, 4.52 represents 4.52 percent per annum). Dates use Y-m-d (for example, 2026-10-29). Intraday snapshots include a fetched_at timestamp in ISO 8601 (UTC). Spreads are expressed in basis points (bps), where 1 bp = 0.01%.
For fast starts and CLI testing, you can simply pass the header X-API-Key: YOUR_API_KEY. For production, keep keys in secrets managers and apply caching to avoid refetching unchanged daily data.
Official live sample (verbatim)
The following two blocks are provided as-is from a live sample. They show a latest request using a US 10Y example and a different response schema than the Denmark-focused endpoints below.
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
{
"success": true,
"date": "2026-10-29",
"rates": {
"US_10Y": 5.015
},
"dates": {
"US_10Y": "2026-10-29"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "4d30bdf2-fe27-4836-a9cb-56d0d174f60d",
"timestamp": "2026-10-29T00:04:45+00:00"
}
}
Endpoint: Latest Denmark yields
Use /latest to retrieve the most recent available yields for Denmark. You may request specific maturities or omit maturities to return all available tenors.
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "DK", "maturities": "2Y,10Y"}
)
data = resp.json()
# Access Denmark 2Y and 10Y yields and dates
dk = data["data"]["DK"]
y2 = dk["2Y"]["yield"] # percentage
y10 = dk["10Y"]["yield"] # percentage
d2 = dk["2Y"]["date"] # "YYYY-MM-DD"
d10 = dk["10Y"]["date"]
JavaScript (fetch)
const url = "https://bonds-api.com/api/v1/latest?countries=DK&maturities=2Y,10Y";
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(json => {
const dk = json.data.DK;
const y2 = dk["2Y"].yield; // percent
const y10 = dk["10Y"].yield; // percent
console.log("DK 2Y:", y2, "DK 10Y:", y10, "as of", dk["10Y"].date);
});
PHP (file_get_contents)
<?php
$opts = [
"http" => [
"header" => "X-API-Key: YOUR_API_KEY\r\n"
]
];
$context = stream_context_create($opts);
$url = "https://bonds-api.com/api/v1/latest?countries=DK&maturities=2Y,10Y";
$json = file_get_contents($url, false, $context);
$data = json_decode($json, true);
$y2 = $data["data"]["DK"]["2Y"]["yield"];
$y10 = $data["data"]["DK"]["10Y"]["yield"];
echo "DK 2Y: $y2%, DK 10Y: $y10%";
?>
JSON response
How to read: yield is a percentage per annum. date is the valuation date (Y-m-d). source indicates the upstream origin (for example, official). On market holidays, the latest date may be the previous business day. Cache by date to prevent unnecessary re-requests when the date has not changed.
Endpoint: Historical Denmark yield on a specific date
Use /historical to query a single maturity for Denmark on a specific calendar date. If the requested date is a non-business day, the API returns 404 if no official fix exists for that date; request the nearest business day instead.
cURL
Python (requests)
import requests
params = {"country": "DK", "maturity": "10Y", "date": "2025-06-15"}
resp = requests.get(
"https://bonds-api.com/api/v1/historical",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params
)
row = resp.json()
y = row["yield"] # percent
d = row["date"] # "YYYY-MM-DD"
JavaScript (fetch)
const params = new URLSearchParams({ country: "DK", maturity: "10Y", date: "2025-06-15" });
fetch("https://bonds-api.com/api/v1/historical?" + params.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(json => {
console.log("DK 10Y on", json.date, "=", json.yield, "%");
});
PHP (file_get_contents)
<?php
$q = http_build_query(["country" => "DK", "maturity" => "10Y", "date" => "2025-06-15"]);
$opts = ["http" => ["header" => "X-API-Key: YOUR_API_KEY\r\n"]];
$ctx = stream_context_create($opts);
$json = file_get_contents("https://bonds-api.com/api/v1/historical?$q", false, $ctx);
$data = json_decode($json, true);
echo "Yield: " . $data["yield"] . "% on " . $data["date"];
?>
JSON response
The yield field is a percentage; date is Y-m-d. Use this endpoint for point-in-time chart annotations, event studies, or to verify a specific fixing in backtests.
Endpoint: Denmark yield time series
Use /timeseries for daily closing yields between two dates (inclusive). The series array is returned in chronological order; non-business days are skipped.
cURL
Python (requests)
import requests, pandas as pd
params = {"country": "DK", "maturity": "10Y", "start": "2025-10-29", "end": "2026-10-29"}
resp = requests.get("https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
js = resp.json()
df = pd.DataFrame(js["series"]) # columns: date (Y-m-d), yield (%)
df["date"] = pd.to_datetime(df["date"])
JavaScript (fetch)
const qs = new URLSearchParams({
country: "DK", maturity: "10Y", start: "2025-10-29", end: "2026-10-29"
});
fetch("https://bonds-api.com/api/v1/timeseries?" + qs.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(json => {
json.series.forEach(pt => {
// pt.date is "YYYY-MM-DD", pt.yield is percent
console.log(pt.date, pt.yield);
});
});
PHP (file_get_contents)
<?php
$params = http_build_query([
"country" => "DK", "maturity" => "10Y", "start" => "2025-10-29", "end" => "2026-10-29"
]);
$opts = ["http" => ["header" => "X-API-Key: YOUR_API_KEY\r\n"]];
$ctx = stream_context_create($opts);
$json = file_get_contents("https://bonds-api.com/api/v1/timeseries?$params", false, $ctx);
$data = json_decode($json, true);
foreach ($data["series"] as $pt) {
echo $pt["date"] . ": " . $pt["yield"] . "%\n";
}
?>
JSON response
Each series item provides a date (Y-m-d) and yield (percent). Use this to compute rolling volatility, durations at different yield levels, and regression factors. Cache by start-end key; typical update cadence is one row per business day.
Endpoint: Denmark vs. benchmark spread
Use /spread to compare Denmark yields with a benchmark country (for example, US Treasuries). The result includes spread_bps, a basis-point value equal to (country_yield − benchmark_yield) × 100.
cURL
Python (requests)
import requests
p = {"country": "DK", "benchmark": "US", "maturity": "10Y"}
r = requests.get("https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"}, params=p)
s = r.json()
bps = s["spread_bps"] # integer/float bps
cy = s["country_yield"] # percent
by = s["benchmark_yield"] # percent
JavaScript (fetch)
const p = new URLSearchParams({ country: "DK", benchmark: "US", maturity: "10Y" });
fetch("https://bonds-api.com/api/v1/spread?" + p.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(js => {
console.log("Spread (bps):", js.spread_bps, "DK:", js.country_yield, "US:", js.benchmark_yield);
});
PHP (file_get_contents)
<?php
$p = http_build_query(["country" => "DK", "benchmark" => "US", "maturity" => "10Y"]);
$opts = ["http" => ["header" => "X-API-Key: YOUR_API_KEY\r\n"]];
$ctx = stream_context_create($opts);
$js = file_get_contents("https://bonds-api.com/api/v1/spread?$p", false, $ctx);
$d = json_decode($js, true);
echo "Spread: " . $d["spread_bps"] . " bps (DK " . $d["country_yield"] . "% vs US " . $d["benchmark_yield"] . "%)";
?>
JSON response
spread_bps is in basis points. Use this for dashboards and alerts when spreads cross risk thresholds. Positive values mean Denmark trades above the benchmark; negative, below.
Endpoint: Full Denmark yield curve
/curve returns Denmark’s full on-the-run curve as of a given date (or the latest available). This is the most direct route to power curve visualizations, bootstrapping workflows, and spread curve analytics.
cURL
Python (requests)
import requests
r = requests.get("https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "DK"})
curve = r.json()
tenors = curve["curve"] # dict: tenor -> yield(%)
JavaScript (fetch)
fetch("https://bonds-api.com/api/v1/curve?country=DK", {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(js => {
Object.entries(js.curve).forEach(([tenor, y]) => {
console.log(tenor, y);
});
});
PHP (file_get_contents)
<?php
$opts = ["http" => ["header" => "X-API-Key: YOUR_API_KEY\r\n"]];
$ctx = stream_context_create($opts);
$js = file_get_contents("https://bonds-api.com/api/v1/curve?country=DK", false, $ctx);
$d = json_decode($js, true);
foreach ($d["curve"] as $tenor => $y) {
echo "$tenor: $y%\n";
}
?>
JSON response
inverted indicates if short-term yields exceed long-term yields in aggregate. curve is a tenor map to yields in percent. Use date to drive cache keys; an unchanged date implies no refresh needed for that country/day.
Denmark curve snapshot
| Tenor | Yield (%) |
|---|---|
| 1M | 5.31 |
| 3M | 5.27 |
| 6M | 5.18 |
| 1Y | 4.98 |
| 2Y | 4.25 |
| 5Y | 4.39 |
| 10Y | 4.52 |
| 30Y | 4.71 |
With these tenors, you can fit parametric (Svensson/Nelson-Siegel) or spline curves, price discount factors, or compute implied forward rates for Denmark.
Endpoint: Intraday Denmark yield snapshots
/intraday provides multiple snapshots during the requested date for a specific maturity. Timestamps are in UTC. Use this for session P&L tracking and microstructure analysis.
cURL
Python (requests)
import requests, pandas as pd
params = {"country": "DK", "maturity": "10Y", "date": "2026-10-29"}
r = requests.get("https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
js = r.json()
snaps = pd.DataFrame(js["snapshots"]) # fields: yield (percent), fetched_at (UTC ISO8601)
JavaScript (fetch)
const p = new URLSearchParams({ country: "DK", maturity: "10Y", date: "2026-10-29" });
fetch("https://bonds-api.com/api/v1/intraday?" + p.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(js => {
js.snapshots.forEach(s => {
console.log(s.fetched_at, s.yield);
});
});
PHP (file_get_contents)
<?php
$p = http_build_query(["country" => "DK", "maturity" => "10Y", "date" => "2026-10-29"]);
$opts = ["http" => ["header" => "X-API-Key: YOUR_API_KEY\r\n"]];
$ctx = stream_context_create($opts);
$js = file_get_contents("https://bonds-api.com/api/v1/intraday?$p", false, $ctx);
$d = json_decode($js, true);
foreach ($d["snapshots"] as $s) {
echo $s["fetched_at"] . " " . $s["yield"] . "%\n";
}
?>
JSON response
fetched_at is an ISO 8601 timestamp in UTC; yields are percentages. count gives the number of intraday points returned. Combine with /latest for a closing reference.
Endpoint: Denmark yield fluctuation over a period
/fluctuation summarizes the start and end yields, absolute change (percent points), and the min/max over the window. This is convenient for overview cards and quick diagnostics.
cURL
Python (requests)
import requests
p = {"countries": "DK", "maturity": "10Y", "start": "2025-10-29", "end": "2026-10-29"}
r = requests.get("https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"}, params=p)
fx = r.json()["data"]["DK"]
# fx has start_yield, end_yield, change (pct pts), min, max
JavaScript (fetch)
const p = new URLSearchParams({
countries: "DK", maturity: "10Y", start: "2025-10-29", end: "2026-10-29"
});
fetch("https://bonds-api.com/api/v1/fluctuation?" + p.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(js => {
const dk = js.data.DK;
console.log("Change:", dk.change, "pp; min:", dk.min, "max:", dk.max);
});
PHP (file_get_contents)
<?php
$p = http_build_query([
"countries" => "DK", "maturity" => "10Y", "start" => "2025-10-29", "end" => "2026-10-29"
]);
$opts = ["http" => ["header" => "X-API-Key: YOUR_API_KEY\r\n"]];
$ctx = stream_context_create($opts);
$js = file_get_contents("https://bonds-api.com/api/v1/fluctuation?$p", false, $ctx);
$d = json_decode($js, true);
$dk = $d["data"]["DK"];
echo "Start: {$dk["start_yield"]}% End: {$dk["end_yield"]}% Change: {$dk["change"]} pp";
?>
JSON response
change is in percentage points (for example, 0.31 means +31 bps). Use this endpoint to populate “period change” KPIs without manually iterating a time series.
Denmark curve construction and spreads in practice
To render a Denmark curve widget, call /curve once per valuation date. If you prefer to combine distinct maturities across endpoints (for example, custom set), you can also use /latest with a selected set of tenors. Ensure each tenor’s date matches your target valuation day; if not, align by backfilling to the nearest common date or displaying a mixed-date warning.
- Tenor alignment: Always show the date associated with each tenor; for clean curve snapshots, align tenors on the same date.
- Holiday handling: On Danish or global holidays, yields may not update; use the last business day and mark the date in your UI.
- Caching: Cache by country and date. Curves rarely change intra-day if they represent end-of-day fixes. For intraday views, combine /intraday for the live line and /latest for the last official close.
- Spreads: For cross-market views—e.g., DK vs US 10Y—use /spread for standardized bps output to avoid manual conversions.
Explore endpoint details and field behaviors at bonds-api.com. When you are ready to integrate, use the interactive explorer at the MCP.
Error handling and operational guidance
Bonds API returns standardized error objects with success=false and an error message. Typical HTTP statuses include:
- 401: Missing or invalid X-API-Key
- 403: Account quota exceeded
- 404: No data for requested country/maturity/date
- 422: Invalid parameter (for example, date format)
- 429: Rate limit exceeded
- 500: Server error
Recommended practices:
- Retry with exponential backoff for 429 and 500; do not retry 4xx other than 429.
- Validate ISO2 codes (DK) and maturity strings (for example, 1M, 3M, 6M, 1Y, 2Y, 5Y, 10Y, 30Y) before sending.
- Time zones: Treat all dates as UTC-based trading days unless your interface requires local conversion. Intraday timestamps are UTC ISO 8601.
- Data freshness: The /latest and /curve endpoints represent the most recent available date with data; if unchanged, serve from cache.
Use cases for Denmark yield data
- Financial dashboards: Show Denmark 2Y–10Y–30Y tiles and the full curve from /curve.
- Portfolio risk tools: Drive duration/convexity calculations and stress tests using /timeseries and /fluctuation.
- Economic research: Study regime shifts with long-run /timeseries and event-day pulls from /historical.
- Relative value analytics: Track DK vs US 10Y spread via /spread (spread_bps) with alerting.
- Intraday monitoring: Overlay /intraday snapshots to visualize session dynamics around central bank communications.
Business days, holidays, and updates
Danish sovereign yields generally post on business days. On Danish or global holidays, the latest date may remain the previous business day. Time series omit non-business days. For daily workflows, poll once per day after your chosen cutover time. For live dashboards, combine low-frequency polling of /latest with episodic /intraday fetches during trading sessions.
End-to-end example: building a Denmark yield curve component
Step 1: Fetch the curve
Call /curve once on page load (and then on a daily schedule) to populate tenor levels. Use the date for display and as a cache key.
Step 2: Compute derived analytics
- 2s10s: dk["10Y"] − dk["2Y"] in percentage points.
- Butterfly: 2×5Y − 2Y − 10Y.
- Forward rates: Fit a spline over the points and compute forward segments.
Step 3: Add relative value
Call /spread for DK vs US 10Y and plot the basis in bps. Changes are additive: 10 bps widening means +0.10% in yield difference.
Step 4: Capture intraday context
Call /intraday?country=DK&maturity=10Y&date=YYYY-MM-DD and overlay the snapshots as a live line. Stamp points with fetched_at (UTC) for tooltips.
FAQ
How are yields expressed?
All yield fields are percentages (for example, 4.52 means 4.52% per annum). Spread values (spread_bps) are in basis points; 100 bps equals 1 percentage point.
What date and time formats are used?
Dates use Y-m-d (for example, 2026-10-29). Intraday timestamps use ISO 8601 with a “Z” suffix for UTC (for example, 2026-10-29T12:00:00Z).
How should I handle non-trading days?
If /historical returns 404 for a non-business day, request the nearest business day or use /latest or /curve to fetch the most recent available date with data. Time series omit non-business days by design.
Can I request multiple maturities at once?
Yes. Use /latest with the maturities parameter (for example, 2Y,5Y,10Y). For the full curve, use /curve for all available on-the-run tenors.
What caching strategy is recommended?
Cache by country and date for /latest and /curve. For /timeseries and /fluctuation, cache by the full query (country, maturity, start, end). For /intraday, cache short-lived (minutes) and tag by date and maturity.
Build your Denmark yield-curve tooling with the endpoints above and start shipping production integrations today. Visit bonds-api.com, explore the MCP, and Register to get your API key and integrate Denmark yields into your applications.