You need clean, machine-readable Denmark 10-year government bond yields inside your models and dashboards. By the end of this guide, you will query, cache, and analyze Denmark’s 10Y yield, build a Denmark yield curve, calculate spreads, and fetch intraday snapshots using Bonds API over simple GET requests with JSON responses.
What the Denmark 10-year yield tells you
The 10-year government bond yield for Denmark (ISO2: DK) is a benchmark for Danish krone risk-free rates and a key input for discount curves, asset allocation, risk, and macro analysis. Yields are returned by the API as percentages (e.g., 4.52 means 4.52%) unless otherwise noted (spreads are in basis points). Dates are provided in ISO 8601 (Y-m-d), and intraday timestamps are in UTC.
With bonds-api.com, you can pull the latest yield, a specific historical date, full time series, spreads versus benchmarks like US Treasuries or German Bunds, and the full Denmark yield curve from bills through long bonds.
Conventions, business days, and update cadence
- Units: Yields are percentages (e.g., 4.25 → 4.25%). Spreads are basis points (bps), where 100 bps = 1.00%.
- Dates and times: Dates are in Y-m-d. Intraday timestamps are in UTC (e.g., 2026-10-14T12:00:00Z).
- Business days and holidays: Daily endpoints return data for trading days. On Danish market holidays and weekends, the latest date will be the most recent business day.
- Update frequency: Latest and curve endpoints reflect the most recent market-close (official) or market-derived (intraday) updates. Intraday snapshots are time-stamped.
- Caching: Cache GET responses during a trading day for stability and to stay within your rate budget. Invalidate or refresh when you cross a market-close boundary or when you need the freshest intraday snapshot.
- Error handling: Expect standard error JSON with success=false and an error message. Handle HTTP 401, 403, 404, 422, 429, and 500 gracefully with retries where appropriate (e.g., exponential backoff on 429/500).
All endpoints below are GET requests to https://bonds-api.com/api/v1/ authenticated with an X-API-Key header. See also the interactive MCP for quick inspection.
Latest Denmark yields: /latest
Use /latest to fetch current yields for Denmark. You can pass multiple maturities to assemble a small curve or just request the 10Y.
cURL
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
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()
# data["data"]["DK"]["10Y"]["yield"] is the 10Y yield in percent
# data["data"]["DK"]["10Y"]["date"] is Y-m-d
print(data)
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/latest");
url.searchParams.set("countries", "DK");
url.searchParams.set("maturities", "2Y,10Y");
fetch(url.toString(), {
method: "GET",
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(data => {
const tenY = data.data.DK["10Y"].yield; // percent
const asOf = data.data.DK["10Y"].date; // Y-m-d
console.log(tenY, asOf);
});
PHP (file_get_contents)
<?php
$context = stream_context_create([
'http' => [
'method' => 'GET',
'header' => "X-API-Key: YOUR_API_KEY\r\n"
]
]);
$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);
// $data["data"]["DK"]["10Y"]["yield"] is percent
echo $json;
?>
Response
{
"success": true,
"date": "2026-10-14",
"rates": {
"US_10Y": 5.213
},
"dates": {
"US_10Y": "2026-10-14"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "da816f21-651a-4b52-8fa3-bcf32b4f543b",
"timestamp": "2026-10-14T00:04:44+00:00"
}
}
Field notes: yield is in percent. date is Y-m-d as-of. source indicates provenance (e.g., official). Use the 10Y value to drive charts or compute spreads versus other countries.
Official sample (verbatim)
The following official sample block is provided for reference and must be copied verbatim:
Field notes: rates are in percent, timestamp is ISO 8601 with UTC offset. When you integrate Denmark data, use the /latest DK format shown above with the X-API-Key header.
Yield on a specific date: /historical
Pull the Denmark 10Y yield for a fixed historical date for point-in-time backtests and event studies.
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/historical",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "DK", "maturity": "10Y", "date": "2025-06-15"}
)
hist = resp.json()
# hist["yield"] is the 10Y yield in percent on 2025-06-15
print(hist)
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/historical");
url.searchParams.set("country", "DK");
url.searchParams.set("maturity", "10Y");
url.searchParams.set("date", "2025-06-15");
fetch(url.toString(), { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(hist => {
console.log(hist.yield); // percent
});
PHP (file_get_contents)
<?php
$context = stream_context_create([
'http' => [
'method' => 'GET',
'header' => "X-API-Key: YOUR_API_KEY\r\n"
]
]);
$url = "https://bonds-api.com/api/v1/historical?country=DK&maturity=10Y&date=2025-06-15";
$json = file_get_contents($url, false, $context);
echo $json;
?>
Response
Field notes: yield is a percent. date is the target Y-m-d. If the given date is a non-trading day, expect a 404 if no observation exists for that exact date; shift to the nearest prior business day in your application logic if needed.
Time series between two dates: /timeseries
Use /timeseries for backfills, factor models, and rolling analytics. The endpoint returns an array of daily observations between start and end dates (inclusive when available).
cURL
Python (requests)
import requests
params = {"country": "DK", "maturity": "10Y", "start": "2025-10-14", "end": "2026-10-14"}
resp = requests.get("https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
series = resp.json()
# series["series"] is a list of {"date": "Y-m-d", "yield": percent}
print(series)
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/timeseries");
Object.entries({
country: "DK",
maturity: "10Y",
start: "2025-10-14",
end: "2026-10-14"
}).forEach(([k, v]) => url.searchParams.set(k, v));
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(ts => {
for (const row of ts.series) {
// row.yield is percent, row.date is Y-m-d
console.log(row.date, row.yield);
}
});
PHP (file_get_contents)
<?php
$ctx = stream_context_create([
'http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]
]);
$url = "https://bonds-api.com/api/v1/timeseries?country=DK&maturity=10Y&start=2025-10-14&end=2026-10-14";
echo file_get_contents($url, false, $ctx);
?>
Response
Field notes: series is ordered by date. Missing business days (weekends, holidays) simply won’t appear. Use this to compute rolling changes, volatility, and moving averages.
Spread versus a benchmark: /spread
Compute the Denmark 10Y spread to a benchmark like US Treasuries or German Bunds. Spreads are returned in basis points.
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "DK", "benchmark": "US", "maturity": "10Y"}
)
sp = resp.json()
# sp["spread_bps"] is basis points
# sp["country_yield"], sp["benchmark_yield"] are in percent
print(sp)
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/spread");
url.searchParams.set("country", "DK");
url.searchParams.set("benchmark", "US");
url.searchParams.set("maturity", "10Y");
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(sp => {
console.log(sp.spread_bps); // integer/float in basis points
});
PHP (file_get_contents)
<?php
$ctx = stream_context_create([
'http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]
]);
$url = "https://bonds-api.com/api/v1/spread?country=DK&benchmark=US&maturity=10Y";
echo file_get_contents($url, false, $ctx);
?>
Response
Field notes: spread_bps is (Denmark 10Y − benchmark 10Y) × 100 in basis points. country_yield and benchmark_yield are percentages.
Full Denmark yield curve: /curve
Fetch the full yield curve for Denmark, suitable for bootstrapping, duration/convexity estimates, and curve visualizations.
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "DK"}
)
curve = resp.json()
# curve["curve"] is a dict of maturity -> yield (percent)
print(curve)
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/curve");
url.searchParams.set("country", "DK");
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(curve => {
const points = curve.curve; // e.g., {"1M": 5.31, "3M": 5.27, ...}
console.log(points);
});
PHP (file_get_contents)
<?php
$ctx = stream_context_create([
'http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]
]);
$url = "https://bonds-api.com/api/v1/curve?country=DK";
echo file_get_contents($url, false, $ctx);
?>
Response
Field notes: curve is a maturity-to-yield map in percent. inverted is a boolean telling you if short rates exceed long rates across the curve definition. date is the as-of day for the full curve. You can feed these points into a cubic spline or Nelson-Siegel model.
Denmark curve points in one view
| Maturity | Yield (percent) |
|---|---|
| 1M | 5.31 |
| 3M | 5.27 |
| 6M | 5.18 |
| 1Y | 4.98 |
| 2Y | 4.25 |
| 5Y | 4.39 |
| 10Y | 4.52 |
| 30Y | 4.71 |
Intraday snapshots: /intraday
When you need within-day movement for Denmark 10Y, use /intraday for timestamped snapshots in UTC. Useful for trading dashboards and alerting.
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "DK", "maturity": "10Y", "date": "2026-10-14"}
)
intra = resp.json()
# intra["snapshots"] is a list of {yield: percent, fetched_at: ISO-UTC}
print(intra)
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/intraday");
Object.entries({country:"DK", maturity:"10Y", date:"2026-10-14"})
.forEach(([k,v]) => url.searchParams.set(k, v));
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(intra => {
for (const s of intra.snapshots) {
console.log(s.fetched_at, s.yield); // UTC, percent
}
});
PHP (file_get_contents)
<?php
$ctx = stream_context_create([
'http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]
]);
$url = "https://bonds-api.com/api/v1/intraday?country=DK&maturity=10Y&date=2026-10-14";
echo file_get_contents($url, false, $ctx);
?>
Response
Field notes: fetched_at is an ISO 8601 UTC timestamp. count equals the number of snapshots. source indicates the intraday source classification.
Fluctuation over a period: /fluctuation
Get the start, end, change, and range for Denmark 10Y across a period. Perfect for risk reports, monthly reviews, or signaling systems.
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "DK", "maturity": "10Y", "start": "2025-10-14", "end": "2026-10-14"}
)
fl = resp.json()
# fl["data"]["DK"]["change"] is end - start (percent)
print(fl)
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/fluctuation");
Object.entries({
countries: "DK",
maturity: "10Y",
start: "2025-10-14",
end: "2026-10-14"
}).forEach(([k,v]) => url.searchParams.set(k, v));
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(fl => {
const dk = fl.data.DK;
console.log(dk.start_yield, dk.end_yield, dk.change, dk.min, dk.max);
});
PHP (file_get_contents)
<?php
$ctx = stream_context_create([
'http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]
]);
$url = "https://bonds-api.com/api/v1/fluctuation?countries=DK&maturity=10Y&start=2025-10-14&end=2026-10-14";
echo file_get_contents($url, false, $ctx);
?>
Response
Field notes: start_yield and end_yield are percents. change is end − start (percent). min and max are the observed extremes across the period.
Error responses and defensive integration
All error responses include success=false and an error message. Handle common cases:
- 401: Missing or invalid X-API-Key. Verify the header and key value.
- 403: Quota exceeded. Back off and reduce frequency; evaluate caching.
- 404: No data for the requested country/maturity/date. Try a neighboring business day or another maturity.
- 422: Invalid parameter (date format, ISO2 code). Ensure Y-m-d dates and valid ISO2 country codes.
- 429: Rate limit exceeded. Use exponential backoff and cache immutable historical responses.
- 500: Server error. Retry with jitter.
For operational resilience, deploy short-lived caches for /latest and /curve, long-lived caches for /historical and /timeseries, and idempotent retry logic for 429/500.
Building analytics: yield curves, spreads, and dashboards
With the endpoints above, you can implement:
- Yield curve visualization: Fetch /curve once per market-close and draw lines across the 1M–30Y tenors. Check inverted to annotate the chart.
- Denmark 10Y monitoring: Poll /latest for DK 10Y during the day, supplemented by /intraday snapshots for microstructure-aware alerts.
- Macro research: Use /timeseries to compute rolling changes, beta to global risk factors, and to test monetary transmission hypotheses.
- Relative value screens: Pull /spread versus US or DE to track cross-market dislocations in basis points.
- Risk reporting: Use /fluctuation to populate start, end, change, and range metrics in end-of-month reports.
Explore the broader sovereign coverage and capabilities at bonds-api.com, and browse live endpoints in the MCP.
Authentication and production hardening
- Authentication: Include X-API-Key: YOUR_API_KEY in every request header. Avoid embedding keys in client-side code; proxy through a server when building web apps.
- Timeouts: Set client timeouts (e.g., 5–10 seconds) with 2–3 retries and exponential backoff for transient failures.
- Pagination: Not applicable to these endpoints; responses are one-shot for the given filters.
- Data validation: Confirm yield units (percent) and that dates align with your portfolio valuation date. Normalize timezones to UTC.
- Versioning: Stick to /api/v1/ and pin your integration tests to the examples above to catch breaking changes early.
When you are ready to deploy, Register for an API key and start automating your Denmark yield analytics.
FAQ
How are yields and spreads expressed?
Yields are percentages (e.g., 4.52 is 4.52%). Spreads from /spread are in basis points (bps), where 100 bps equals 1.00%.
What time zone are timestamps in?
Dates are Y-m-d. Intraday timestamps (fetched_at) are ISO 8601 in UTC. Align your scheduler and charts to UTC for consistency.
How do I handle non-trading days for Denmark?
Daily endpoints return data for business days. If you request a date that has no observation (holiday/weekend), you may receive 404. In reporting, typically roll to the most recent prior business day.
Can I build a Denmark yield curve and check for inversion?
Yes. Use /curve with country=DK. The response includes inverted (boolean) and a maturity-to-yield map across standard tenors.
What’s the best way to minimize latency and quota usage?
Cache /latest and /curve responses during the trading day, cache /historical and /timeseries indefinitely, and only refresh intraday snapshots on a schedule you need for alerts.
Ready to integrate Denmark 10-year yields into your stack? Get started with Bonds API and explore endpoints live in the Bonds API MCP. For more on coverage and docs, visit bonds-api.com.