You need reliable, machine-readable access to the Colombia 10-year sovereign bond yield for dashboards, models, and research. By the end of this article you’ll be able to query, cache, and interpret the 10Y yield for Colombia (and build a full Colombian curve), compute US–Colombia spreads, stream intraday snapshots, and retrieve historical/time-series data from the Bonds API, all with copy-pasteable code.
What the API returns and how to read it
Bonds API delivers sovereign bond yields as JSON over HTTPS. Yields are expressed in percentage terms (for example 4.52 means 4.52%, not 0.0452). Where spreads are returned, spread_bps is in basis points (1 bp = 0.01%). Dates in daily endpoints use Y-m-d (for example 2026-10-12). Intraday snapshots include fetched_at timestamps in ISO 8601 with timezone (Z = UTC). All endpoints use GET and the X-API-Key header.
- Base URL: https://bonds-api.com/api/v1/
- Auth: add header X-API-Key: YOUR_API_KEY
- Coverage: 60+ countries, maturities from 1M to 50Y
Throughout this guide we focus on Colombia (ISO2: CO), emphasizing the 10Y point and how to assemble a Colombia curve for analytics. Visit bonds-api.com to learn more, and use the Register link when you are ready to obtain your API key.
Quick catalog note: official sample blocks
The following two official sample blocks must be included verbatim. They demonstrate a basic latest-yield request using a catalog sibling. You can copy and run them as-is to validate connectivity and response parsing.
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
{
"success": true,
"date": "2026-10-09",
"rates": {
"US_10Y": 5.24
},
"dates": {
"US_10Y": "2026-10-09"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "5c6fe4af-fe10-4b8c-ab8b-d22b7f94aec6",
"timestamp": "2026-10-12T00:04:43+00:00"
}
}
Current Colombia yields with /latest
Use /latest to fetch the most recent daily close for one or more Colombian maturities. This is your entry point for the Colombia 10Y benchmark and for building real-time dashboards where you refresh at market close or on a schedule.
cURL
JSON response (fields and units)
How to read:
- yield: percentage, for example 4.52 = 4.52%.
- date: business date (Y-m-d) for which the yield applies.
- source: origin of the quote (for example “official”).
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "CO", "maturities": "2Y,10Y"}
)
data = resp.json()
co_10y = data["data"]["CO"]["10Y"]["yield"]
co_10y_date = data["data"]["CO"]["10Y"]["date"]
print("CO 10Y:", co_10y, "on", co_10y_date)
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/latest");
url.searchParams.set("countries", "CO");
url.searchParams.set("maturities", "2Y,10Y");
fetch(url.toString(), {
method: "GET",
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(j => {
const y = j.data.CO["10Y"].yield;
const d = j.data.CO["10Y"].date;
console.log(`CO 10Y: ${y}% on ${d}`);
});
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=CO&maturities=2Y,10Y";
$json = file_get_contents($url, false, $context);
$data = json_decode($json, true);
$yield = $data["data"]["CO"]["10Y"]["yield"];
$date = $data["data"]["CO"]["10Y"]["date"];
echo "CO 10Y: $yield% on $date\n";
Point-in-time yield with /historical
Use /historical to retrieve the Colombia 10Y yield for a specific business date. This is ideal when backfilling or reconciling on as-of dates.
cURL
JSON response
Fields:
- yield: percentage for the specified Y-m-d.
- source: quote provenance (for example “official”).
Python
import requests
params = {"country": "CO", "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)
j = r.json()
print(j["country"], j["maturity"], j["yield"], j["date"])
JavaScript
const p = new URLSearchParams({
country: "CO",
maturity: "10Y",
date: "2025-06-15"
});
fetch("https://bonds-api.com/api/v1/historical?" + p.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(j => console.log(`${j.country} ${j.maturity} = ${j.yield}% on ${j.date}`));
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' => 'CO', 'maturity' => '10Y', 'date' => '2025-06-15']
]);
$j = json_decode($res->getBody(), true);
echo $j['yield'];
Daily time series with /timeseries
Use /timeseries for a continuous range to power charts, backtests, or volatility studies on the Colombia 10Y.
cURL
JSON response
Each point is the daily close yield in percent for a business day between start and end. Non-trading days (weekends, market holidays) are omitted.
Python
import requests, pandas as pd
params = {"country": "CO", "maturity": "10Y", "start": "2025-10-12", "end": "2026-10-12"}
r = requests.get("https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params)
j = r.json()
df = pd.DataFrame(j["series"]) # columns: date (Y-m-d), yield (percent)
print(df.head())
JavaScript
const url = new URL("https://bonds-api.com/api/v1/timeseries");
url.searchParams.set("country", "CO");
url.searchParams.set("maturity", "10Y");
url.searchParams.set("start", "2025-10-12");
url.searchParams.set("end", "2026-10-12");
const headers = { "X-API-Key": "YOUR_API_KEY" };
const res = await fetch(url, { headers });
const j = await res.json();
const latest = j.series[j.series.length - 1];
console.log(`Latest CO 10Y: ${latest.yield}% on ${latest.date}`);
PHP
<?php
$q = http_build_query([
'country' => 'CO', 'maturity' => '10Y',
'start' => '2025-10-12', 'end' => '2026-10-12'
]);
$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);
echo count($data['series']);
US–Colombia spread with /spread
/spread computes the yield differential between Colombia and a benchmark (for example US Treasuries) at a given maturity (default: 10Y). The result is in basis points, making it easy to compare risk premia.
cURL
JSON response
How to use:
- spread_bps: difference in bps (215 bps = 2.15%).
- country_yield and benchmark_yield: both in percent.
Python
import requests
p = {"country": "CO", "benchmark": "US", "maturity": "10Y"}
r = requests.get("https://bonds-api.com/api/v1/spread", headers={"X-API-Key": "YOUR_API_KEY"}, params=p)
j = r.json()
print(f"CO–US 10Y spread: {j['spread_bps']} bps (CO {j['country_yield']}% vs US {j['benchmark_yield']}%)")
JavaScript
const p = new URLSearchParams({ country: "CO", benchmark: "US", maturity: "10Y" });
const resp = await fetch("https://bonds-api.com/api/v1/spread?" + p.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
});
const j = await resp.json();
console.log(`CO–US 10Y spread: ${j.spread_bps} bps`);
PHP
<?php
$ctx = stream_context_create(['http' => ['header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
$q = http_build_query(['country' => 'CO', 'benchmark' => 'US', 'maturity' => '10Y']);
$j = json_decode(file_get_contents("https://bonds-api.com/api/v1/spread?$q", false, $ctx), true);
echo $j['spread_bps'];
Full Colombia curve with /curve
/curve returns a snapshot across available maturities for Colombia. Use this to construct a yield curve, price bonds, or compute term premia.
cURL
JSON response
Fields:
- date: business date of the curve.
- inverted: boolean indicating if the curve is inverted (short > long).
- curve: maturity-to-yield map, yields in percent.
| Maturity | Yield (%) |
|---|---|
| 1M | 5.31 |
| 3M | 5.27 |
| 6M | 5.18 |
| 1Y | 4.98 |
| 2Y | 4.25 |
| 5Y | 4.39 |
| 10Y | 4.52 |
| 30Y | 4.71 |
Python
import requests
r = requests.get("https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "CO"})
j = r.json()
tenor_order = ["1M","3M","6M","1Y","2Y","5Y","10Y","30Y"]
curve = [(t, j["curve"][t]) for t in tenor_order if t in j["curve"]]
print("CO curve on", j["date"], "inverted:", j["inverted"])
for t, y in curve:
print(t, y)
JavaScript
const res = await fetch("https://bonds-api.com/api/v1/curve?country=CO", {
headers: { "X-API-Key": "YOUR_API_KEY" }
});
const j = await res.json();
console.log(`Curve date ${j.date}, inverted=${j.inverted}, 10Y=${j.curve["10Y"]}%`);
PHP
<?php
$ctx = stream_context_create(['http' => ['header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
$j = json_decode(file_get_contents("https://bonds-api.com/api/v1/curve?country=CO", false, $ctx), true);
echo "10Y=" . $j['curve']['10Y'] . "% on " . $j['date'];
Intraday snapshots with /intraday
If you need within-day updates for the Colombia 10Y, /intraday returns multiple snapshots for a given date. Each snapshot has fetched_at in UTC.
cURL
JSON response
Fields:
- snapshots[].yield: percentage at that timestamp.
- snapshots[].fetched_at: ISO 8601 UTC timestamp.
- count: number of snapshots for the day.
Python
import requests, statistics
p = {"country": "CO", "maturity": "10Y", "date": "2026-10-12"}
r = requests.get("https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"},
params=p)
j = r.json()
vals = [s["yield"] for s in j["snapshots"]]
print("Intraday CO 10Y mean:", statistics.mean(vals))
JavaScript
const params = new URLSearchParams({ country: "CO", maturity: "10Y", date: "2026-10-12" });
const r = await fetch("https://bonds-api.com/api/v1/intraday?" + params, {
headers: { "X-API-Key": "YOUR_API_KEY" }
});
const j = await r.json();
console.log(`Snapshots: ${j.count}, first at ${j.snapshots[0].fetched_at}`);
PHP
<?php
$q = http_build_query(['country' => 'CO', 'maturity' => '10Y', 'date' => '2026-10-12']);
$ctx = stream_context_create(['http' => ['header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
$j = json_decode(file_get_contents("https://bonds-api.com/api/v1/intraday?$q", false, $ctx), true);
echo $j['snapshots'][0]['yield'] . " at " . $j['snapshots'][0]['fetched_at'];
Period change and extremes with /fluctuation
/fluctuation summarizes the start, end, change, min, and max yields over a date range. This is useful for reporting and risk summaries.
cURL
JSON response
All yields are percentages. change is end_yield − start_yield in percentage points.
Python
import requests
p = {"countries": "CO", "maturity": "10Y", "start": "2025-10-12", "end": "2026-10-12"}
j = requests.get("https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"}, params=p).json()
stats = j["data"]["CO"]
print("Δ", stats["change"], "pp, range [", stats["min"], ",", stats["max"], "]")
JavaScript
const p = new URLSearchParams({
countries: "CO", maturity: "10Y", start: "2025-10-12", end: "2026-10-12"
});
const r = await fetch("https://bonds-api.com/api/v1/fluctuation?" + p, {
headers: { "X-API-Key": "YOUR_API_KEY" }
});
const j = await r.json();
console.log(`Change: ${j.data.CO.change} pp; Max: ${j.data.CO.max}%`);
PHP
<?php
$q = http_build_query(['countries' => 'CO', 'maturity' => '10Y', 'start' => '2025-10-12', 'end' => '2026-10-12']);
$ctx = stream_context_create(['http' => ['header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
$j = json_decode(file_get_contents("https://bonds-api.com/api/v1/fluctuation?$q", false, $ctx), true);
echo "Start: {$j['data']['CO']['start_yield']}%, End: {$j['data']['CO']['end_yield']}%";
Operational considerations: business days, holidays, updates, and caching
Bonds API daily endpoints reflect business-day closes. Weekends and Colombian market holidays will have no new observations; time-series simply skip those dates. Intraday snapshots have multiple UTC timestamps over the requested day.
- Update cadence: use /latest for the most recent close; use /intraday if you need within-day snapshots and monitor count to see arrivals.
- Timezones: date fields are business dates; intraday fetched_at timestamps are UTC. Normalize to your app’s timezone for display.
- Caching: cache stable daily endpoints by country+maturity+date. You can apply HTTP-level caching (for example, conditional GETs in your client) and short-lived memory caches for /latest to reduce redundant calls.
- Error handling: inspect success=false responses and HTTP status. Common statuses include 401 (missing/invalid API key), 404 (no data for the requested combination), 422 (invalid parameters), and 429 (rate limit exceeded). Retry with backoff where appropriate and do not hammer on error.
When building a Colombia curve, prefer /curve for a coherent same-day snapshot. If you must stitch from /latest, pass maturities as a comma-separated list in one call to ensure a consistent timestamp across points. See bonds-api.com for documentation and latency guidance. You can also explore endpoints interactively via the MCP.
Practical analytics for the Colombia 10Y
- Dashboards: poll /latest to display the CO 10Y and curve slope (for example 2s10s = 10Y − 2Y) with color-coded inversion from /curve.inverted.
- Risk: track /fluctuation weekly to summarize changes and extremes; trigger alerts if min/max thresholds breached.
- Relative value: compute /spread to the US 10Y in basis points for EM risk premia and hedging analysis.
- Backtests: use /timeseries to compute realized volatility and Sharpe-like measures on duration-hedged strategies.
- Data hygiene: for as-of recon, rely on /historical for exact dates and persist source fields alongside yields.
Common error responses (shape and handling)
On errors the API returns success=false with an error message. Typical HTTP statuses:
- 401: Missing or invalid X-API-Key. Ensure the header is present: X-API-Key: YOUR_API_KEY.
- 403: Account quota exceeded. Reduce call frequency; implement caching and aggregation.
- 404: No data for the requested country/maturity/date. Validate ISO2, maturity code, or try an adjacent business date.
- 422: Invalid parameter (for example wrong date format). Use Y-m-d dates and valid maturities like 10Y.
- 429: Rate limit exceeded. Backoff with jitter and consolidate requests (for example batch maturities).
- 500: Server error. Retry with exponential backoff.
Sovereign bond fundamentals in one minute
Sovereign yields reflect the borrowing cost of a government by maturity. The 10-year point is the most referenced benchmark for macro expectations and discount rates. Curves normally slope upward; inversions can signal growth or policy shifts. In spread space, Colombia’s 10Y vs US 10Y in bps is a compact measure of relative risk and policy divergence.
End-to-end example: building a Colombia curve and computing a 2s10s slope
Python
import requests
hdr = {"X-API-Key": "YOUR_API_KEY"}
curve = requests.get("https://bonds-api.com/api/v1/curve",
headers=hdr, params={"country": "CO"}).json()
y2 = curve["curve"].get("2Y")
y10 = curve["curve"].get("10Y")
slope_2s10s = y10 - y2 if y2 is not None and y10 is not None else None
print("Date:", curve["date"], "Inverted:", curve["inverted"], "2s10s:", slope_2s10s)
Troubleshooting and reliability tips
- Batch maturities: when using /latest, pass multiple maturities at once to avoid mixed dates across separate requests.
- Holiday gaps: when creating charts, align by business dates and do not assume daily continuity over weekends/holidays.
- Intraday smoothing: average or median snapshots from /intraday if your UI prefers one mid-session value.
- Graceful degradation: if /intraday is unavailable, fall back to /latest for the prior close with a visual indicator.
FAQ
Q: Are yields percentages or decimals?
A: Percentages. For example, 4.52 means 4.52%.
Q: What timezone are timestamps in?
A: Daily dates use Y-m-d (business dates). Intraday fetched_at timestamps are in UTC (Z).
Q: How do I compute a spread to US Treasuries?
A: Use /spread with country=CO, benchmark=US, maturity=10Y. The result spread_bps is in basis points.
Q: How can I get a coherent Colombia curve snapshot?
A: Use /curve with country=CO. It returns a same-day, multi-tenor map with an inverted flag.
Q: What happens on weekends or Colombian holidays?
A: No new daily observations are added; /timeseries omits non-trading days. Your charts should handle irregular spacing.
Build your Colombia 10Y analytics, spreads, and curves in minutes with these endpoints. Explore interactively via the MCP, and Register to get your API key. You can also Get started with Bonds API and find more endpoint details on bonds-api.com.