You need clean, reliable Switzerland (CH) sovereign bond yields you can pull directly into models, dashboards, and trading tools—without manual downloads or screen-scraping. By the end of this guide, you will query current and historical Swiss government bond yields, build a yield curve, compute spreads versus benchmarks, stream intraday snapshots, and quantify fluctuations using the Bonds API timeseries endpoints—all as JSON over HTTPS.
What this guide covers
This article focuses on Switzerland’s sovereign bond yields via the Bonds API, covering:
- Latest yields by maturity and how to assemble a Swiss yield curve
- Historical and timeseries data for backtests, studies, and risk
- Intraday snapshots to monitor moves during market hours
- Spreads versus benchmarks (e.g., U.S. Treasuries) in basis points
- Fluctuation stats (change, min, max) for research and monitoring
- Practical integration details: units, dates, holidays, caching, and errors
All endpoints are GET requests to https://bonds-api.com/api/v1/ with authentication via the X-API-Key header. Explore more on bonds-api.com and use the MCP to test live calls interactively.
Swiss sovereign bonds 101 and data fundamentals
Swiss Confederation bonds are high-grade sovereign debt denominated in CHF. Maturities span bills (e.g., 1M, 3M, 6M) through longer tenors (1Y, 2Y, 5Y, 10Y, 30Y). The Bonds API returns yields as percentages (e.g., 4.52 means 4.52%). Spreads are returned in basis points (bps), where 1 bp = 0.01%.
Dates in responses use the Y-m-d format (e.g., 2026-10-01). Intraday timestamps are in UTC ISO 8601 (e.g., 2026-10-01T12:00:00Z). Trading calendars include weekends and Swiss market holidays; the latest available date will reflect the last business day with data.
Endpoint: Latest yields for Switzerland
Use this endpoint to fetch the current yield snapshot for the specified maturities. Omit maturities to get all available tenors for the given country code (CH).
Request (cURL)
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
Request (Python)
import requests
resp = requests.get(
'https://bonds-api.com/api/v1/latest',
headers={'X-API-Key': 'YOUR_API_KEY'},
params={'countries': 'CH', 'maturities': '2Y,10Y'}
)
data = resp.json()
print(data)
Request (JavaScript)
const url = new URL('https://bonds-api.com/api/v1/latest');
url.searchParams.set('countries', 'CH');
url.searchParams.set('maturities', '2Y,10Y');
fetch(url.toString(), {
method: 'GET',
headers: { 'X-API-Key': 'YOUR_API_KEY' }
})
.then(r => r.json())
.then(console.log)
.catch(console.error);
Request (PHP)
<?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=CH&maturities=2Y,10Y";
$response = file_get_contents($url, false, $context);
echo $response;
Response (JSON)
{
"success": true,
"date": "2026-10-01",
"rates": {
"US_10Y": 5.294
},
"dates": {
"US_10Y": "2026-10-01"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "82135424-d8bf-4335-bcb0-c39dc28a7fca",
"timestamp": "2026-10-01T00:05:27+00:00"
}
}
How to read it:
- yield: percentage (4.25 means 4.25%).
- date: last business day with data in Y-m-d format.
- source: “official” indicates an authoritative source for the last available date.
Endpoint: Historical yield for a specific Swiss date
Pull the yield for one maturity on an exact calendar date (business day). If the date is a non-trading day, expect a 404 (“No data for requested ... date combination”).
Request (cURL)
Request (Python)
import requests
resp = requests.get(
'https://bonds-api.com/api/v1/historical',
headers={'X-API-Key': 'YOUR_API_KEY'},
params={'country': 'CH', 'maturity': '10Y', 'date': '2025-06-15'}
)
print(resp.json())
Request (JavaScript)
const url = new URL('https://bonds-api.com/api/v1/historical');
url.searchParams.set('country', 'CH');
url.searchParams.set('maturity', '10Y');
url.searchParams.set('date', '2025-06-15');
fetch(url, { headers: { 'X-API-Key': 'YOUR_API_KEY' } })
.then(r => r.json())
.then(console.log)
.catch(console.error);
Request (PHP)
<?php
$params = http_build_query([
'country' => 'CH',
'maturity' => '10Y',
'date' => '2025-06-15'
]);
$context = 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/historical?$params", false, $context);
Response (JSON)
Fields:
- yield: percentage on that date.
- date: trade date in Y-m-d.
- source: data provenance (“official”).
Endpoint: Swiss yield timeseries between two dates
Use for charts, factor models, or rolling analytics across a period. The response returns an array of date/yield objects for the requested maturity.
Request (cURL)
Request (Python)
import requests
resp = requests.get(
'https://bonds-api.com/api/v1/timeseries',
headers={'X-API-Key': 'YOUR_API_KEY'},
params={
'country': 'CH',
'maturity': '10Y',
'start': '2025-10-01',
'end': '2026-10-01'
}
)
series = resp.json()
print(series)
Request (JavaScript)
const url = new URL('https://bonds-api.com/api/v1/timeseries');
url.searchParams.set('country', 'CH');
url.searchParams.set('maturity', '10Y');
url.searchParams.set('start', '2025-10-01');
url.searchParams.set('end', '2026-10-01');
fetch(url, { headers: { 'X-API-Key': 'YOUR_API_KEY' } })
.then(r => r.json())
.then(console.log)
.catch(console.error);
Request (PHP)
<?php
$query = http_build_query([
'country' => 'CH',
'maturity' => '10Y',
'start' => '2025-10-01',
'end' => '2026-10-01'
]);
$context = 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/timeseries?$query", false, $context);
Response (JSON)
Interpretation:
- series: array of objects with daily yields for business days.
- date: Y-m-d; gaps reflect weekends/holidays.
- yield: percentage value for that date.
Endpoint: Spread versus benchmark (bps)
Compute the Swiss yield spread versus another sovereign benchmark (e.g., US). The default maturity is 10Y unless overridden.
Request (cURL)
Request (Python)
import requests
resp = requests.get(
'https://bonds-api.com/api/v1/spread',
headers={'X-API-Key': 'YOUR_API_KEY'},
params={'country': 'CH', 'benchmark': 'US', 'maturity': '10Y'}
)
print(resp.json())
Request (JavaScript)
const url = new URL('https://bonds-api.com/api/v1/spread');
url.searchParams.set('country', 'CH');
url.searchParams.set('benchmark', 'US');
url.searchParams.set('maturity', '10Y');
fetch(url, { headers: { 'X-API-Key': 'YOUR_API_KEY' } })
.then(r => r.json())
.then(console.log)
.catch(console.error);
Request (PHP)
<?php
$params = http_build_query([
'country' => 'CH',
'benchmark' => 'US',
'maturity' => '10Y'
]);
$context = 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/spread?$params", false, $context);
Response (JSON)
Field notes:
- spread_bps: basis points difference (1 bp = 0.01%).
- country_yield, benchmark_yield: percentage levels for CH and benchmark.
Endpoint: Full Swiss yield curve
Get the curve across supported maturities for CH on the latest date (or a specified date). Ideal for plotting curve shapes or feeding duration/convexity calculators.
Request (cURL)
Request (Python)
import requests
resp = requests.get(
'https://bonds-api.com/api/v1/curve',
headers={'X-API-Key': 'YOUR_API_KEY'},
params={'country': 'CH'}
)
curve = resp.json()
print(curve)
Request (JavaScript)
const url = new URL('https://bonds-api.com/api/v1/curve');
url.searchParams.set('country', 'CH');
fetch(url, { headers: { 'X-API-Key': 'YOUR_API_KEY' } })
.then(r => r.json())
.then(console.log)
.catch(console.error);
Request (PHP)
<?php
$query = http_build_query(['country' => 'CH']);
$context = 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?$query", false, $context);
Response (JSON)
Interpretation:
- curve: map of maturity to yield (percentages).
- inverted: boolean indicating if near-term yields exceed longer tenors.
- date: the valuation date for the curve (Y-m-d).
Typical Swiss curve tenors
| Bill/Bond | Maturity Code | Returned in curve |
|---|---|---|
| T-bill | 1M, 3M, 6M | Yes (if available) |
| Notes | 1Y, 2Y, 5Y | Yes |
| Bonds | 10Y, 30Y | Yes |
Endpoint: Intraday yield snapshots
Use this to monitor Swiss yields at multiple times during a trading day (UTC timestamps). Helpful for intraday risk, alerting, or execution analytics.
Request (cURL)
Request (Python)
import requests
resp = requests.get(
'https://bonds-api.com/api/v1/intraday',
headers={'X-API-Key': 'YOUR_API_KEY'},
params={'country': 'CH', 'maturity': '10Y', 'date': '2026-10-01'}
)
print(resp.json())
Request (JavaScript)
const url = new URL('https://bonds-api.com/api/v1/intraday');
url.searchParams.set('country', 'CH');
url.searchParams.set('maturity', '10Y');
url.searchParams.set('date', '2026-10-01');
fetch(url, { headers: { 'X-API-Key': 'YOUR_API_KEY' } })
.then(r => r.json())
.then(console.log)
.catch(console.error);
Request (PHP)
<?php
$query = http_build_query([
'country' => 'CH',
'maturity' => '10Y',
'date' => '2026-10-01'
]);
$context = 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?$query", false, $context);
Response (JSON)
Fields:
- snapshots: array of intraday yields with UTC timestamps (ISO 8601).
- yield: percentage; fetched_at: time the snapshot was captured.
- source: “market” indicates intraday price-derived yield.
- count: number of snapshots returned; meta.timezone: UTC.
Endpoint: Fluctuation over a period
Get change, min, max, and endpoints over a date range for specified maturities. Useful for percentiles, alert thresholds, or regime diagnostics.
Request (cURL)
Request (Python)
import requests
resp = requests.get(
'https://bonds-api.com/api/v1/fluctuation',
headers={'X-API-Key': 'YOUR_API_KEY'},
params={
'countries': 'CH',
'maturity': '10Y',
'start': '2025-10-01',
'end': '2026-10-01'
}
)
print(resp.json())
Request (JavaScript)
const url = new URL('https://bonds-api.com/api/v1/fluctuation');
url.searchParams.set('countries', 'CH');
url.searchParams.set('maturity', '10Y');
url.searchParams.set('start', '2025-10-01');
url.searchParams.set('end', '2026-10-01');
fetch(url, { headers: { 'X-API-Key': 'YOUR_API_KEY' } })
.then(r => r.json())
.then(console.log)
.catch(console.error);
Request (PHP)
<?php
$query = http_build_query([
'countries' => 'CH',
'maturity' => '10Y',
'start' => '2025-10-01',
'end' => '2026-10-01'
]);
$context = 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?$query", false, $context);
Response (JSON)
Field notes:
- start_yield, end_yield: percentages at the boundaries.
- change: absolute percentage points (end - start).
- min, max: extreme yields in the window (percent).
Error handling and reliability
All responses share a consistent error shape on failure: success=false with an error message string. Handle HTTP status codes programmatically:
- 401: Missing or invalid X-API-Key
- 403: Account quota exceeded
- 404: No data for requested country/maturity/date
- 422: Invalid parameter (date format Y-m-d, ISO2 code, etc.)
- 429: Rate limit exceeded
- 500: Server error
Use retries with backoff for transient 429/500s. Cache latest and curve responses for a few minutes during trading to reduce load, and daily snapshots for historical use cases. Timeseries and fluctuation calls are good candidates for server-side caching keyed by (country, maturity, start, end).
Building a Swiss yield curve and spreads in practice
You can either call the curve endpoint directly or assemble from latest by requesting multiple maturities (e.g., maturities=1Y,2Y,5Y,10Y,30Y). For spreads, the dedicated spread endpoint yields basis points, saving you from manual alignment.
- Curve plotting: pull /curve?country=CH once per update cycle; plot maturity vs yield.
- Risk monitoring: use /fluctuation to compute drawdowns and volatility bands.
- Dashboards: combine /latest for current marks with /timeseries for trend context.
- Intraday alerts: stream /intraday snapshots and trigger thresholds on fetched_at.
For broader developer documentation and examples, see bonds-api.com. When you are ready to integrate, use the MCP to explore requests live.
Live sample compatibility note (verbatim)
The following official live sample showcases a latest endpoint variant returned by the platform. It is provided verbatim for reference and testing parity.
Field notes:
- rates: yield values by symbol, expressed as percentages.
- date and dates: Y-m-d trade date; meta.timestamp is an ISO 8601 UTC timestamp.
- currencies: currency per symbol (USD in this sample).
Business days, holidays, updates, and caching tips
Swiss bond yields reflect business-day availability. On weekends and Swiss public holidays, latest will remain at the last published business day. Intraday data will typically be absent on non-trading days.
- Update cadence: latest/curve update on each new business day; intraday snapshots during market hours (UTC timestamps).
- Caching: cache latest and curve for minutes in active hours; cache historical/timeseries/fluctuation aggressively server-side.
- Backfills: use historical for exact dates; use timeseries for windows and rolling computations.
- Spreads: standardize to basis points; watch sign conventions if comparing inverted curves.
Putting it together: a Swiss fixed-income dashboard
A practical dashboard for CH might:
- Call /latest for 2Y and 10Y to visualize front-end vs long-end moves.
- Call /curve once per update to draw the full Swiss curve (1M to 30Y).
- Call /spread against US for 10Y in bps to display risk differentials.
- Call /timeseries for 10Y (past 1Y) to render trend lines and moving averages.
- Call /fluctuation for 10Y over the quarter for min/max bands.
- Call /intraday to show live tiles with UTC timestamps and latest snapshots.
These endpoints are all GET with an X-API-Key header. Keep requests idempotent, cache aggressively, and surface clear error messages for 401/403/422/429 cases.
Complete reference: authentication and parameters
- Base URL: https://bonds-api.com/api/v1/
- Authentication: X-API-Key: YOUR_API_KEY
- HTTP method: GET only
- Country code: CH for Switzerland
- Maturities: 1M, 3M, 6M, 1Y, 2Y, 5Y, 10Y, 30Y (per curve example)
- Dates: Y-m-d; Intraday timestamps: ISO 8601 UTC
When you are ready to ship your integration, create your key here: Register. You can also explore endpoints interactively via the MCP.
FAQ
How are yields and spreads expressed?
Yields are percentages (e.g., 4.52 means 4.52%). Spreads are in basis points (bps), where 1 bp = 0.01%.
What timezone and format are dates in?
Trade dates are Y-m-d (e.g., 2026-10-01). Intraday timestamps are ISO 8601 in UTC (e.g., 2026-10-01T12:00:00Z).
How do weekends and holidays affect data?
Latest and curve reflect the last business day with data. Historical and timeseries omit non-trading days, so you may see date gaps over weekends/holidays.
Can I request multiple Swiss maturities at once?
Yes. Use /latest with countries=CH and maturities= comma-separated list. Alternatively, call /curve to fetch the full set of available tenors for CH in one response.
What should I cache?
Cache latest and curve for minutes during market hours, historical/timeseries/fluctuation more aggressively (hours or days), and intraday in-memory for live tiles. Always handle 429/500 with retries and backoff.
Ready to integrate Switzerland’s sovereign yields into your stack? Generate your API key and start calling the endpoints in minutes: Register. For quick experiments, open the MCP and run the examples above against live data.