Kenya Bond Yield History API

Kenya Bond Yield History API

If you need reliable Kenya sovereign bond yields in your own models and tools, this guide shows exactly how to pull current, historical, intraday, and curve data via the Bonds API. By the end, you’ll be able to query the latest KE yields, fetch time series across business days, compute US–Kenya spreads, and assemble a yield curve for analytics, dashboards, or risk engines.

What you get with the Kenya sovereign bond endpoints

Bonds-API provides normalized sovereign yield data for Kenya (ISO2: KE) across standard maturities, from money-market tenors (1M, 3M, 6M) through long bonds (30Y and beyond where available). Yields are returned as percentages (for example, 4.52 means 4.52%). Dates are calendar dates (YYYY-MM-DD). Intraday snapshots include UTC timestamps.

Illustration: Kenya Bond Yield History API

Developers typically use these endpoints to:

  • Populate financial dashboards with current KE yields and the term structure.
  • Run backtests with daily time series on chosen maturities.
  • Monitor intraday moves around auctions or macro releases.
  • Compute spreads versus benchmarks like US Treasuries at the same maturity.

All requests are GET to https://bonds-api.com/api/v1/ and authenticated using your API key in the X-API-Key header. You can explore the API and documentation directly on bonds-api.com and the MCP.

Authentication and practical data details

Authentication: include your key as X-API-Key in the request header. Example: X-API-Key: YOUR_API_KEY. Do not pass it as a query parameter in normal requests.

Yields and units:

  • Yield fields are percentages (e.g., 4.25 means 4.25%).
  • Spread fields are basis points (bps). For example, 215 means 2.15% differential.

Dates, timestamps, and timezones:

  • Daily endpoints use YYYY-MM-DD and align to the last available market day.
  • Intraday snapshots include fetched_at in ISO 8601 UTC (e.g., 2026-10-22T12:00:00Z) and a meta.timezone of UTC.

Business days and holidays: daily series typically include only business days. Holidays and weekends will show gaps. If you query a holiday date, you may receive a 404 or the latest available business date depending on the endpoint and parameters.

Caching: to respect rate limits and cut latency, cache the latest and curve endpoints for the trading day or until the next snapshot you care about. Intraday updates are point-in-time—decide a refresh cadence that matches your UI (for example, every 15 minutes).

Start building with your key: Register. You can also browse general docs at bonds-api.com.

Endpoint: Latest — current KE yields

Use /latest to fetch the most recent daily yields for one or more maturities. This is ideal for dashboards, price tickers, and daily monitoring.

cURL

curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"

Python (requests)

import requests

resp = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "KE", "maturities": "2Y,10Y"}
)
data = resp.json()
# Example usage:
# data["data"]["KE"]["10Y"]["yield"] # percentage
# data["data"]["KE"]["10Y"]["date"] # YYYY-MM-DD

JavaScript (fetch)

const url = new URL("https://bonds-api.com/api/v1/latest");
url.searchParams.set("countries", "KE");
url.searchParams.set("maturities", "2Y,10Y");

fetch(url.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(data => {
const tenY = data.data.KE["10Y"].yield; // percentage number
const tenYDate = data.data.KE["10Y"].date; // "YYYY-MM-DD"
console.log({ tenY, tenYDate });
});

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=KE&maturities=2Y,10Y";
$json = file_get_contents($url, false, $context);
$data = json_decode($json, true);
$tenY = $data["data"]["KE"]["10Y"]["yield"];
$date = $data["data"]["KE"]["10Y"]["date"];
echo "KE 10Y: $tenY% on $date\n";

Sample JSON

{
    "success": true,
    "date": "2026-10-22",
    "rates": {
        "US_10Y": 5.115
    },
    "dates": {
        "US_10Y": "2026-10-22"
    },
    "currencies": {
        "US_10Y": "USD"
    },
    "meta": {
        "request_id": "50bf87ea-9d29-441a-b0ee-f37e57fa7a02",
        "timestamp": "2026-10-22T00:04:50+00:00"
    }
}

How to read it:

  • data.KE.2Y.yield is a percentage (4.25%).
  • data.KE.10Y.date is the pricing date (YYYY-MM-DD).
  • source indicates the provenance (e.g., “official”).

Endpoint: Historical — yield on a specific date

Use /historical when you know the exact business date you need (for example, a month-end mark or auction day). If the date is not a business day, expect a 404 based on the error rules.

cURL

Python (requests)

import requests

params = {"country": "KE", "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()
# hist["yield"] is percentage
# hist["date"] is YYYY-MM-DD

JavaScript (fetch)

const params = new URLSearchParams({
country: "KE",
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, row.source);
});

PHP (file_get_contents)

<?php
$q = http_build_query(["country" => "KE", "maturity" => "10Y", "date" => "2025-06-15"]);
$ctx = 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, $ctx);
echo $json;

Sample JSON

How to read it:

  • yield is a percentage on that date.
  • country is ISO2 (KE), maturity is the tenor identifier.

Endpoint: Time series — yields between two dates

Use /timeseries for backtesting, rolling-window analytics, and charting. The response lists business days within the range.

cURL

Python (requests)

import requests

params = {
"country": "KE",
"maturity": "10Y",
"start": "2025-10-22",
"end": "2026-10-22"
}
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 }

JavaScript (fetch)

const p = new URLSearchParams({
country: "KE", maturity: "10Y", start: "2025-10-22", end: "2026-10-22"
});
fetch(`https://bonds-api.com/api/v1/timeseries?${p.toString()}`, {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(ts => {
const points = ts.series.map(d => [d.date, d.yield]);
console.log(points);
});

PHP (file_get_contents)

<?php
$q = http_build_query([
"country" => "KE",
"maturity" => "10Y",
"start" => "2025-10-22",
"end" => "2026-10-22"
]);
$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) {
// $row["date"], $row["yield"]
}

Sample JSON

How to read it: each element is a business day with yield in percent. If start or end falls on a non-trading day, the range will include the business days that exist between them.

Endpoint: Spread — KE vs benchmark

Use /spread to compare Kenya to a benchmark country at a given maturity. The result includes yields for both and the spread in basis points.

cURL

Python (requests)

import requests

params = {"country": "KE", "benchmark": "US", "maturity": "10Y"}
resp = requests.get("https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params)
spread = resp.json()
# spread["spread_bps"] is integer/float in basis points
# spread["country_yield"], spread["benchmark_yield"] are percentages

JavaScript (fetch)

const q = new URLSearchParams({ country: "KE", 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(`Spread: ${s.spread_bps} bps; KE: ${s.country_yield}%, US: ${s.benchmark_yield}%`);
});

PHP (file_get_contents)

<?php
$q = http_build_query(["country" => "KE", "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);
echo $json;

Sample JSON

How to read it:

  • spread_bps is in basis points. 215 equals 2.15%.
  • country_yield and benchmark_yield are both percentages and aligned by maturity.

Endpoint: Curve — full KE yield curve

/curve returns the latest available Kenya term structure for the day (or a specific date if provided). Useful for fitting curves, pricing models, and quick charting.

cURL

Python (requests)

import requests

resp = requests.get("https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "KE"})
curve = resp.json()
# curve["curve"] is a dict of maturity -> yield (percentage)
# curve["inverted"] is boolean for slope inversion

JavaScript (fetch)

const q = new URLSearchParams({ country: "KE" });
fetch(`https://bonds-api.com/api/v1/curve?${q.toString()}`, {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(curve => {
console.log(curve.date, curve.inverted, curve.curve);
});

PHP (file_get_contents)

<?php
$q = http_build_query(["country" => "KE"]);
$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?$q", false, $ctx);
$data = json_decode($json, true);
$tenY = $data["curve"]["10Y"] ?? null;

Sample JSON

How to read it:

  • curve is a mapping of tenor strings to yields (percentages).
  • inverted indicates if shorter maturities yield more than longer ones overall.
  • date is the business day the curve applies to.
MaturityYield (percent)
1M5.31
3M5.27
6M5.18
1Y4.98
2Y4.25
5Y4.39
10Y4.52
30Y4.71

Tip: If your dashboard asks for multiple KE maturities on one screen, you can call /curve once and cache that payload, instead of calling /latest for each maturity separately.

Endpoint: Intraday — KE yield snapshots

/intraday provides multiple yield points throughout a given UTC day. Use it to capture market color around events or to render intraday charts.

cURL

Python (requests)

import requests

params = {"country": "KE", "maturity": "10Y", "date": "2026-10-22"}
resp = requests.get("https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params)
intraday = resp.json()
# intraday["snapshots"] = list of { "yield": float, "fetched_at": ISO-UTC, "source": str }
# intraday["meta"]["timezone"] = "UTC"

JavaScript (fetch)

const p = new URLSearchParams({ country: "KE", maturity: "10Y", date: "2026-10-22" });
fetch(`https://bonds-api.com/api/v1/intraday?${p.toString()}`, {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(intra => {
intra.snapshots.forEach(s => console.log(s.fetched_at, s.yield));
});

PHP (file_get_contents)

<?php
$q = http_build_query(["country" => "KE", "maturity" => "10Y", "date" => "2026-10-22"]);
$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);
echo $json;

Sample JSON

How to read it: each snapshot has a yield in percent and a UTC timestamp. Use count to validate completeness versus your expected polling cadence.

Endpoint: Fluctuation — change, min, max over a period

/fluctuation aggregates a period’s start, end, net change, minimum, and maximum yield for each requested country. This is handy for performance summaries or alerting.

cURL

Python (requests)

import requests

params = {
"countries": "KE", "maturity": "10Y", "start": "2025-10-22", "end": "2026-10-22"
}
resp = requests.get("https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
fl = resp.json()
# fl["data"]["KE"]["change"] is end_yield - start_yield (percentage points)
# min/max are the observed extrema within [start, end]

JavaScript (fetch)

const search = new URLSearchParams({
countries: "KE", maturity: "10Y", start: "2025-10-22", end: "2026-10-22"
});
fetch(`https://bonds-api.com/api/v1/fluctuation?${search.toString()}`, {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(fl => {
const k = fl.data.KE;
console.log({ start: k.start_yield, end: k.end_yield, change: k.change, min: k.min, max: k.max });
});

PHP (file_get_contents)

<?php
$q = http_build_query([
"countries" => "KE",
"maturity" => "10Y",
"start" => "2025-10-22",
"end" => "2026-10-22"
]);
$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);
echo $json;

Sample JSON

How to read it:

  • start_yield/end_yield are percentages at the endpoints.
  • change is in percentage points (not bps).
  • min and max are the observed bounds during the window.

Error handling: status and messages

All endpoints share a standard error shape with success=false and error=message string. Typical HTTP statuses:

  • 401: Missing or invalid X-API-Key
  • 403: Account quota exceeded
  • 404: No data for requested country/maturity/date
  • 422: Invalid parameter (date format, ISO2 code, etc.)
  • 429: Rate limit exceeded
  • 500: Server error

In clients, always check success and handle 4xx/5xx by backing off or prompting the user to adjust parameters. For 404 on non-business dates, consider a fallback to the most recent business day in your application logic if that fits your UX.

Building a Kenya yield curve and spreads in practice

Two common tasks are rendering a full curve and computing spreads:

  • Curve: call /curve once per business day and cache the payload. Use the inverted flag to trigger a different chart color or risk alert.
  • Spreads: for US vs KE, call /spread with benchmark=US at the target maturity. Store both country_yield and benchmark_yield if you need to display each leg.

For multi-maturity tiles, /curve is more efficient than calling /latest repeatedly. For a single-maturity tile that refreshes more frequently intraday, consider mixing /latest (daily) with /intraday (during market hours), merging the most recent intraday tick into the day’s display.

Kenya sovereign bonds: fundamentals for readers

Kenya government bonds and T-bills are debt instruments issued by the Kenyan Treasury. The yield represents the annualized return implied by prevailing prices and is a core input for discounting cash flows, risk models, and macro research. Short-end yields are typically influenced by central bank liquidity operations and policy rates; long-end yields reflect inflation expectations, term premia, and country risk.

Official live sample block

Below is an official live sample that returns a different schema and shows a query parameter for the API key. Keep in mind that the Kenya-focused endpoints above should be called with the X-API-Key header and use the response formats shown in each section.

How to read it: rates holds the 10Y percentage (5.115), date and dates provide pricing dates, currencies indicates quote currency context (USD), and meta.timestamp is an ISO 8601 UTC string. For Kenya usage, follow the KE examples above.

Use cases that ship

  • Financial dashboards: display KE 2Y, 5Y, 10Y, and 30Y tiles with /latest and /curve, updating daily and highlighting inversion.
  • Portfolio risk tools: backtest duration and carry strategies with /timeseries and summarize recent changes using /fluctuation.
  • Economic research: track policy transmission by comparing 3M vs 1Y vs 10Y shifts and compute KE–US differentials with /spread.
  • Trading analytics: overlay intraday snapshots from /intraday around local auctions, then reconcile with the end-of-day mark from /latest or /curve.

Explore endpoints and schemas on bonds-api.com and test live calls in the MCP. When you’re ready to integrate, Register for an API key.

FAQ

How are yields expressed, and what does spread_bps mean?
All yield fields are percentages. A value of 4.52 means 4.52%. Spreads are in basis points (bps), so 215 bps equals 2.15 percentage points.

What timezone should I assume for dates and timestamps?
Daily dates are YYYY-MM-DD with no time component. Intraday snapshots include fetched_at in UTC (e.g., 2026-10-22T12:00:00Z) and meta.timezone is UTC.

How do I handle holidays and missing days in time series?
Expect gaps on weekends and market holidays. Your charting or backtesting code should work with business-day sequences. For specific-date queries on non-business days, handle 404 by prompting the user to choose the nearest business date if appropriate.

Can I request multiple maturities at once?
Yes. For the latest daily levels, either specify maturities in /latest or retrieve all standard tenors with /curve for the country. Use /curve for an entire term structure in one call.

How often should I refresh?
For end-of-day displays, fetch /latest or /curve once per day and cache. For intraday monitoring, call /intraday on your required cadence (for example, every 15 minutes) and throttle by caching to avoid unnecessary duplicate requests.

Build your Kenya fixed-income analytics with production-ready endpoints today. Get an API key and start integrating: Register. If you prefer to explore interactively, visit the MCP or browse bonds-api.com.

Start building with bond data today

Get your API key and access sovereign bond yields across 60+ countries. 7-day free trial, no credit card required.