You need reliable, machine-readable Swedish government bond yields to power analytics, trading dashboards, and research. By the end of this guide, you’ll be able to request Sweden’s latest yields, historical points, full time series, intraday snapshots, full yield curves, and benchmark spreads using Bonds API, then integrate those responses into your applications with Python, JavaScript, or PHP.
What you get for Sweden (SE): maturities, units, dates, and updates
Bonds API provides Sweden’s sovereign yields across a range of standard maturities, from bills (for example 1M, 3M, 6M) to longer bonds (1Y, 2Y, 5Y, 10Y, 30Y). Where supported, yields are available as:
- Latest levels by maturity and country.
- Historical snapshots on a specific date.
- Time series between two dates (business days only).
- Intraday snapshots for a given date and maturity.
- Full yield curves (multiple maturities in a single response).
- Spreads versus a benchmark (e.g., US or DE) in basis points.
Yields are expressed in percentage points (for example 4.52 means 4.52%). Spreads are reported in basis points (bps), where 1 bp = 0.01%. Dates are ISO 8601 (YYYY-MM-DD). Intraday timestamps are returned in UTC in ISO 8601 format (e.g., 2026-10-07T12:00:00Z). Data typically follows market calendars: expect business-day frequency for end-of-day series, with no observations on weekends and market holidays. Intraday snapshots are point-in-time, when available for the date requested.
Base URL and authentication apply to all endpoints:
- Base URL: https://bonds-api.com/api/v1/
- HTTP method: GET (for all endpoints)
- Authentication: X-API-Key request header
Explore the broader platform at bonds-api.com, and see the MCP for model control and developer tooling.
Quick authentication and request pattern
Every request uses GET and includes your API key in the X-API-Key header. The general pattern looks like this:
GET https://bonds-api.com/api/v1/<endpoint>?...params...
Header: X-API-Key: YOUR_API_KEY
Handle 4xx/5xx responses with retries or fallbacks as needed. Errors return a JSON object with success=false and an error message string.
Official sample (verbatim)
The following official sample demonstrates a latest-yield request and response. It is provided verbatim as a reference block.
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
{
"success": true,
"date": "2026-10-07",
"rates": {
"US_10Y": 5.288
},
"dates": {
"US_10Y": "2026-10-07"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "c0b559a5-597f-4150-ab73-6ffc6993373e",
"timestamp": "2026-10-07T01:05:33+00:00"
}
}
Endpoint: Latest — current yields for Sweden
Use this to fetch the most recent available yield(s) for Sweden by one or more maturities.
Parameters:
- countries (required): ISO2 codes, comma-separated (e.g., SE)
- maturities (optional): list like 2Y,10Y; omit to get all available
cURL
JSON response
How to read it:
- yield: percentage (e.g., 4.52 means 4.52%).
- date: the observation date in YYYY-MM-DD.
- source: “official” indicates primary market/statistical source.
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "SE", "maturities": "2Y,10Y"}
)
data = resp.json()
se_data = data["data"]["SE"]
y2 = se_data["2Y"]["yield"]
y10 = se_data["10Y"]["yield"]
obs_date = se_data["10Y"]["date"]
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/latest");
url.search = new URLSearchParams({ countries: "SE", maturities: "2Y,10Y" });
fetch(url, {
method: "GET",
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(json => {
const se = json.data.SE;
const y2 = se["2Y"].yield;
const y10 = se["10Y"].yield;
const date = se["10Y"].date;
console.log({ y2, y10, date });
});
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=SE&maturities=2Y,10Y";
$json = file_get_contents($url, false, $context);
$data = json_decode($json, true);
$y10 = $data["data"]["SE"]["10Y"]["yield"];
$date = $data["data"]["SE"]["10Y"]["date"];
echo "SE 10Y: $y10% on $date\n";
Endpoint: Historical — yield on a specific date
Retrieve Sweden’s yield for a given maturity on an exact date. If the date is a non-business day, the API returns an error; choose a valid market date.
Parameters:
- country (required): SE
- maturity (required): e.g., 10Y
- date (required): YYYY-MM-DD
cURL
JSON response
Fields:
- yield: percentage value for that date and maturity.
- date: requested observation date.
Python (requests)
import requests
params = {"country": "SE", "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
)
hist = resp.json()
print(hist["yield"], hist["date"])
JavaScript (fetch)
const params = { country: "SE", maturity: "10Y", date: "2025-06-15" };
const url = new URL("https://bonds-api.com/api/v1/historical");
url.search = new URLSearchParams(params);
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => console.log(j.yield, j.date));
PHP (file_get_contents)
<?php
$q = http_build_query(["country" => "SE", "maturity" => "10Y", "date" => "2025-06-15"]);
$context = stream_context_create(["http" => ["header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$json = file_get_contents("https://bonds-api.com/api/v1/historical?$q", false, $context);
$data = json_decode($json, true);
echo $data["yield"] . " on " . $data["date"];
Endpoint: Time Series — yields between two dates
Pull a continuous series of Sweden’s yields between start and end dates (inclusive). The series returns business days where data exists.
Parameters:
- country (required): SE
- maturity (required)
- start, end (required): YYYY-MM-DD; end ≥ start
cURL
JSON response
The series array contains one object per observation date. Each yield is a percentage.
Python (requests)
import requests
params = {"country": "SE", "maturity": "10Y", "start": "2025-10-07", "end": "2026-10-07"}
r = requests.get("https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
ts = r.json()["series"]
dates = [p["date"] for p in ts]
levels = [p["yield"] for p in ts]
JavaScript (fetch)
const params = { country: "SE", maturity: "10Y", start: "2025-10-07", end: "2026-10-07" };
const url = new URL("https://bonds-api.com/api/v1/timeseries");
url.search = new URLSearchParams(params);
const res = await fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } });
const json = await res.json();
const series = json.series;
PHP (file_get_contents)
<?php
$params = http_build_query([
"country" => "SE",
"maturity" => "10Y",
"start" => "2025-10-07",
"end" => "2026-10-07"
]);
$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?$params", false, $ctx);
$data = json_decode($json, true);
$series = $data["series"];
Endpoint: Spread — SE vs benchmark (bps)
Compute Sweden’s spread over a benchmark (e.g., US or DE) for a given maturity. The response includes the spread in basis points and both leg yields (percent).
Parameters:
- country (required): SE
- benchmark (required): ISO2 of benchmark country (e.g., US, DE)
- maturity (optional): defaults to 10Y
cURL
JSON response
Interpretation:
- spread_bps: country_yield − benchmark_yield in basis points (e.g., 215 bps = 2.15%).
- country_yield, benchmark_yield: percentage levels for the same maturity.
Python (requests)
import requests
params = {"country": "SE", "benchmark": "US", "maturity": "10Y"}
r = requests.get("https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
sp = r.json()
bps = sp["spread_bps"]
lhs = sp["country_yield"]
rhs = sp["benchmark_yield"]
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/spread");
url.search = new URLSearchParams({ country: "SE", benchmark: "US", maturity: "10Y" });
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
console.log(j.spread_bps, j.country_yield, j.benchmark_yield);
});
PHP (file_get_contents)
<?php
$q = http_build_query(["country" => "SE", "benchmark" => "US", "maturity" => "10Y"]);
$ctx = stream_context_create(["http" => ["header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$json = file_get_contents("https://bonds-api.com/api/v1/spread?$q", false, $ctx);
$data = json_decode($json, true);
echo $data["spread_bps"] . " bps";
Endpoint: Curve — a full Sweden yield curve
Get a complete set of maturities for Sweden on the latest (or a specified) date, ideal for bootstrapping, pricing, or curve visualization.
Parameters:
- country (required): SE
- date (optional): YYYY-MM-DD; omit for latest available
cURL
JSON response
Fields:
- curve: mapping of maturity to yield percentage.
- inverted: true if shorter maturities yield more than longer ones.
Python (requests)
import requests
r = requests.get("https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "SE"})
curve_obj = r.json()
curve = curve_obj["curve"]
is_inverted = curve_obj["inverted"]
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/curve");
url.search = new URLSearchParams({ country: "SE" });
const res = await fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } });
const json = await res.json();
const curve = json.curve;
const inverted = json.inverted;
PHP (file_get_contents)
<?php
$ctx = stream_context_create(["http" => ["header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$json = file_get_contents("https://bonds-api.com/api/v1/curve?country=SE", false, $ctx);
$data = json_decode($json, true);
$curve = $data["curve"];
$inverted = $data["inverted"];
Endpoint: Intraday — Sweden snapshots for a date
Intraday captures point-in-time snapshots for a maturity on a given date. Use this for live-ish tracking or building session summaries.
Parameters:
- country (required): SE
- maturity (required)
- date (required): YYYY-MM-DD
cURL
JSON response
Interpretation:
- yield: percentage at that snapshot time.
- fetched_at: UTC timestamp in ISO 8601 (Z = UTC).
- count: number of snapshots returned.
Python (requests)
import requests
params = {"country": "SE", "maturity": "10Y", "date": "2026-10-07"}
r = requests.get("https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
j = r.json()
snaps = j["snapshots"]
times = [s["fetched_at"] for s in snaps]
yields = [s["yield"] for s in snaps]
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/intraday");
url.search = new URLSearchParams({ country: "SE", maturity: "10Y", date: "2026-10-07" });
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
for (const s of j.snapshots) console.log(s.fetched_at, s.yield);
});
PHP (file_get_contents)
<?php
$q = http_build_query(["country" => "SE", "maturity" => "10Y", "date" => "2026-10-07"]);
$ctx = stream_context_create(["http" => ["header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$json = file_get_contents("https://bonds-api.com/api/v1/intraday?$q", false, $ctx);
$data = json_decode($json, true);
foreach ($data["snapshots"] as $s) {
echo $s["fetched_at"] . " " . $s["yield"] . "\n";
}
Endpoint: Fluctuation — change, min, max over a period
Summarize Sweden’s change over a period for a specific maturity. Great for performance summaries on dashboards.
Parameters:
- countries (required): ISO2 codes, comma-separated (SE supported)
- maturity (required)
- start, end (required): YYYY-MM-DD
cURL
JSON response
Fields:
- start_yield, end_yield: percentages at the boundary dates.
- change: end − start in percentage points.
- min, max: extremes within [start, end].
Python (requests)
import requests
params = {"countries": "SE", "maturity": "10Y", "start": "2025-10-07", "end": "2026-10-07"}
r = requests.get("https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
fx = r.json()["data"]["SE"]
delta_bps = fx["change"] * 100 # convert pct-pts to bps
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/fluctuation");
url.search = new URLSearchParams({
countries: "SE", maturity: "10Y", start: "2025-10-07", end: "2026-10-07"
});
const res = await fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } });
const data = (await res.json()).data.SE;
PHP (file_get_contents)
<?php
$q = http_build_query([
"countries" => "SE",
"maturity" => "10Y",
"start" => "2025-10-07",
"end" => "2026-10-07"
]);
$ctx = stream_context_create(["http" => ["header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$json = file_get_contents("https://bonds-api.com/api/v1/fluctuation?$q", false, $ctx);
$fx = json_decode($json, true)["data"]["SE"];
Putting it together: Sweden yield curves and spreads
For curve-building, use the Curve endpoint when you need a single JSON with multiple maturities on one date. If you prefer to control maturities, the Latest endpoint supports passing maturities=1Y,2Y,5Y,10Y,30Y to fetch a custom slice. To compute curve shapes (steepness, butterfly), combine the curve yields accordingly.
For cross-country relative value, use the Spread endpoint to compare SE against US or DE at the same maturity. The spread_bps field is already in basis points, so it’s easy to chart or alert on thresholds (for example, alert if SE–DE 10Y spread breaches +50 bps). You can track historical changes by pairing time series with fluctuation summaries to see how spreads evolve across weeks or months.
In performance-sensitive applications, cache end-of-day results for the trading session and refresh intraday snapshots periodically. For example:
- Cache /curve and /latest responses per country-date. Invalidate after the close or at your defined refresh interval.
- For intraday, poll /intraday at moderate intervals (e.g., every 15–30 minutes) if your application needs within-day updates.
Learn more about the platform at bonds-api.com, and when you are ready to build, use the links at the end of this page to register and explore the MCP tools.
Sovereign bond fundamentals (Sweden context)
Sovereign bonds are debt securities issued by a national government. Their yields reflect policy rates, inflation expectations, term premium, and country-specific risk. In Sweden’s case, movements in short tenors (e.g., 1M–1Y) often track Riksbank policy expectations, while longer tenors (e.g., 10Y–30Y) embed growth and inflation outlooks. Yield curves summarize the cost of borrowing across maturities; spreads versus benchmarks (e.g., US, DE) convey relative risk and macro divergence.
Operational notes: calendars, errors, and production hardening
Calendars and gaps:
- Expect no observations on weekends and Swedish market holidays in end-of-day series.
- Time series endpoints return only dates with data; do not assume daily continuity across non-business days.
Error handling: all endpoints return a consistent error shape with success=false and an error string. Common HTTP statuses include:
- 401: Missing or invalid X-API-Key
- 403: Account quota exceeded
- 404: No data for the requested country/maturity/date
- 422: Invalid parameter (date format, ISO2 code, etc.)
- 429: Rate limit exceeded
- 500: Server error
Resilience and caching tips:
- Cache by endpoint, country, maturity set, and date range where practical.
- For time series and fluctuation aggregations, compute and memoize derived metrics (changes, min/max) to reduce re-requests.
- Implement exponential backoff on 429 and short jittered retries on transient 5xx.
Use cases in finance and research
- Financial dashboards: chart Sweden SE 2Y–10Y curve, latest levels, and intraday ticks.
- Portfolio risk: monitor duration exposure and track SE 10Y fluctuation over 1M/3M windows.
- Macro research: compare SE vs DE spreads across maturities to infer policy differentials.
- Quant models: feed time series into term structure models and compute forward curves.
FAQ
How are yields and spreads expressed?
Yields are percentages (e.g., 4.52 = 4.52%). Spreads are basis points (e.g., 25 = 0.25%).
What timezone are timestamps in?
Dates are calendar days (YYYY-MM-DD). Intraday fetched_at timestamps are UTC ISO 8601 (e.g., 2026-10-07T12:00:00Z). The intraday meta.timezone field is UTC.
What happens on weekends and holidays?
End-of-day series have no observations on non-business days. Time series will therefore skip those dates.
Can I compute my own spreads?
Yes. You can subtract benchmark yields from Sweden yields and convert to basis points. Or use the /spread endpoint, which returns spread_bps and both leg yields.
How do I build a Sweden yield curve?
Use /curve for a full curve on one date, or /latest with a maturities list to get selected points (e.g., 1Y,2Y,5Y,10Y,30Y) and assemble your own curve array.
Ship your integration: fetch Sweden’s curve, time series, and spreads in minutes. Register for an API key and explore models and tooling in the MCP. For more details, visit bonds-api.com or Get started with Bonds API.