You need accurate, machine-readable United Kingdom (GB) 10-year sovereign yields to power analytics, dashboards, and risk models. By the end of this guide, you’ll fetch the latest GB 10Y yield, retrieve historical and intraday data, compute GB–US spreads, and build a full UK yield curve using Bonds API’s REST endpoints.
Scope and data model
This article focuses on the United Kingdom’s sovereign market, with special attention to the 10-year maturity. All examples use GB (ISO2) and demonstrate how to:
- Pull the latest GB 10Y and multi-tenor yields.
- Request historical, time series, and intraday snapshots.
- Build a UK yield curve and detect inversion.
- Compute spreads versus a benchmark (e.g., US Treasuries).
- Calculate changes, min, and max over a period for GB 10Y.
Yields are returned as percentages unless noted otherwise (spreads are in basis points). Dates are in Y-m-d (e.g., 2026-10-07). Timestamps are ISO 8601 in UTC (e.g., 2026-10-07T12:00:00Z). All requests are GET against the base URL https://bonds-api.com/api/v1/ and require authentication. See bonds-api.com for platform details and coverage.
Quickstart: official sample for GB 10Y latest
The block below is a live sample of the “latest” endpoint for GB 10Y. Copy it as-is to verify reachability and response shape.
curl -s "https://bonds-api.com/api/v1/latest?countries=GB&maturities=10Y&api_key=YOUR_API_KEY"
{
"success": true,
"date": "2026-10-07",
"rates": {
"GB_10Y": 5.3796
},
"dates": {
"GB_10Y": "2026-10-07"
},
"currencies": {
"GB_10Y": "GBP"
},
"meta": {
"request_id": "41f7221a-1bdf-4a41-8ab5-2385629b2614",
"timestamp": "2026-10-07T01:04:03+00:00"
}
}
How to read this sample:
- rates.GB_10Y: The UK 10Y yield, as a percentage (e.g., 5.3796 means 5.3796%).
- date and dates.GB_10Y: The market date associated with the yield (YYYY-MM-DD).
- currencies.GB_10Y: The base currency of the instrument (GBP for Gilts).
- meta.timestamp: The UTC time the data was produced or fetched.
Note: Subsequent sections use the documented response shapes for each endpoint to demonstrate field-by-field integration in common workflows. For the broader API catalog and tooling, visit the Bonds API MCP or the UTM-enabled MCP.
Latest: current UK yields (single or multiple maturities)
Use this endpoint to get current yields for GB across maturities. You can request just 10Y, or multiple tenors to build a partial yield curve snapshot.
Endpoint
GET https://bonds-api.com/api/v1/latest
Parameters
- countries (required): comma-separated ISO2 codes; use GB for the United Kingdom.
- maturities (optional): comma-separated (e.g., 2Y,10Y). Omit to return all available maturities for GB.
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "GB", "maturities": "2Y,10Y"}
)
data = resp.json()
# Access examples:
# data["data"]["GB"]["10Y"]["yield"] # float, percentage
# data["data"]["GB"]["10Y"]["date"] # "YYYY-MM-DD"
JavaScript (fetch)
const url = "https://bonds-api.com/api/v1/latest?countries=GB&maturities=2Y,10Y";
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(data => {
const tenY = data.data.GB["10Y"].yield; // percent
const twoY = data.data.GB["2Y"].yield; // percent
console.log({ twoY, tenY });
});
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=GB&maturities=2Y,10Y";
$json = file_get_contents($url, false, $context);
$data = json_decode($json, true);
$tenY = $data["data"]["GB"]["10Y"]["yield"];
$twoY = $data["data"]["GB"]["2Y"]["yield"];
echo "GB 2Y=${twoY}%, 10Y=${tenY}%";
?>
JSON response (example)
Fields:
- yield: Percentage yield (e.g., 4.52 means 4.52%).
- date: Market date (Y-m-d) associated with the yield.
- source: Origin label (e.g., “official”).
Historical: GB 10Y on a specific date
Fetch the GB 10Y yield for a single market date for point-in-time comparisons or backfills.
Endpoint
GET https://bonds-api.com/api/v1/historical
Parameters
- country (required): GB
- maturity (required): e.g., 10Y
- date (required): Y-m-d
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/historical",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "GB", "maturity": "10Y", "date": "2025-06-15"}
)
record = resp.json()
# record["yield"] is a percent; record["date"] is "YYYY-MM-DD"
JavaScript (fetch)
const params = new URLSearchParams({ country: "GB", maturity: "10Y", date: "2025-06-15" });
fetch("https://bonds-api.com/api/v1/historical?" + params.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(row => {
console.log(row.yield, row.date);
});
PHP
<?php
$q = http_build_query(["country" => "GB", "maturity" => "10Y", "date" => "2025-06-15"]);
$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/historical?$q", false, $ctx);
$row = json_decode($json, true);
echo "GB 10Y on {$row["date"]}: {$row["yield"]}% (source: {$row["source"]})";
?>
JSON response (example)
Fields:
- yield: Percentage on the requested date.
- date: The market date you asked for.
- source: Provenance label.
Time series: GB 10Y between two dates
Load a continuous set of daily yields to drive charts, regressions, and model inputs for GB 10Y.
Endpoint
GET https://bonds-api.com/api/v1/timeseries
Parameters
- country (required): GB
- maturity (required): e.g., 10Y
- start (required): Y-m-d
- end (required): Y-m-d, end ≥ start
cURL
Python (requests)
import requests
params = {
"country": "GB",
"maturity": "10Y",
"start": "2025-10-07",
"end": "2026-10-07"
}
resp = requests.get("https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
series = resp.json()["series"]
# series is a list of { "date": "YYYY-MM-DD", "yield": float } entries
JavaScript (fetch)
const q = new URLSearchParams({ country: "GB", maturity: "10Y", start: "2025-10-07", end: "2026-10-07" });
fetch("https://bonds-api.com/api/v1/timeseries?" + q.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(payload => {
for (const pt of payload.series) {
// pt.yield is percent, pt.date is YYYY-MM-DD
console.log(pt.date, pt.yield);
}
});
PHP
<?php
$q = http_build_query([
"country" => "GB",
"maturity" => "10Y",
"start" => "2025-10-07",
"end" => "2026-10-07"
]);
$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/timeseries?$q", false, $ctx);
$payload = json_decode($json, true);
foreach ($payload["series"] as $pt) {
echo $pt["date"] . ": " . $pt["yield"] . "%\n";
}
?>
JSON response (example)
Fields:
- series[].date: Business dates only; weekends/holidays typically omitted.
- series[].yield: Daily close yield in percent.
Intraday snapshots: GB 10Y within a single day
Use intraday snapshots to observe GB 10Y through the trading session. Timestamps are UTC; align them to your local timezone if needed.
Endpoint
GET https://bonds-api.com/api/v1/intraday
Parameters
- country (required): GB
- maturity (required): 10Y
- date (required): Y-m-d
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "GB", "maturity": "10Y", "date": "2026-10-07"}
)
data = resp.json()
# data["snapshots"] is a list of {"yield": float, "fetched_at": ISO8601, "source": "market"}
JavaScript (fetch)
const q = new URLSearchParams({ country: "GB", maturity: "10Y", date: "2026-10-07" });
fetch("https://bonds-api.com/api/v1/intraday?" + q.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(x => {
// yields in percent; fetched_at is UTC
console.table(x.snapshots);
});
PHP
<?php
$q = http_build_query(["country" => "GB", "maturity" => "10Y", "date" => "2026-10-07"]);
$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/intraday?$q", false, $ctx);
$intraday = json_decode($json, true);
foreach ($intraday["snapshots"] as $s) {
echo $s["fetched_at"] . " " . $s["yield"] . "%\n";
}
?>
JSON response (example)
Fields:
- snapshots[].yield: Percent at snapshot time.
- snapshots[].fetched_at: UTC timestamp when the value was captured.
- meta.timezone: Always UTC in this example; convert as needed.
Yield curve: full UK curve by date
Retrieve the entire set of GB maturities for the latest available date (or a specified date) to build a yield curve. This is useful for interpolation, bootstrapping discount curves, and curve diagnostics.
Endpoint
GET https://bonds-api.com/api/v1/curve
Parameters
- country (required): GB
- date (optional): Y-m-d; default is the latest available day with data.
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "GB"}
)
curve = resp.json()
tenY = curve["curve"].get("10Y") # percent
is_inverted = curve["inverted"] # boolean
JavaScript (fetch)
fetch("https://bonds-api.com/api/v1/curve?country=GB", {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(curve => {
// curve.curve is an object keyed by tenor, values are percent yields
console.log(curve.date, curve.curve["1Y"], curve.curve["10Y"]);
});
PHP
<?php
$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/curve?country=GB", false, $ctx);
$curve = json_decode($json, true);
echo "Date: {$curve["date"]}\n";
foreach ($curve["curve"] as $tenor => $y) echo "$tenor: $y%\n";
?>
JSON response (example)
Fields:
- curve: Map of tenor → yield in percent (short bills through long bonds).
- inverted: True if the curve slopes downward from short to long maturities by a rule the API applies.
- date: Market date for the curve snapshot.
Spread: GB vs benchmark (e.g., US 10Y)
Calculate yield differential in basis points versus a benchmark. Default maturity is 10Y if not specified.
Endpoint
GET https://bonds-api.com/api/v1/spread
Parameters
- country (required): GB
- benchmark (required): ISO2 of benchmark, e.g., US
- maturity (optional): e.g., 10Y; default is 10Y
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "GB", "benchmark": "US", "maturity": "10Y"}
)
spread = resp.json()
# spread["spread_bps"] is an integer/float in basis points
JavaScript (fetch)
const q = new URLSearchParams({ country: "GB", benchmark: "US", maturity: "10Y" });
fetch("https://bonds-api.com/api/v1/spread?" + q.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(s => {
console.log(`GB-US 10Y spread: ${s.spread_bps} bps`);
});
PHP
<?php
$q = http_build_query(["country" => "GB", "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);
$s = json_decode($json, true);
echo "GB-US 10Y spread: {$s["spread_bps"]} bps\n";
?>
JSON response (example)
Fields:
- spread_bps: Spread in basis points (1 bp = 0.01%).
- country_yield, benchmark_yield: Percent yields used to compute the spread.
Fluctuation: GB 10Y change, min, max over a period
Summarize performance of GB 10Y across a time window with start/end yields, absolute change, and extremes.
Endpoint
GET https://bonds-api.com/api/v1/fluctuation
Parameters
- countries (required): GB (supports multiple ISO2 codes, comma-separated)
- maturity (required): 10Y
- start (required): Y-m-d
- end (required): Y-m-d
cURL
Python (requests)
import requests
params = {
"countries": "GB",
"maturity": "10Y",
"start": "2025-10-07",
"end": "2026-10-07"
}
resp = requests.get("https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
fl = resp.json()["data"]["GB"]
# fl has start_yield, end_yield, change, min, max (all in percent)
JavaScript (fetch)
const q = new URLSearchParams({ countries: "GB", maturity: "10Y", start: "2025-10-07", end: "2026-10-07" });
fetch("https://bonds-api.com/api/v1/fluctuation?" + q.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(x => {
const gb = x.data.GB;
console.log(gb.start_yield, gb.end_yield, gb.change, gb.min, gb.max);
});
PHP
<?php
$q = http_build_query(["countries" => "GB", "maturity" => "10Y", "start" => "2025-10-07", "end" => "2026-10-07"]);
$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/fluctuation?$q", false, $ctx);
$payload = json_decode($json, true)["data"]["GB"];
echo "Δ: {$payload["change"]}% | min: {$payload["min"]}% | max: {$payload["max"]}%";
?>
JSON response (example)
Fields:
- start_yield, end_yield: Period endpoints in percent.
- change: end_yield − start_yield in percentage points.
- min, max: Extremes within the window.
Building a GB yield curve and a GB 2s10s spread
To assemble a daily UK curve, request multiple maturities from /latest or call /curve for the entire tenor set. For cross-maturity spreads (e.g., GB 2s10s), subtract yields by tenor after fetching them together so both reflect the same market date.
| Maturity | Field path (from /latest) | Unit |
|---|---|---|
| 2Y | data.GB["2Y"].yield | Percent |
| 5Y | data.GB["5Y"].yield | Percent |
| 10Y | data.GB["10Y"].yield | Percent |
| 30Y | data.GB["30Y"].yield | Percent |
For example, GB 2s10s (in basis points) = (10Y − 2Y) × 100.
Operational details: trading days, updates, and caching
- Business days and holidays: Daily series typically include trading days; weekends and UK market holidays are absent. If you need uniform daily grids, forward-fill or reindex on your side.
- Timestamps and timezone: Dates are Y-m-d (market date). Intraday timestamps and meta timestamps are UTC ISO 8601 strings.
- Update frequency: The API returns the latest available values. For streaming-like dashboards, use /intraday on active days and /latest for end-of-day checks.
- Caching: Cache country+tenor responses by market date. If you poll often, leverage ETag-equivalent logic client-side by memoizing the last response until the date or timestamp changes.
- Error handling: Handle standard JSON errors. Common statuses include 401 (missing/invalid key), 403 (quota exceeded), 404 (no data), 422 (invalid parameter), 429 (rate limit), 500 (server error). Preserve the error.message for diagnostics.
For broader context and product navigation, start at bonds-api.com. To integrate quickly, you can also explore the MCP workspace and code snippets.
Sovereign bond fundamentals (quick refresher)
UK Gilts are government-issued debt securities. The 10-year yield is a widely watched benchmark for discount rates, macro expectations, and relative value. Analysts often examine:
- Level: The outright 10Y percent yield, used for discounting and valuation.
- Curve shape: Short vs. long maturities indicating policy stance and growth/inflation expectations.
- Spreads: GB 10Y vs. US 10Y or Bund 10Y for global relative value and FX-hedged carry trade setups.
- Volatility: Fluctuations measured via time series and fluctuation endpoints.
End-to-end examples by endpoint (recap)
Below are concise, copyable examples for all seven endpoints using GB 10Y, along with realistic JSON and field guidance. If you are building a dashboard:
- Use /latest for headline banners.
- Use /timeseries for charts and rolling metrics.
- Use /intraday for live tick panels.
- Use /curve for the term structure view.
- Use /spread for cross-country tiles.
- Use /fluctuation for performance cards.
- Use /historical for point-in-time backfills and event studies.
Authentication and getting access
All requests are GET to https://bonds-api.com/api/v1/. Provide your API key in the X-API-Key header as shown in the examples. If you don’t have a key yet, Register for Bonds API and Get started with Bonds API. You can also use the UTM link here once: Register.
Error handling reference
On failure, the API returns JSON with success=false and an error message:
- 401: Missing or invalid X-API-Key
- 403: Account quota exceeded
- 404: No data for requested country/maturity/date
- 422: Invalid parameter (e.g., date format)
- 429: Rate limit exceeded
- 500: Server error
In client code, check HTTP status and parse the JSON error to display a concise diagnostic for users. Consider retries with backoff on 429 and 500.
FAQ
How are yields expressed?
Yields are percentages (e.g., 4.52 means 4.52%). Spreads are basis points (bps). 100 bps = 1 percentage point.
What timezone are timestamps in?
Dates are market dates (Y-m-d). Timestamps such as fetched_at and meta.timestamp are ISO 8601 in UTC (e.g., 2026-10-07T12:00:00Z).
How do I handle UK market holidays and weekends?
Daily series generally exclude non-trading days. If you need continuous calendars, reindex your time series and forward-fill or leave gaps as appropriate for your analytics.
Can I build a UK curve without specifying maturities?
Yes. Use /curve for the full term structure on a given date, or /latest with maturities omitted to fetch all available GB tenors.
How do I compute a GB 2s10s spread?
Fetch both 2Y and 10Y from /latest (same date), then (10Y − 2Y) × 100 to get basis points. For cross-country 10Y spreads, use /spread.
If you are ready to integrate GB 10Y and the complete UK curve into your app, obtain your key here: Register. Explore tools and references via MCP, and see more at bonds-api.com.