Building a historical Indonesia yield series requires more than storing numbers: you need a consistent maturity, observation dates, units, and a policy for missing market days. This guide shows how to work with the documented Bonds API endpoints, interpret yield curves and spreads, and identify an important coverage and authentication discrepancy before relying on the data in production.
Indonesia yield data and API coverage
An Indonesian sovereign bond is a government debt instrument. Its yield summarizes the return implied by its price and cash flows; changes in yields affect bond valuations and provide inputs to portfolio risk, market dashboards, and economic research.
The supplied endpoint reference uses Indonesia’s ISO2 code, ID, in examples for all seven endpoints. However, the supplied live sample states that Indonesia is not in the published catalog and instead returns a US observation. Treat Indonesia coverage as unconfirmed: verify it with Bonds API before building a production dependency.
The Indonesia responses below reproduce the reference examples; they are not evidence of a successful live Indonesia request. Available maturities can vary by country and date. The product reference describes coverage ranging from one-month bills to 50-year bonds, not a guarantee that every maturity exists for Indonesia.
Read the supplied live response
The following is the supplied live request and response. It is a US 10-year observation, not an Indonesia yield, and its response structure differs from the Indonesia reference examples 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-12-01",
"rates": {
"US_10Y": 4.954
},
"dates": {
"US_10Y": "2026-12-01"
},
"currencies": {
"US_10Y": "USD"
},
"sources": {
"US_10Y": "worldgovbonds"
},
"updated_at": {
"US_10Y": "2026-12-01T00:02:05+00:00"
},
"changes": {
"US_10Y": {
"previous_close": 4.93,
"daily": {
"date": "2026-11-30",
"bps": 2.4,
"pct": 0.49
},
"weekly": {
"date": "2026-11-24",
"bps": 4.4,
"pct": 0.9
},
"monthly": {
"date": "2026-10-30",
"bps": 1.4,
"pct": 0.28
},
"annual": {
"date": "2025-12-01",
"bps": 86.4,
"pct": 21.12
}
}
},
"meta": {
"request_id": "bf46e4c4-17bd-4f9f-86d6-54e101cf57b7",
"timestamp": "2026-12-01T00:07:37+00:00"
}
}
The rate is expressed as a percentage, not as a decimal fraction. A basis point is one hundredth of a percentage point. In this response, dates identifies the observation date, updated_at records an update timestamp, and meta.timestamp records a response timestamp; +00:00 denotes UTC. The currency field describes the sample instrument, while sources identifies its source.
Authentication requires confirmation. The endpoint reference specifies the X-API-Key header only, but the supplied live request puts the key in a query parameter. Query strings can be exposed in logs and browser history. Confirm the supported contract with Bonds API and prefer the documented header before using a real key; the live sample is shown as supplied rather than presented as a recommended credential-handling pattern.
This Python example reads the supplied live response shape. It uses the same sample URL and placeholder, so resolve the authentication discrepancy before substituting a real credential:
import requests
url = (
"https://bonds-api.com/api/v1/latest"
"?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
)
response = requests.get(url, timeout=30)
response.raise_for_status()
payload = response.json()
if not payload.get("success"):
raise RuntimeError(payload.get("error", "Request failed"))
symbol = "US_10Y"
print("Yield (%):", payload["rates"][symbol])
print("Observation date:", payload["dates"][symbol])
print("Updated at:", payload["updated_at"][symbol])
Retrieve historical observations
The following requests use the header-based format in the endpoint reference. Each is a GET request. The examples are useful for understanding parameters and fields, but the Indonesia coverage discrepancy must be resolved before treating them as executable production integrations.
Latest available maturities
/latest requires comma-separated countries. The optional maturities parameter selects several maturities in one request; omit it to request all available maturities.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/latest?countries=ID&maturities=2Y,10Y"
{
"success": true,
"data": {
"ID": {
"2Y": { "yield": 4.25, "date": "2026-12-01", "source": "official" },
"10Y": { "yield": 4.52, "date": "2026-12-01", "source": "official" }
}
}
}
In this reference shape, data is keyed by country and maturity. Each observation has a percentage yield, an observation date, and a source. Do not assume this shape is interchangeable with the live sample’s rates and dates maps; confirm the actual response schema before writing a parser.
A single historical date
/historical takes singular country and maturity parameters plus a date in Y-m-d format. It is suitable for a point-in-time lookup when a value exists for the requested combination.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/historical?country=ID&maturity=10Y&date=2025-06-15"
{
"success": true,
"country": "ID",
"maturity": "10Y",
"date": "2025-06-15",
"yield": 4.38,
"source": "official"
}
The returned country, maturity, and date identify the observation; yield is the percentage rate. Check the returned date rather than assuming a missing trading day has been filled with a previous observation. The reference does not establish a fallback rule for non-trading dates.
A time series
/timeseries requires country, maturity, start, and end; the end date must not precede the start date. Use it for charts, changes over time, and research datasets.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/timeseries?country=ID&maturity=10Y&start=2025-12-01&end=2026-12-01"
{
"success": true,
"country": "ID",
"maturity": "10Y",
"series": [
{ "date": "2025-01-02", "yield": 4.21 },
{ "date": "2025-01-03", "yield": 4.19 },
{ "date": "2025-01-06", "yield": 4.23 }
]
}
Each series item contains an observation date and percentage yield. The supplied response dates fall outside the supplied request’s range, so these two blocks should not be treated as a verified request-response pair. In an integration, validate that returned dates fall within the requested interval before using the series.
Build an Indonesia yield curve
A yield curve compares yields across maturities on a common observation date. It can support maturity-bucket risk analysis or show how the short and long ends of the sovereign market move relative to one another. A curve assembled from observations with different dates may instead reflect timing differences.
If Indonesia coverage is confirmed, the multi-maturity /latest request above can provide several curve points in one call. Check the date on every point, retain the maturity labels, and sort maturities by tenor rather than alphabetically. Requesting several maturities is not a guarantee that all of them will be available.
Alternatively, /curve requires country and accepts an optional date in Y-m-d format. If omitted, the reference says it defaults to the latest available day with data.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/curve?country=ID"
{
"success": true,
"country": "ID",
"date": "2026-12-01",
"inverted": false,
"curve": {
"1M": 5.31, "3M": 5.27, "6M": 5.18,
"1Y": 4.98, "2Y": 4.25, "5Y": 4.39,
"10Y": 4.52, "30Y": 4.71
}
}
curve maps maturity labels to percentage yields; date identifies the curve date. inverted is the API’s Boolean indicator, but the reference does not specify which maturities determine it. If your risk model uses a particular definition of inversion, calculate that comparison explicitly and preserve the input tenors.
Measure spreads, fluctuations, and intraday moves
Benchmark spread
/spread requires country and benchmark. The optional maturity defaults to 10Y. This reference example compares Indonesia with the US benchmark at the same stated maturity:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/spread?country=ID&benchmark=US&maturity=10Y"
{
"success": true,
"country": "ID",
"benchmark": "US",
"maturity": "10Y",
"spread_bps": 215,
"country_yield": 4.52,
"benchmark_yield": 2.37
}
country_yield and benchmark_yield are percentages; spread_bps is their difference in basis points. In the reference example, subtracting 2.37 from 4.52 gives 2.15 percentage points, or 215 basis points. The example does not include observation dates, so establish date alignment before using a spread as a historical comparison.
Period change and range
/fluctuation accepts comma-separated countries, one maturity, and start and end dates. It summarizes a period without returning every observation.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/fluctuation?countries=ID&maturity=10Y&start=2025-12-01&end=2026-12-01"
{
"success": true,
"maturity": "10Y",
"start": "2025-12-01",
"end": "2026-12-01",
"data": {
"ID": {
"start_yield": 4.21,
"end_yield": 4.52,
"change": 0.31,
"min": 3.87,
"max": 4.76
}
}
}
The country entry contains start and end yields, their change, and the period’s min and max. In this example, the change is 0.31 percentage points, equivalent to 31 basis points. Use the time-series endpoint when a model needs the observations underlying a summary rather than just its range.
Intraday snapshots
/intraday requires country, maturity, and date. It is designed for examining snapshots within a day rather than constructing a daily history.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/intraday?country=ID&maturity=10Y&date=2026-12-01"
{
"success": true,
"country": "ID",
"maturity": "10Y",
"date": "2026-12-01",
"snapshots": [
{ "yield": 4.51, "fetched_at": "2026-12-01T09:30:00Z", "source": "market" },
{ "yield": 4.53, "fetched_at": "2026-12-01T12:00:00Z", "source": "market" },
{ "yield": 4.52, "fetched_at": "2026-12-01T15:30:00Z", "source": "market" }
],
"count": 3,
"meta": { "timezone": "UTC" }
}
Each snapshot has a percentage yield, a fetched_at timestamp, and a source. The Z suffix denotes UTC, consistent with meta.timezone; count is the number of snapshots. Do not interpret the spacing in this example as a guaranteed update schedule.
Operate the integration safely
Business days and market holidays matter when comparing dates or calculating daily moves. Preserve the dates actually returned, distinguish missing data from a zero yield, and make any previous-observation carry-forward an explicit analytical choice. Do not silently fill gaps in a research dataset.
The reference does not specify a fixed update frequency. Cache results according to your application’s freshness needs, retain observation and fetch timestamps separately, and refresh intraday data more cautiously than settled historical observations. A cache should not label an older observation as current merely because it was fetched recently.
Check both HTTP status and the response’s success field. The documented error shape contains success=false and an error message. A 401 indicates a missing or invalid key; 403 indicates quota exceeded; 404 indicates no data for the requested combination; 422 indicates an invalid parameter; 429 indicates rate limiting; and 500 indicates a server error. Handle transient failures with a bounded retry policy, rather than retrying invalid requests indefinitely.
Pagination behavior is not specified in the supplied reference. Before backfilling a long series, confirm the endpoint’s supported range and response behavior with Bonds API; validate completeness rather than assuming one response contains every possible observation.
FAQ
Can I request historical Indonesia yields today?
The endpoint reference shows ID requests, but the supplied live-sample note says Indonesia is absent from the published catalog. Confirm coverage before depending on those requests.
Are yields percentages or basis points?
Yield fields are percentages. A percentage-point difference multiplied by 100 gives basis points; spread_bps is already expressed in basis points.
What happens on a market holiday?
The supplied reference does not specify a holiday fallback. Check for missing data and inspect returned dates instead of assuming a prior-day value.
How can I get a curve for a historical date?
If coverage is confirmed, use /curve with country and the optional date. Check the returned date and available maturities before comparing it with another curve.
To obtain an API key and verify the current coverage and authentication contract, Register. You can also explore the MCP interface for Bonds API.