Building a historical Denmark yield curve requires consistent maturity, observation-date, and unit handling—not just a successful API call. This guide shows how to structure requests, calculate spreads, and handle missing market days, while separating documented Denmark examples from the supplied live catalog sample.
Denmark coverage and the data model
A Danish sovereign bond is a government debt instrument whose yield summarizes the return implied by its price and cash flows. Analysts compare yields across maturities to examine the curve, track changes through time, and assess the interest-rate exposure of portfolios.
The Bonds API reference describes Denmark using the country code DK and supplies example responses for it. However, the supplied live catalog sample says Denmark is not in the published catalog and demonstrates a US maturity instead. Treat the Denmark requests and responses below as reference examples, not evidence that Denmark data is currently available; check coverage before building a production dependency.
The API uses GET requests at https://bonds-api.com/api/v1/. The reference specifies authentication with an X-API-Key header. The live sample later in this article instead places a key in the query string, so the two supplied examples have different authentication and response formats. Confirm the current integration contract before choosing an implementation, and avoid exposing keys in logs or client-side applications.
Yield values in the reference responses are percentages: 4.52 means 4.52%, not a decimal rate of 4.52. One percentage point equals 100 basis points, so a difference of 0.31 percentage points is 31 basis points. The MCP link provides another way to explore Bonds API capabilities.
Historical observations and time series
Request one maturity on a date
The historical endpoint takes singular country and maturity parameters plus a date in Y-m-d format. This reference request asks for the Denmark 10-year observation on the specified date:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/historical?country=DK&maturity=10Y&date=2025-06-15"
The reference response is:
{
"success": true,
"country": "DK",
"maturity": "10Y",
"date": "2025-06-15",
"yield": 4.38,
"source": "official"
}
success indicates the reported result status. country, maturity, and date identify the observation; yield is the percentage yield, and source identifies the reported source. The date is an observation date, not a timestamp or a guarantee that an intraday quote was collected at a particular time.
A requested date can fall on a weekend or market holiday. The reference does not specify a universal prior-business-day fallback, so handle a no-data response explicitly rather than silently substituting an earlier observation. If an analysis needs a carry-forward rule, implement and label that rule in the application.
Retrieve a range
Use the time-series endpoint for one country and maturity over a date range. Both start and end are required, and the end date must not precede the start date.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/timeseries?country=DK&maturity=10Y&start=2025-11-27&end=2026-11-27"
The reference provides the following response shape. Its illustrated series dates do not match the range in the accompanying request, so use it to understand the fields rather than as an expected result for that particular request.
{
"success": true,
"country": "DK",
"maturity": "10Y",
"series": [
{ "date": "2025-01-02", "yield": 4.21 },
{ "date": "2025-01-03", "yield": 4.19 },
{ "date": "2025-01-06", "yield": 4.23 }
]
}
Each series entry contains an observation date and yield in percent. Sort and align observations by date before calculating changes or joining maturities. Missing calendar dates should remain distinguishable from actual zero yields; the reference does not promise an observation for every business day or describe pagination.
Latest yields and constructing a curve
Fetch selected maturities
The latest endpoint accepts comma-separated countries and, optionally, comma-separated maturities. Omitting maturities requests all available maturities. The Denmark reference example requests two points:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/latest?countries=DK&maturities=2Y,10Y"
{
"success": true,
"data": {
"DK": {
"2Y": { "yield": 4.25, "date": "2026-11-27", "source": "official" },
"10Y": { "yield": 4.52, "date": "2026-11-27", "source": "official" }
}
}
}
Here data groups observations by country and maturity. Each point has its own yield, date, and source. The two example points share a date, but an application should verify dates before treating several latest observations as a single curve.
For a dashboard, request the maturities needed in one call, then order the returned points by tenor rather than relying on object-key order. A missing maturity is not a zero yield. Retain its absence in the display and avoid interpolating without an explicit analytical policy.
Request the country curve
The curve endpoint requires country; its optional date selects a historical day. With no date, the reference says the endpoint defaults to the latest available day with data.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/curve?country=DK"
{
"success": true,
"country": "DK",
"date": "2026-11-27",
"inverted": false,
"curve": {
"1M": 5.31, "3M": 5.27, "6M": 5.18,
"1Y": 4.98, "2Y": 4.25, "5Y": 4.39,
"10Y": 4.52, "30Y": 4.71
}
}
curve maps maturity labels to percentage yields; date is the curve’s observation date. inverted is a returned flag, but the reference does not define the maturity comparison used to calculate it. For a research or risk model, calculate and name the specific slope you need instead of assuming the flag represents every possible tenor pair.
For example, the illustrated 10-year minus 2-year slope is (4.52 - 4.25) × 100, or 27 basis points. That calculation describes only those two example points. A different pair can have a different sign, and curve shape alone does not establish a bond’s price sensitivity or total return.
Spreads, intraday snapshots, and period changes
Compare Denmark with a benchmark
The spread endpoint requires country and benchmark; maturity is optional and defaults to 10Y. This reference request explicitly selects the US benchmark and the 10-year maturity:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/spread?country=DK&benchmark=US&maturity=10Y"
{
"success": true,
"country": "DK",
"benchmark": "US",
"maturity": "10Y",
"spread_bps": 215,
"country_yield": 4.52,
"benchmark_yield": 2.37
}
country_yield and benchmark_yield are percentages; spread_bps is in basis points. In this example, subtracting the benchmark yield from the country yield and multiplying by 100 gives 215 basis points. Record the maturity and benchmark with the result: a spread is not meaningful without both comparison legs.
Cross-country yields can reflect different currencies and market conventions as well as credit and rate expectations. The reference spread response does not provide currency or observation-date fields, so do not infer those fields from the spread alone.
Inspect intraday observations
The intraday endpoint requires country, maturity, and date. It is useful when a risk tool needs to inspect snapshots rather than treating a daily observation as a continuous feed.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/intraday?country=DK&maturity=10Y&date=2026-11-27"
{
"success": true,
"country": "DK",
"maturity": "10Y",
"date": "2026-11-27",
"snapshots": [
{ "yield": 4.51, "fetched_at": "2026-11-27T09:30:00Z", "source": "market" },
{ "yield": 4.53, "fetched_at": "2026-11-27T12:00:00Z", "source": "market" },
{ "yield": 4.52, "fetched_at": "2026-11-27T15:30:00Z", "source": "market" }
],
"count": 3,
"meta": { "timezone": "UTC" }
}
fetched_at is an ISO-style timestamp; the trailing Z denotes UTC, consistent with meta.timezone. count reports the number of snapshots, and each snapshot has a percentage yield and source. A fetch timestamp identifies when the snapshot was fetched; it should not automatically be treated as an exchange execution time.
Summarize a period
The fluctuation endpoint accepts comma-separated countries, one maturity, and a start and end date. It returns summary values rather than the full series.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/fluctuation?countries=DK&maturity=10Y&start=2025-11-27&end=2026-11-27"
{
"success": true,
"maturity": "10Y",
"start": "2025-11-27",
"end": "2026-11-27",
"data": {
"DK": {
"start_yield": 4.21,
"end_yield": 4.52,
"change": 0.31,
"min": 3.87,
"max": 4.76
}
}
}
start_yield, end_yield, min, and max are percentage yields. The example’s change is 0.31 percentage points, equivalent to 31 basis points. Use the time series when the dates of intermediate highs, lows, or missing observations matter; this summary does not include those dates.
Live sample and application integration
The supplied live sample is for US, not Denmark. It is useful for testing the live response format, but it cannot establish Denmark coverage. Its query-string authentication conflicts with the header-only reference examples above; protect the key and verify which contract applies before deployment.
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
{
"success": true,
"date": "2026-11-25",
"rates": {
"US_10Y": 4.85
},
"dates": {
"US_10Y": "2026-11-25"
},
"currencies": {
"US_10Y": "USD"
},
"sources": {
"US_10Y": "us_treasury"
},
"updated_at": {
"US_10Y": "2026-11-25T21:30:04+00:00"
},
"changes": {
"US_10Y": {
"previous_close": 4.91,
"daily": {
"date": "2026-11-24",
"bps": -6,
"pct": -1.22
},
"weekly": {
"date": "2026-11-18",
"bps": -22,
"pct": -4.34
},
"monthly": {
"date": "2026-10-23",
"bps": -15,
"pct": -3
},
"annual": {
"date": "2025-11-25",
"bps": 84,
"pct": 20.95
}
}
},
"meta": {
"request_id": "992b88a5-e5e7-4f4c-95af-3cf217fe5b73",
"timestamp": "2026-11-27T00:06:47+00:00"
}
}
The live shape uses rates, dates, currencies, sources, and updated_at, keyed by US_10Y, rather than the reference example’s nested data structure. USD identifies the sample instrument’s currency; yield remains a percentage, not a currency amount. The observation date and update timestamp are distinct, and +00:00 indicates UTC.
changes contains the previous close and daily, weekly, monthly, and annual comparisons. Each comparison includes a reference date, a basis-point change in bps, and a percentage change in pct. meta.timestamp is response metadata and should not replace the instrument’s observation date or update time.
This Python sample calls the same live endpoint and reads the fields needed to display the yield and its freshness. Replace the placeholder locally; do not commit the key or log the prepared request URL.
import requests
response = requests.get(
"https://bonds-api.com/api/v1/latest",
params={
"countries": "US",
"maturities": "10Y",
"api_key": "YOUR_API_KEY",
},
timeout=30,
)
response.raise_for_status()
payload = response.json()
if not payload.get("success"):
raise RuntimeError(payload.get("error", "Request was not successful"))
symbol = "US_10Y"
print("Yield percent:", payload["rates"][symbol])
print("Observation date:", payload["dates"][symbol])
print("Currency:", payload["currencies"][symbol])
print("Updated at:", payload["updated_at"][symbol])
In production, validate the returned shape before persisting data. Keep the observation date, maturity, source, and update time alongside the yield so that an analyst can reproduce a curve or investigate a stale point.
Operational considerations and FAQ
The reference lists errors as success=false with an error message. It identifies 401 for missing or invalid credentials, 403 for quota exhaustion, 404 for an unavailable country/maturity/date combination, 422 for invalid parameters, 429 for rate limiting, and 500 for a server error. Handle missing data separately from authentication and parameter errors; retry transient failures with backoff rather than treating every failure as a missing yield.
No fixed update interval is specified in the supplied reference. Cache historical observations by country, maturity, and date, and use shorter, configurable freshness rules for latest or intraday results. Preserve source and timestamp metadata, allow historical corrections to refresh cached entries, and avoid assuming that a market holiday produces a new observation.
Can I retrieve historical Denmark yields now?
The reference includes Denmark request and response examples, but the supplied live catalog note says Denmark is not listed. Confirm availability with Bonds API before relying on those examples or interpreting their values as live observations.
How do I align maturities for a historical curve?
Request the curve for the desired date where supported, or retrieve the required maturity series and join them on observation date. Do not silently mix dates or fill missing values unless your analysis explicitly calls for that treatment.
Does a date identify an intraday time?
No. A Y-m-d date identifies a calendar observation date; intraday fetched_at values carry timestamps and, in the example, a UTC timezone. Keep these concepts separate when measuring freshness.
What should I do on weekends and holidays?
Expect that an observation may be absent and handle a 404 or an incomplete series. If a report uses the prior available observation, label that choice and retain the actual observation date.
To begin testing the documented integration, Register for a Bonds API key, then confirm Denmark coverage and the applicable authentication and response format before connecting your application.