You need reliable, machine-readable sovereign bond yields for Croatia that update throughout the trading day, with the ability to analyze intraday moves and period-to-period fluctuations. By the end of this guide, you will fetch Croatia (ISO2: HR) yields over HTTPS, build a HR yield curve, compute spreads to benchmarks, pull intraday snapshots, and quantify min/max/changes over any window—using the Bonds API REST endpoints that return clean JSON for direct ingestion into analytics and apps.
What this API returns and how to read it
The Bonds API returns sovereign bond yields for each country and maturity you request. Yields are expressed as percentage values (for example, 4.52 means 4.52%). Dates are calendar dates in YYYY-MM-DD. When timestamps appear, they are in ISO 8601 with Z (UTC) or an explicit offset. Spreads are returned in basis points (1 basis point = 0.01%).
Coverage spans more than 60 countries with maturities from 1M bills up to 50Y bonds. For Croatia, you can query the latest yields, a full daily yield curve, and time series. Intraday snapshots allow you to track multiple readings within a single trading day.
All endpoints are GET and hosted at https://bonds-api.com with versioned paths under https://bonds-api.com/api/v1/. Authentication uses an API key in the X-API-Key header. See the reference on bonds-api.com and explore models via the Bonds API MCP. To start building, get a key here: Register for Bonds API or Get started with Bonds API.
Conventions, trading days, and caching
- Yields: percentage values (e.g., 4.25 = 4.25%).
- Spreads: basis points (e.g., 215 = 2.15%).
- Dates: YYYY-MM-DD. Intraday timestamps are UTC unless specified in
meta.timezone. - Business days: Data series typically include business days; weekends and market holidays are absent. If you request a date that is a non-trading day, use the previous business day or consult the curve endpoint without a date to get the latest available trading session.
- Update frequency: Latest and intraday endpoints refresh during the trading day as new snapshots are ingested; historical and time series reflect settled daily values.
- Caching: Cache immutable historical results aggressively by URL (country/maturity/date). For intraday and latest, use short TTLs (e.g., 30–120 seconds) during market hours, and longer TTLs after close.
Authentication and request pattern
All calls are GET with your API key set in the X-API-Key header. Do not send the key via query parameters.
X-API-Key: YOUR_API_KEY
Base URL for every endpoint: https://bonds-api.com/api/v1/.
Current Yields: /latest
Use /latest to retrieve the most recent yields for Croatia across one or more maturities.
cURL
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
JSON response
{
"success": true,
"date": "2026-09-30",
"rates": {
"US_10Y": 5.278
},
"dates": {
"US_10Y": "2026-09-30"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "b76390f4-0022-4d39-a01b-39d29fcc3f55",
"timestamp": "2026-09-30T17:58:38+00:00"
}
}
How to read:
yield: percentage value for the maturity (e.g., 4.52 = 4.52%).date: last available business date for this reading, YYYY-MM-DD.source: data provenance tag (e.g., “official”).
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "HR", "maturities": "2Y,10Y"}
)
resp.raise_for_status()
data = resp.json()
hr_2y = data["data"]["HR"]["2Y"]["yield"]
hr_10y = data["data"]["HR"]["10Y"]["yield"]
as_of = data["data"]["HR"]["10Y"]["date"]
print(f"HR 2Y={hr_2y}% HR 10Y={hr_10y}% (as of {as_of})")
JavaScript (fetch)
async function getLatestHR() {
const url = new URL("https://bonds-api.com/api/v1/latest");
url.searchParams.set("countries", "HR");
url.searchParams.set("maturities", "2Y,10Y");
const resp = await fetch(url.toString(), {
method: "GET",
headers: { "X-API-Key": "YOUR_API_KEY" }
});
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
const json = await resp.json();
const data = json.data.HR;
return {
twoY: data["2Y"].yield,
tenY: data["10Y"].yield,
date: data["10Y"].date
};
}
getLatestHR().then(console.log).catch(console.error);
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=HR&maturities=2Y,10Y";
$json = file_get_contents($url, false, $context);
$data = json_decode($json, true);
$hr10 = $data["data"]["HR"]["10Y"]["yield"];
$date = $data["data"]["HR"]["10Y"]["date"];
echo "HR 10Y: {$hr10}% as of {$date}\n";
Yield on a Specific Date: /historical
Get the Croatia yield for a given maturity on a specific date (useful for event-studies and backfills).
cURL
JSON response
Fields:
yield: percentage for the requested date; if the date is a non-trading day, ensure you query the nearest trading day you need.country,maturity,date: echo parameters for traceability.
Python (requests)
import requests
params = {"country": "HR", "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)
r.raise_for_status()
rec = r.json()
print(f"HR {rec['maturity']} on {rec['date']}: {rec['yield']}%")
JavaScript (fetch)
async function getHRHistorical10Y(date) {
const url = new URL("https://bonds-api.com/api/v1/historical");
url.searchParams.set("country", "HR");
url.searchParams.set("maturity", "10Y");
url.searchParams.set("date", date);
const res = await fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json();
}
getHRHistorical10Y("2025-06-15").then(console.log);
PHP (Guzzle)
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client([
'base_uri' => 'https://bonds-api.com/api/v1/',
'headers' => ['X-API-Key' => 'YOUR_API_KEY']
]);
$res = $client->get('historical', [
'query' => ['country' => 'HR', 'maturity' => '10Y', 'date' => '2025-06-15']
]);
echo $res->getBody();
Daily Time Series: /timeseries
Retrieve a continuous daily series for a Croatian maturity between two dates (inclusive). Ideal for charting, regressions, and volatility estimates.
cURL
JSON response
Each item contains a business date with that day’s settled yield in percent. Series exclude weekends and holidays; handle gaps in your chart by joining business days or forward-filling as appropriate for your application.
Python (requests)
import requests
p = {"country": "HR", "maturity": "10Y", "start": "2025-09-30", "end": "2026-09-30"}
ts = requests.get("https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"},
params=p).json()
rows = ts["series"]
print(f"Observations: {len(rows)}; first={rows[0]}")
JavaScript (fetch)
async function getHRTenYSeries(start, end) {
const url = new URL("https://bonds-api.com/api/v1/timeseries");
url.searchParams.set("country", "HR");
url.searchParams.set("maturity", "10Y");
url.searchParams.set("start", start);
url.searchParams.set("end", end);
const r = await fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } });
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const json = await r.json();
return json.series;
}
getHRTenYSeries("2025-09-30", "2026-09-30").then(console.log);
PHP (file_get_contents)
<?php
$q = http_build_query([
'country' => 'HR',
'maturity' => '10Y',
'start' => '2025-09-30',
'end' => '2026-09-30'
]);
$ctx = stream_context_create(['http' => ['header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
$json = file_get_contents("https://bonds-api.com/api/v1/timeseries?$q", false, $ctx);
$data = json_decode($json, true);
foreach ($data['series'] as $row) {
echo $row['date'] . " " . $row['yield'] . "%\n";
}
Spread vs Benchmark: /spread
Compute Croatia’s spread to a benchmark country at a given maturity. Spreads are in basis points.
cURL
JSON response
Interpretation:
spread_bps: HR 10Y minus benchmark 10Y, in basis points (215 bps = 2.15%).country_yieldandbenchmark_yield: both in percent.
Python (requests)
import requests
q = {"country": "HR", "benchmark": "US", "maturity": "10Y"}
sp = requests.get("https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"},
params=q).json()
print(f"HR-{sp['benchmark']} {sp['maturity']} spread: {sp['spread_bps']} bps")
JavaScript (fetch)
async function getHRSpread(maturity = "10Y", benchmark = "US") {
const url = new URL("https://bonds-api.com/api/v1/spread");
url.searchParams.set("country", "HR");
url.searchParams.set("benchmark", benchmark);
url.searchParams.set("maturity", maturity);
const res = await fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json();
}
getHRSpread().then(s => console.log(`${s.spread_bps} bps`));
PHP (Guzzle)
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client([
'base_uri' => 'https://bonds-api.com/api/v1/',
'headers' => ['X-API-Key' => 'YOUR_API_KEY']
]);
$res = $client->get('spread', [
'query' => ['country' => 'HR', 'benchmark' => 'US', 'maturity' => '10Y']
]);
echo $res->getBody();
Full Yield Curve: /curve
Fetch a snapshot of the Croatia yield curve across available maturities. Use an optional date to backtest a curve on a past business day; otherwise, it returns the latest session.
cURL
JSON response
Notes:
curve: map of maturity to yield (percent). Use this to interpolate missing points (e.g., cubic spline) or compute forward rates.inverted: convenience flag if any shorter points exceed longer points (e.g., 2Y > 10Y).date: business date for the curve snapshot.
Python (requests)
import requests
curve = requests.get("https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "HR"}).json()
yc = curve["curve"]
print("HR curve 2Y-10Y slope:", yc["10Y"] - yc["2Y"], "pp")
JavaScript (fetch)
async function getHRCurve(date) {
const url = new URL("https://bonds-api.com/api/v1/curve");
url.searchParams.set("country", "HR");
if (date) url.searchParams.set("date", date);
const r = await fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } });
if (!r.ok) throw new Error(`HTTP ${r.status}`);
return r.json();
}
getHRCurve().then(c => console.log(c.curve));
PHP (file_get_contents)
<?php
$ctx = stream_context_create(['http' => ['header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
$url = "https://bonds-api.com/api/v1/curve?country=HR";
$json = file_get_contents($url, false, $ctx);
$data = json_decode($json, true);
echo "Inverted: " . ($data['inverted'] ? 'yes' : 'no') . "\n";
Intraday Snapshots: /intraday
Track within-day yield moves for a specific Croatia maturity on a given date. Use this for trading dashboards and real-time alerting.
cURL
JSON response
Interpretation:
snapshots[].yield: percentage at fetch time.fetched_at: ISO 8601 UTC timestamp; use this to order and chart intraday ticks.count: number of snapshots in the payload.meta.timezoneclarifies timestamps.
Python (requests)
import requests
from statistics import mean
p = {"country": "HR", "maturity": "10Y", "date": "2026-09-30"}
intr = requests.get("https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"},
params=p).json()
yields = [s["yield"] for s in intr["snapshots"]]
print("HR 10Y intraday avg:", round(mean(yields), 3), "%")
JavaScript (fetch)
async function hrIntraday(date = "2026-09-30", maturity = "10Y") {
const url = new URL("https://bonds-api.com/api/v1/intraday");
url.searchParams.set("country", "HR");
url.searchParams.set("maturity", maturity);
url.searchParams.set("date", date);
const r = await fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } });
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const j = await r.json();
return j.snapshots.map(s => [s.fetched_at, s.yield]);
}
hrIntraday().then(console.log);
PHP (Guzzle)
<?php
require 'vendor/autoload.php';
$cli = new \GuzzleHttp\Client(['base_uri' => 'https://bonds-api.com/api/v1/',
'headers' => ['X-API-Key' => 'YOUR_API_KEY']]);
$res = $cli->get('intraday', ['query' => [
'country' => 'HR', 'maturity' => '10Y', 'date' => '2026-09-30'
]]);
echo $res->getBody();
Fluctuation Analysis: /fluctuation
Summarize the change, min, and max for a Croatia maturity between two dates. Ideal for risk dashboards and alert thresholds.
cURL
JSON response
Fields for HR:
start_yield,end_yield: percent at the window edges.change: end minus start, percent points (0.31 = 31 bps higher).min,max: window extrema, percent.
Python (requests)
import requests
params = {"countries": "HR", "maturity": "10Y", "start": "2025-09-30", "end": "2026-09-30"}
fl = requests.get("https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params).json()
hr = fl["data"]["HR"]
print(f"HR 10Y Δ={hr['change']}pp (min={hr['min']}%, max={hr['max']}%)")
JavaScript (fetch)
async function hrFluctuation(maturity, start, end) {
const url = new URL("https://bonds-api.com/api/v1/fluctuation");
url.searchParams.set("countries", "HR");
url.searchParams.set("maturity", maturity);
url.searchParams.set("start", start);
url.searchParams.set("end", end);
const r = await fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } });
if (!r.ok) throw new Error(`HTTP ${r.status}`);
return r.json();
}
hrFluctuation("10Y", "2025-09-30", "2026-09-30").then(console.log);
PHP (file_get_contents)
<?php
$q = http_build_query([
'countries' => 'HR', 'maturity' => '10Y',
'start' => '2025-09-30', 'end' => '2026-09-30'
]);
$ctx = stream_context_create(['http' => ['header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
$out = file_get_contents("https://bonds-api.com/api/v1/fluctuation?$q", false, $ctx);
echo $out;
Putting it together: building HR curves, monitors, and risk tools
With these endpoints, a practical Croatia fixed-income toolchain could:
- Show a real-time panel for HR 2Y/5Y/10Y via
/latest, refreshing during trading hours every minute with conservative caching. - Render the Croatia yield curve via
/curve, including a slope readout (2s10s, 5s30s), and flaginvertedwhen true. - Attach an intraday chart for HR 10Y using
/intraday, highlighting local highs/lows and last trade vs previous snapshot. - Backfill and persist daily closes via
/timeseriesand point-date checks with/historicalto ensure continuity. - Track risk and alerting: use
/fluctuationto compute rolling 1M and 3M changes and set thresholds in percent or bps terms. - Benchmark Croatia to US or DE using
/spreadto follow cross-market relative value.
For developer documentation and schema references, visit bonds-api.com. Explore endpoints interactively in the MCP. When ready, Register for an API key.
Error handling and operational notes
All endpoints return a consistent error shape when something goes wrong:
- 401: Missing or invalid
X-API-Key. - 403: Account quota exceeded.
- 404: No data for the requested country/maturity/date combination.
- 422: Invalid parameter (bad date format, unknown ISO2).
- 429: Rate limit exceeded.
- 500: Server error.
Production tips:
- Validate inputs before calling (ISO dates, maturity formats like 2Y, 10Y).
- Retry transient 429/500 with exponential backoff; never retry 4xx without correcting the request.
- Normalize numeric fields: yields are percents, spreads are basis points; convert as needed for your UI (e.g., show 215 bps as 2.15%).
- Persist daily snapshots from
/latestat market close to maintain your own historical archive in case of later re-indexing.
Endpoint quick reference for Croatia
| Endpoint | Purpose | Key Params | Units |
|---|---|---|---|
| /latest | Current HR yields by maturity | countries=HR, maturities=2Y,10Y | yield: percent |
| /historical | Point-in-time HR yield | country=HR, maturity=10Y, date=YYYY-MM-DD | yield: percent |
| /timeseries | Daily series between dates | country=HR, maturity=10Y, start, end | yield: percent |
| /spread | Spread vs benchmark | country=HR, benchmark=US, maturity=10Y | spread_bps: bps |
| /curve | Full HR yield curve | country=HR, date (optional) | curve: percent by tenor |
| /intraday | Within-day snapshots | country=HR, maturity=10Y, date | yield: percent; fetched_at: UTC |
| /fluctuation | Change, min, max in window | countries=HR, maturity=10Y, start, end | percent, bps-equivalents |
Troubleshooting and data hygiene
- If you see a 404 for HR on a specific date, verify that date is a business day or adjust to the previous/next trading session present in
/timeseries. - Ensure maturities are spelled exactly as supported (e.g., 1M, 3M, 6M, 1Y, 2Y, 5Y, 10Y, 30Y).
- When reconciling spreads, confirm that both country and benchmark yields are for the same date/time basis.
- For dashboards, guard against partial intraday coverage by displaying the
countand lastfetched_at.
FAQ
Can I request multiple countries in one call?
Yes, /latest and /fluctuation accept comma-separated ISO2 codes in countries. For time series or intraday detail, call per country.
What timezone are intraday timestamps in?
Intraday timestamps are UTC in ISO 8601 format. The response includes meta.timezone for clarity.
How should I cache responses?
Cache historical and timeseries responses for long durations (they are immutable). Use short TTLs for /latest and /intraday during market hours and longer TTLs off-hours.
How are yields and spreads expressed?
Yields are percentages (e.g., 4.52 means 4.52%). Spreads are in basis points; convert to percentage points by dividing by 100.
What happens on weekends and holidays?
Daily series omit non-trading days. If you request a non-trading date where data is not available, handle gracefully and consider querying the previous business day.
Build your Croatia fixed-income dashboards, models, and alerts today with production-ready endpoints at bonds-api.com. Explore models in the Bonds API MCP, then Register for an API key and ship your integration.