You need Belgium sovereign bond yields that you can compute with, not just read about. By the end of this article, you’ll query Belgium (BE) government bond yields in real time and historically, build a yield curve, compute spreads, capture intraday snapshots, and quantify period fluctuations using the Bonds API over simple GET requests.
What you’ll build with Belgium bond yields
Bonds API provides structured sovereign yield data as JSON, ideal for:
- Yield curve construction and curve-shape analytics (e.g., inversion).
- Relative value and risk: spreads of Belgium vs benchmarks (e.g., German Bunds or US Treasuries).
- Portfolio monitoring: daily changes, intraday snapshots, drawdowns, and highs/lows over a period.
- Macro research: historical time series for event studies and econometric analysis.
- Developer integrations: dashboards, alerting, and risk engines that require clean, authenticated endpoints.
All examples below use Belgium (ISO2: BE) and the official bonds-api.com endpoints. Every request is a GET, and authentication is sent as an X-API-Key header.
Data model, units, timestamps, and holidays
Yields are returned as percentages (for example, 4.52 means 4.52%). Spreads are returned in basis points (bps), where 100 bps = 1.00 percentage point. Dates use ISO format Y-m-d, and timestamps (e.g., fetched_at) are in UTC ISO 8601.
Trading calendars matter. Belgium government bonds follow euro-area business days; there is no data for weekends and local market holidays. Daily “latest” values typically reflect the most recent business day close or most recent available market snapshot, as indicated by the source field (“official” or “market”). Consider caching daily data until the next update window and invalidating caches intraday for time-sensitive endpoints like /intraday.
When building curves or backtests, align all points to the same business date. If a requested date is a holiday, the API returns 404 for that specific date/maturity combination.
Authentication and request pattern
All Bonds API calls use GET and the X-API-Key header for authentication:
X-API-Key: YOUR_API_KEY
Base URL: https://bonds-api.com/api/v1/
You can explore endpoints in the MCP or directly on bonds-api.com. When you’re ready, get your API key: Register.
Endpoint: Latest (current yields)
Use this to retrieve the most recent available yields for Belgium across one or multiple maturities.
cURL
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
Python (requests)
import requests
response = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "BE", "maturities": "2Y,10Y"}
)
data = response.json()
print(data["data"]["BE"]["2Y"]["yield"], data["data"]["BE"]["10Y"]["yield"])
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/latest");
url.searchParams.set("countries", "BE");
url.searchParams.set("maturities", "2Y,10Y");
fetch(url.toString(), {
method: "GET",
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(json => {
const be = json.data.BE;
console.log("BE 2Y:", be["2Y"].yield, "BE 10Y:", be["10Y"].yield);
});
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=BE&maturities=2Y,10Y";
$json = file_get_contents($url, false, $context);
$data = json_decode($json, true);
echo $data["data"]["BE"]["2Y"]["yield"] . " " . $data["data"]["BE"]["10Y"]["yield"];
JSON response example
{
"success": true,
"date": "2026-10-02",
"rates": {
"US_10Y": 5.28
},
"dates": {
"US_10Y": "2026-10-02"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "c9739570-ee1f-4621-9d58-92e046e3da7c",
"timestamp": "2026-10-03T00:05:37+00:00"
}
}
How to read it: yields are percentages; the date is Y-m-d for the observation; source indicates whether data is “official” close or “market” snapshot.
Endpoint: Historical (yield on a specific date)
Query a single maturity for a single day, useful for event studies or backfills.
cURL
Python
import requests
params = {"country": "BE", "maturity": "10Y", "date": "2025-06-15"}
r = requests.get("https://bonds-api.com/api/v1/historical",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params)
print(r.json())
JavaScript
const p = new URL("https://bonds-api.com/api/v1/historical");
p.searchParams.set("country", "BE");
p.searchParams.set("maturity", "10Y");
p.searchParams.set("date", "2025-06-15");
fetch(p, { headers: { "X-API-Key": "YOUR_API_KEY" }})
.then(r => r.json())
.then(console.log);
PHP (Guzzle)
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client([
'base_uri' => 'https://bonds-api.com/api/v1/'
]);
$res = $client->get('historical', [
'headers' => ['X-API-Key' => 'YOUR_API_KEY'],
'query' => ['country' => 'BE', 'maturity' => '10Y', 'date' => '2025-06-15']
]);
echo $res->getBody();
JSON response example
How to read it: yield is a percentage; date is the business day requested; source is the data provenance tag.
Endpoint: Time series (between two dates)
Pull Belgium’s yields for a maturity across a date range to plot or compute statistics.
cURL
Python
import requests
params = {
"country": "BE",
"maturity": "10Y",
"start": "2025-10-03",
"end": "2026-10-03"
}
r = requests.get("https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params)
series = r.json()["series"]
# Example: compute average yield
avg = sum(pt["yield"] for pt in series) / len(series)
print("Avg 10Y:", round(avg, 3))
JavaScript
const u = new URL("https://bonds-api.com/api/v1/timeseries");
u.searchParams.set("country", "BE");
u.searchParams.set("maturity", "10Y");
u.searchParams.set("start", "2025-10-03");
u.searchParams.set("end", "2026-10-03");
const res = await fetch(u, { headers: { "X-API-Key": "YOUR_API_KEY" }});
const json = await res.json();
console.log(json.series);
PHP
<?php
$params = http_build_query([
'country' => 'BE',
'maturity' => '10Y',
'start' => '2025-10-03',
'end' => '2026-10-03'
]);
$opts = ['http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]];
$ctx = stream_context_create($opts);
echo file_get_contents("https://bonds-api.com/api/v1/timeseries?$params", false, $ctx);
JSON response example
How to read it: an array of date/yield pairs. Dates are business days; there are no weekend entries.
Endpoint: Spread (Belgium vs benchmark)
Compute the yield spread (in bps) between Belgium and a benchmark country at a selected maturity. Spreads are crucial for relative value and risk signaling.
cURL
Python
import requests
q = {"country": "BE", "benchmark": "US", "maturity": "10Y"}
r = requests.get("https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"}, params=q)
spread = r.json()
print(spread["spread_bps"], spread["country_yield"], spread["benchmark_yield"])
JavaScript
const sp = new URL("https://bonds-api.com/api/v1/spread");
sp.searchParams.set("country", "BE");
sp.searchParams.set("benchmark", "US");
sp.searchParams.set("maturity", "10Y");
fetch(sp, { headers: { "X-API-Key": "YOUR_API_KEY" }})
.then(r => r.json())
.then(data => {
// spread in basis points (bps)
console.log("Spread (bps):", data.spread_bps);
});
PHP
<?php
$q = http_build_query(['country' => 'BE', 'benchmark' => 'US', 'maturity' => '10Y']);
$ctx = stream_context_create(['http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
$json = file_get_contents("https://bonds-api.com/api/v1/spread?$q", false, $ctx);
echo $json;
JSON response example
How to read it: spread_bps is in basis points, positive when Belgium’s yield exceeds the benchmark. The component yields are percentages.
Endpoint: Curve (full Belgium yield curve)
Fetch a snapshot of Belgium’s entire curve for the latest available date (or a specified date). Use this for curve-shape analysis and interpolation.
cURL
Python
import requests
r = requests.get("https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "BE"})
curve = r.json()
print("Date:", curve["date"], "Inverted:", curve["inverted"])
print("10Y:", curve["curve"].get("10Y"))
JavaScript
const cu = new URL("https://bonds-api.com/api/v1/curve");
cu.searchParams.set("country", "BE");
const cRes = await fetch(cu, { headers: { "X-API-Key": "YOUR_API_KEY" }});
const cJson = await cRes.json();
console.log(cJson.curve, "Inverted:", cJson.inverted);
PHP
<?php
$ctx = stream_context_create(['http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
echo file_get_contents("https://bonds-api.com/api/v1/curve?country=BE", false, $ctx);
JSON response example
How to read it: keys are standard maturities; values are yields in percent. inverted is a quick boolean indicator of whether short maturities are higher than long.
Endpoint: Intraday (yield snapshots throughout a day)
Capture within-day yield changes for Belgium’s specified maturity. Use UTC timestamps for ordering and to merge with your system clock.
cURL
Python
import requests
p = {"country": "BE", "maturity": "10Y", "date": "2026-10-03"}
r = requests.get("https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"}, params=p)
snapshots = r.json()["snapshots"]
# Example: last snapshot
print(snapshots[-1]["yield"], snapshots[-1]["fetched_at"])
JavaScript
const iu = new URL("https://bonds-api.com/api/v1/intraday");
iu.searchParams.set("country", "BE");
iu.searchParams.set("maturity", "10Y");
iu.searchParams.set("date", "2026-10-03");
const iRes = await fetch(iu, { headers: { "X-API-Key": "YOUR_API_KEY" }});
const iJson = await iRes.json();
console.log("Count:", iJson.count, iJson.snapshots);
PHP
<?php
$q = http_build_query(['country' => 'BE', 'maturity' => '10Y', 'date' => '2026-10-03']);
$ctx = stream_context_create(['http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
echo file_get_contents("https://bonds-api.com/api/v1/intraday?$q", false, $ctx);
JSON response example
How to read it: every snapshot has a yield (percent) and a fetched_at timestamp in UTC. The count shows how many snapshots were returned for that date.
Endpoint: Fluctuation (change, min, max over a period)
Summarize changes in Belgium yields between two dates, including the starting yield, ending yield, absolute change in percentage points, and period extremes.
cURL
Python
import requests
params = {
"countries": "BE",
"maturity": "10Y",
"start": "2025-10-03",
"end": "2026-10-03"
}
r = requests.get("https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
fl = r.json()["data"]["BE"]
print(fl["start_yield"], fl["end_yield"], fl["change"], fl["min"], fl["max"])
JavaScript
const f = new URL("https://bonds-api.com/api/v1/fluctuation");
f.searchParams.set("countries", "BE");
f.searchParams.set("maturity", "10Y");
f.searchParams.set("start", "2025-10-03");
f.searchParams.set("end", "2026-10-03");
fetch(f, { headers: { "X-API-Key": "YOUR_API_KEY" }})
.then(r => r.json())
.then(j => console.log(j.data.BE));
PHP
<?php
$q = http_build_query([
'countries' => 'BE',
'maturity' => '10Y',
'start' => '2025-10-03',
'end' => '2026-10-03'
]);
$ctx = stream_context_create(['http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
echo file_get_contents("https://bonds-api.com/api/v1/fluctuation?$q", false, $ctx);
JSON response example
How to read it: all values are yields in percent, except change which is the absolute difference in percentage points (e.g., 0.31 = +31 bps). For spreads in bps, use the /spread endpoint.
Real-time details, caching, and curve building tips
- Update cadence: daily official closing levels typically arrive once per business day. Intraday snapshots are available via
/intradayand should be treated as market data. - Caching: cache
/latestand/curveuntil the next business update window; set a shorter TTL for/intraday(e.g., minutes) to reduce rate-limit pressure. - Curve normalization: if you fetch partial maturities, you can fit a smooth curve (e.g., spline) across the returned keys. The
/curveendpoint already gives a coherent snapshot. - Holidays: if a date is non-trading,
/historicalwill return 404 for that exact day; pick the next prior business day in your logic if that’s acceptable. - Timezone: timestamps are UTC; ensure that your front-end translates appropriately for the user’s locale.
Common error responses and handling
Error responses always include success=false and an error message. Handle these HTTP statuses:
- 401: Missing or invalid X-API-Key
- 403: Account quota exceeded
- 404: No data for requested country/maturity/date combination
- 422: Invalid parameter (date format, unknown ISO2 code, etc.)
- 429: Rate limit exceeded
- 500: Server error
Implement backoff and retries for 429/500, validate parameters before calling, and surface clear user messages on 404/422.
Official live sample block
The following official sample illustrates a live response shape and a GET query including an API key parameter. Copying verbatim as provided:
Fields show a top-level date, per-symbol rates and dates, and a meta object with an ISO 8601 UTC timestamp. For Belgium usage in this article, all other examples authenticate via the X-API-Key header, and responses follow the endpoint-specific shapes shown above.
Putting it together: Belgium yield curve, spreads, and monitoring
With the endpoints above you can:
- Render a Belgium yield curve: one call to
/curveand plot maturities vs yields. Flag inversion using theinvertedboolean. - Track risk and relative value: compute 10Y BE vs US or DE using
/spread, and alert on spread widening beyond a threshold. - Monitor intraday: fetch
/intradaysnapshots for 10Y and 2Y to capture volatility spikes; store the lastfetched_atto request only new data each refresh cycle. - Study history: pull
/timeseriesfor 10Y BE to compute rolling averages, realized volatility, and drawdowns. Summarize monthly or quarterly changes via/fluctuation.
If you’re building this into a web dashboard, you can combine /latest for a top-level panel, /curve for the term structure chart, /spread for a relative panel, and /intraday for a live tape.
Fundamentals: what you’re getting and why it matters
Sovereign bond yields reflect the borrowing costs of a national government across maturities. The term structure encodes expectations about policy rates, growth, and inflation. For Belgium, monitoring the 2Y–10Y segment helps gauge near-term policy expectations vs long-term risk premia, while long-end moves (30Y) inform duration risk for liability-driven strategies. Spreads versus benchmarks (e.g., US or DE) reveal cross-market shifts and credit or liquidity premia.
Quick links to build faster
FAQ
Q: Are yields returned in percent or decimal?
A: Percent. For example, 4.52 means 4.52% yield. Spreads are in basis points on the spread endpoint.
Q: What timezone are intraday timestamps in?
A: UTC. The fetched_at field uses ISO 8601 (e.g., 2026-10-03T12:00:00Z).
Q: How do I handle weekends and holidays for Belgium?
A: The API returns data on business days. For a holiday or weekend date, expect 404 on /historical. Use the next prior business day or switch to /timeseries for a range that skips non-trading days.
Q: Can I query multiple maturities at once?
A: Yes on /latest via the maturities list, and for an entire curve use /curve without specifying maturities.
Q: What’s a good caching strategy?
A: Cache /latest and /curve daily and expire after the next market update; apply shorter TTLs to /intraday. Employ backoff on 429 and retries on 500.
Ship your Belgium sovereign yields integration today. Explore the API in the MCP and get an API key: Register. You can also Get started with Bonds API and find documentation on bonds-api.com.