You need programmatic access to the Indonesia 10-year government bond yield for models, dashboards, and risk tools. By the end of this article, you’ll be able to fetch the latest Indonesia 10Y yield, query historical and intraday data, calculate spreads to benchmarks, and pull a full Indonesia curve—using concise GET requests from the Bonds API.
Why the Indonesia 10Y yield matters and what you’ll build
The Indonesia 10-year (10Y) sovereign yield is a widely referenced tenor for pricing local-currency borrowing, computing term premia, and monitoring macro risk. In practice, you will often need:
- Latest Indonesia 10Y yield in percent for your UI or alerting system.
- Historical and intraday points to analyze trend, volatility, and liquidity.
- Yield spread to a benchmark (e.g., US 10Y) in basis points.
- Full Indonesia curve for multi-tenor modeling and interpolation.
The examples below use only documented endpoints and fields, with yields expressed as percentages and spreads in basis points. Dates are YYYY-MM-DD; timestamps are ISO-8601 in UTC where present. Visit bonds-api.com for documentation and coverage details, and Bonds API for broader product information.
Important note on the sample block below
The following official sample must be included verbatim. It uses a US 10Y request and a different response shape than the standard Bonds API endpoints shown later in this article.
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
{
"success": true,
"date": "2026-10-16",
"rates": {
"US_10Y": 5.09
},
"dates": {
"US_10Y": "2026-10-16"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "6c5e40d1-1765-434e-bbf4-1fb4c85426cb",
"timestamp": "2026-10-17T00:06:33+00:00"
}
}
How to read it:
- rates.US_10Y: The US 10Y yield as a percentage (5.09 means 5.09%).
- date and dates.US_10Y: The valuation date(s) in YYYY-MM-DD.
- currencies.US_10Y: The yield’s reference currency (USD in this sample).
- meta.timestamp: ISO-8601 timestamp (UTC) for when this payload was generated.
Data model, units, dates, and timezones
Across the endpoints below, yields are returned as numeric percentages (e.g., 4.52 means 4.52%). Spreads are reported in basis points (1 bp = 0.01%). Dates use YYYY-MM-DD. When intraday timestamps are included, they are ISO-8601 in UTC (e.g., 2026-10-17T12:00:00Z). If a requested date is a weekend or market holiday, the API will return the most recent business day with available data when using “latest” or raise a 404 for historical if that exact calendar date has no data.
All requests use GET and authenticate with the X-API-Key header. Base URL for endpoints is https://bonds-api.com/api/v1/. For interactive exploration, you can also visit the MCP. To obtain your key, use the call to action at the end of this post.
Fetch the latest Indonesia yields (multiple maturities)
Use /latest to pull the current 10Y, or several tenors at once for a quick curve snapshot. For Indonesia, the ISO2 is ID. The maturities parameter accepts a comma-separated list (e.g., 2Y,10Y). Omit maturities to fetch all available.
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "ID", "maturities": "2Y,10Y"}
)
data = resp.json()
# Example: data["data"]["ID"]["10Y"]["yield"] is a percentage
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/latest");
url.searchParams.set("countries", "ID");
url.searchParams.set("maturities", "2Y,10Y");
fetch(url.toString(), {
method: "GET",
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(json => {
const id10y = json.data.ID["10Y"].yield; // percentage
const asOf = json.data.ID["10Y"].date; // YYYY-MM-DD
console.log("ID 10Y:", id10y, "as of", asOf);
});
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=ID&maturities=2Y,10Y";
$response = file_get_contents($url, false, $context);
$json = json_decode($response, true);
$id10y = $json["data"]["ID"]["10Y"]["yield"]; // percentage
?>
JSON response (fields and units)
Interpretation:
- yield: Percentage (4.52 means 4.52%).
- date: Valuation date (YYYY-MM-DD) for that tenor.
- source: Origin of the data (e.g., official).
Get Indonesia 10Y on a specific date
Use /historical when you need the yield for a fixed calendar date (e.g., for backtesting). If the exact date has no record (holiday/weekend), expect a 404 error rather than an auto-roll.
cURL
Python (requests)
import requests
params = {"country": "ID", "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
)
j = resp.json()
# j["yield"] is a percentage for 2025-06-15 if available
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/historical");
url.searchParams.set("country", "ID");
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(json => {
console.log("ID 10Y on", json.date, "=", json.yield);
});
PHP
<?php
$u = "https://bonds-api.com/api/v1/historical?country=ID&maturity=10Y&date=2025-06-15";
$context = stream_context_create([
"http" => ["method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n"]
]);
$resp = file_get_contents($u, false, $context);
$j = json_decode($resp, true);
// $j["yield"] is percentage on the requested date
?>
JSON response
Fields:
- yield: Percentage on the requested date.
- country, maturity, date: Echo of your request.
Time series for the Indonesia 10Y
Use /timeseries to retrieve daily observations across a date range. The API returns business-day points; gaps may reflect weekends or market holidays.
cURL
Python (requests)
import requests
params = {
"country": "ID",
"maturity": "10Y",
"start": "2025-10-17",
"end": "2026-10-17"
}
resp = requests.get(
"https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params
)
series = resp.json()["series"]
# series: list of { "date": "YYYY-MM-DD", "yield": percentage }
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/timeseries");
url.searchParams.set("country", "ID");
url.searchParams.set("maturity", "10Y");
url.searchParams.set("start", "2025-10-17");
url.searchParams.set("end", "2026-10-17");
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(json => {
json.series.forEach(pt => {
// pt.yield is a percentage
// pt.date is YYYY-MM-DD
});
});
PHP
<?php
$q = http_build_query([
"country" => "ID",
"maturity" => "10Y",
"start" => "2025-10-17",
"end" => "2026-10-17"
]);
$url = "https://bonds-api.com/api/v1/timeseries?$q";
$ctx = stream_context_create([
"http" => [ "method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n" ]
]);
$resp = file_get_contents($url, false, $ctx);
$json = json_decode($resp, true);
$series = $json["series"];
?>
JSON response
Each element contains date (YYYY-MM-DD) and a yield in percent. Use this list to compute returns, volatilities, and rolling analytics.
Spread vs. a benchmark (basis points)
The /spread endpoint returns the 10Y spread to a benchmark (e.g., US). The spread is in basis points (bps). 1 bp = 0.01%, so a spread_bps of 215 means 2.15%.
cURL
Python (requests)
import requests
params = {"country": "ID", "benchmark": "US", "maturity": "10Y"}
resp = requests.get(
"https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params
)
s = resp.json()
# s["spread_bps"]: integer/float in basis points
# s["country_yield"], s["benchmark_yield"]: percentages
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/spread");
url.searchParams.set("country", "ID");
url.searchParams.set("benchmark", "US");
url.searchParams.set("maturity", "10Y");
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(json => {
console.log("Spread (bps):", json.spread_bps);
});
PHP
<?php
$url = "https://bonds-api.com/api/v1/spread?country=ID&benchmark=US&maturity=10Y";
$ctx = stream_context_create([
"http" => [ "method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n" ]
]);
$resp = file_get_contents($url, false, $ctx);
$j = json_decode($resp, true);
// $j["spread_bps"] is in basis points
?>
JSON response
Use spread_bps for display and alerts, and country_yield/benchmark_yield for more detailed analytics. All yields shown are percentages.
Full Indonesia yield curve
To build a curve for curve-fitting or interpolation, use /curve. If you omit date, the latest available day with data is returned. The response indicates whether the curve is inverted.
cURL
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "ID"}
)
curve = resp.json()
# curve["curve"] is a map of tenor -> percentage yield, e.g. "10Y": 4.52
# curve["inverted"] is a boolean
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/curve");
url.searchParams.set("country", "ID");
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(json => {
const tenors = Object.keys(json.curve);
tenors.sort((a, b) => a.length - b.length);
console.log("Curve date:", json.date, "inverted:", json.inverted);
});
PHP
<?php
$url = "https://bonds-api.com/api/v1/curve?country=ID";
$ctx = stream_context_create([
"http" => [ "method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n" ]
]);
$resp = file_get_contents($url, false, $ctx);
$j = json_decode($resp, true);
// $j["curve"] is an associative array: tenor => percentage yield
?>
JSON response
All values in the curve object are percentages. inverted=true indicates a downward-sloping curve from shorter to longer maturities.
Intraday snapshots for Indonesia 10Y
Use /intraday to view yield snapshots across the trading session for a given date. This is useful for liquidity analysis and to validate execution timing.
cURL
Python (requests)
import requests
params = {"country": "ID", "maturity": "10Y", "date": "2026-10-17"}
resp = requests.get(
"https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params
)
snapshots = resp.json()["snapshots"]
# Each snapshot: { "yield": percentage, "fetched_at": ISO-8601 UTC, "source": "market" }
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/intraday");
url.searchParams.set("country", "ID");
url.searchParams.set("maturity", "10Y");
url.searchParams.set("date", "2026-10-17");
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(json => {
console.log("Count:", json.count, "TZ:", json.meta.timezone);
json.snapshots.forEach(s => {
// s.yield is percentage; s.fetched_at is ISO-8601 UTC
});
});
PHP
<?php
$url = "https://bonds-api.com/api/v1/intraday?country=ID&maturity=10Y&date=2026-10-17";
$ctx = stream_context_create([
"http" => [ "method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n" ]
]);
$resp = file_get_contents($url, false, $ctx);
$j = json_decode($resp, true);
// $j["snapshots"]: array of intraday points with UTC timestamps
?>
JSON response
Use fetched_at to align snapshots with trade events. timezone indicates all timestamps are in UTC.
Fluctuation, min, and max over a period
The /fluctuation endpoint summarizes change and range over a window, which is ideal for dashboards and risk overviews.
cURL
Python (requests)
import requests
params = {
"countries": "ID", "maturity": "10Y",
"start": "2025-10-17", "end": "2026-10-17"
}
resp = requests.get(
"https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params
)
f = resp.json()["data"]["ID"]
# f has start_yield, end_yield (percentages), change (absolute pct-pts), min, max
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/fluctuation");
url.searchParams.set("countries", "ID");
url.searchParams.set("maturity", "10Y");
url.searchParams.set("start", "2025-10-17");
url.searchParams.set("end", "2026-10-17");
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(json => {
const f = json.data.ID;
console.log("Δ (pct-pts):", f.change, "min:", f.min, "max:", f.max);
});
PHP
<?php
$url = "https://bonds-api.com/api/v1/fluctuation?countries=ID&maturity=10Y&start=2025-10-17&end=2026-10-17";
$ctx = stream_context_create([
"http" => [ "method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n" ]
]);
$resp = file_get_contents($url, false, $ctx);
$j = json_decode($resp, true);
$f = $j["data"]["ID"];
// $f["change"] is absolute change in percentage points across the period
?>
JSON response
All yields and the change field are in percentage points. For example, change of 0.31 means 31 bps increase.
Handling updates, business days, and caching
Update frequency: Latest and intraday endpoints reflect updates as source markets publish. Historical and timeseries provide business-day closes or end-of-day snapshots. Market holidays and weekends will produce gaps in timeseries; historical queries for non-business dates may return 404.
Caching: For production dashboards, cache /latest and /curve for a few minutes, and intraday snapshots for shorter intervals if you poll. Timeseries and historical responses are stable and good candidates for longer cache lifetimes. Use ETag or your own memoization to reduce 429 rate-limiting risk.
Error handling: Common errors include 401 (invalid or missing key), 403 (quota exceeded), 404 (no data for requested combination), 422 (invalid parameter), 429 (rate limit), and 500 (server error). Always branch on success=false and the error field before processing payloads.
Building a yield curve and spreads programmatically
There are two practical approaches to a curve:
- Use /curve for a ready-to-plot map of tenors to yields and the inverted flag.
- Use /latest with maturities=1M,3M,6M,1Y,2Y,5Y,10Y,30Y to assemble your own structure when you want explicit tenor selection. This also makes it easy to mix cross-country symbols for comparative dashboards.
For spreads, /spread gives you spread_bps directly. If you need custom basis (e.g., Indonesia 10Y minus Indonesia 2Y), fetch both via /latest or /curve and compute the difference in percentage points, then multiply by 100 to express in bps.
Sovereign bond basics for integration
Sovereign yields are quoted in percent and vary by maturity. Shorter maturities (e.g., 3M, 1Y) often track policy expectations, while long maturities (e.g., 10Y, 30Y) embed term premia and risk perceptions. For Indonesia, monitoring the 10Y alongside 2Y and 5Y provides insight into curve shifts—bull/bear steepening and inversion episodes. Use timeseries to track shifts across cycles and /intraday to measure event-day volatility.
Real-world use cases
- Risk dashboards: Pull /latest for 10Y, /spread vs. US, and /fluctuation week-to-date.
- Portfolio analytics: Use /curve to reprice local fixed-income holdings and measure key-rate durations per tenor.
- Macro research: Combine /timeseries and /intraday to analyze monetary policy impact and market reactions on release days.
- Developer workflows: Automate EOD data pipelines with /historical and /timeseries for consistent backtests.
Explore the API and schema directly on bonds-api.com, or test requests interactively in the MCP.
FAQ
How are yields and spreads expressed?
Yields are percentages (e.g., 4.52), not decimals. Spreads from /spread are in basis points (bps). To convert percentage-point differences to bps, multiply by 100.
What time zone are timestamps in?
Intraday fetched_at and meta.timestamp fields are ISO-8601 UTC. Dates (YYYY-MM-DD) are valuation dates without time components.
What happens on weekends or Indonesia market holidays?
/latest returns the most recent available business day. /historical for a weekend/holiday date may return a 404. /timeseries will show gaps corresponding to non-trading days.
Can I request multiple maturities at once?
Yes, use /latest with the maturities parameter (comma-separated). Alternatively, /curve returns a full map of available Indonesia tenors for a given date.
How should I cache or rate-limit?
Cache stable endpoints (historical/timeseries) longer. Cache latest/curve briefly (e.g., minutes). Handle 429 by backing off and retrying. Always check success and error fields.
Ready to integrate Indonesia 10Y yields into your tools? Get an API key and start calling these endpoints in minutes: Register. Then explore, test, and iterate in the MCP.