Indonesia Yield Curve

Indonesia Yield Curve

You need reliable Indonesia government bond yields inside your own tools. By the end of this article, you will be able to request the latest yields, a full IDR yield curve, historical and intraday snapshots, compute spreads, and track fluctuations over time using Bonds API endpoints—then assemble those results into dashboards, screeners, or quant models.

What you will build and how yields are represented

This guide focuses on Indonesia (ISO2: ID). You will learn how to:

Illustration: Indonesia Yield Curve
  • Fetch current yields by maturity and build the Indonesia yield curve.
  • Query historical and intraday values for time-sensitive analytics.
  • Calculate spreads versus a benchmark (e.g., US Treasuries).
  • Summarize min, max, and net changes across a period.

Yields in Bonds API responses are expressed in percent (e.g., 4.52 means 4.52%). Spreads are expressed in basis points (bps), where 1 bp = 0.01%. Dates are provided in Y-m-d (e.g., 2026-11-01) and timestamps in ISO-8601 UTC (e.g., 2026-11-01T12:00:00Z). If you are new to the API, visit https://bonds-api.com and the MCP to explore routes interactively. When you are ready to integrate, use the Register link to obtain your API key.

Before you code: maturities, updates, and practicalities

Maturities cover short bills through long bonds, for example: 1M, 3M, 6M, 1Y, 2Y, 5Y, 10Y, 30Y (and potentially more up to 50Y depending on coverage). For Indonesia, the curve endpoint aggregates multiple points on the same valuation date so you can fit a smooth curve or compare bill-vs-bond segments.

Updates and business days: sovereign yields update on business days; weekends and Indonesia market holidays will not produce new daily snapshots. The API returns the latest available date with data. Intraday snapshots are timestamped in UTC. For caching, consider a short-lived cache for “latest” (e.g., 1–5 minutes intra-day, 15–60 minutes off-market hours) and a longer cache for historical endpoints since past dates are immutable. Use the “date” returned from endpoints as your cache key, not just the request time.

Authentication is via the X-API-Key header. All requests are GET to the base URL https://bonds-api.com/api/v1/. See endpoint details below. You can always return to bonds-api.com for product documentation and coverage.

Official sample block

The following official sample call and JSON are provided verbatim for reference:

curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
{
    "success": true,
    "date": "2026-10-30",
    "rates": {
        "US_10Y": 4.94
    },
    "dates": {
        "US_10Y": "2026-10-30"
    },
    "currencies": {
        "US_10Y": "USD"
    },
    "meta": {
        "request_id": "cfcce9a9-7ed6-405d-993e-fab077e7cba7",
        "timestamp": "2026-11-01T00:05:43+00:00"
    }
}

Endpoint 1: Latest yields (Indonesia)

Use this to retrieve the most recent yields for specific maturities or all available maturities for Indonesia. The API returns yields as percentages for each maturity and the reference date. If you omit maturities, you will get all available maturities for the country.

cURL

Python

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()
# Access: data["data"]["ID"]["2Y"]["yield"], data["data"]["ID"]["10Y"]["yield"]

JavaScript

async function getLatestID() {
const url = new URL("https://bonds-api.com/api/v1/latest");
url.searchParams.set("countries", "ID");
url.searchParams.set("maturities", "2Y,10Y");
const res = await fetch(url.toString(), {
method: "GET",
headers: { "X-API-Key": "YOUR_API_KEY" }
});
const json = await res.json();
return json;
}

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);
$data = json_decode($response, true);
// $data["data"]["ID"]["2Y"]["yield"] etc.

Sample JSON response

How to read it:

  • yield: Percentage (e.g., 4.52 means 4.52%).
  • date: Y-m-d of the valuation day for that maturity.
  • source: Data provenance (e.g., “official”).

Endpoint 2: Historical yield on a specific date

Pull the Indonesia yield for a single maturity on an exact calendar date (business days return data; weekends/holidays may result in 404 if no fixing was published).

cURL

Python

import requests

params = {"country": "ID", "maturity": "10Y", "date": "2025-06-15"}
data = requests.get(
"https://bonds-api.com/api/v1/historical",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params
).json()
# data["yield"] is percent on the requested date.

JavaScript

async function getHistoricalID() {
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");
const res = await fetch(url.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
});
return res.json();
}

PHP

<?php
$headers = "X-API-Key: YOUR_API_KEY\r\n";
$context = stream_context_create(["http" => ["method" => "GET", "header" => $headers]]);
$url = "https://bonds-api.com/api/v1/historical?country=ID&maturity=10Y&date=2025-06-15";
$json = file_get_contents($url, false, $context);
$data = json_decode($json, true);

Sample JSON response

Fields:

  • yield: Percent on that date.
  • date: Requested Y-m-d (ensure it is a business day or the latest available fixing; otherwise you may get 404).

Endpoint 3: Time series between two dates

Use this to backtest strategies, compute rolling averages, or draw charts for a single Indonesia maturity over a range. The series returns one data point per trading day.

cURL

Python

import requests

params = {
"country": "ID",
"maturity": "10Y",
"start": "2025-11-01",
"end": "2026-11-01"
}
ts = requests.get(
"https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params
).json()
# Iterate ts["series"] to build charts or compute stats.

JavaScript

async function getTimeseriesID() {
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-11-01");
url.searchParams.set("end", "2026-11-01");
const res = await fetch(url.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
});
const json = await res.json();
return json.series;
}

PHP

<?php
$headers = "X-API-Key: YOUR_API_KEY\r\n";
$context = stream_context_create(["http" => ["method" => "GET", "header" => $headers]]);
$url = "https://bonds-api.com/api/v1/timeseries?country=ID&maturity=10Y&start=2025-11-01&end=2026-11-01";
$response = file_get_contents($url, false, $context);
$ts = json_decode($response, true);

Sample JSON response

Each entry is a trading day with its yield in percent. Use date parsing libraries compatible with Y-m-d.

Endpoint 4: Spread vs benchmark

Compare Indonesia yields versus a benchmark sovereign such as the US. The spread is returned in basis points along with both country and benchmark yields in percent. By default, the maturity is 10Y, but you can pass a maturity parameter.

cURL

Python

import requests

params = {"country": "ID", "benchmark": "US", "maturity": "10Y"}
spread = requests.get(
"https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params
).json()
# spread["spread_bps"] gives basis points.

JavaScript

async function getSpreadIDvsUS() {
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");
const res = await fetch(url.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
});
return res.json();
}

PHP

<?php
$headers = "X-API-Key: YOUR_API_KEY\r\n";
$context = stream_context_create(["http" => ["method" => "GET", "header" => $headers]]);
$url = "https://bonds-api.com/api/v1/spread?country=ID&benchmark=US&maturity=10Y";
$json = file_get_contents($url, false, $context);
$spread = json_decode($json, true);

Sample JSON response

Fields:

  • spread_bps: Basis points (e.g., 215 bps = 2.15%).
  • country_yield, benchmark_yield: Percent yields for Indonesia and benchmark.

Endpoint 5: Full yield curve for Indonesia

Pull a curve snapshot to see the cross-section of maturities on a single date. This is ideal for plotting the curve or interpolating a par/zero curve for valuation. Omit date for the latest available curve.

cURL

Python

import requests

curve = requests.get(
"https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "ID"}
).json()
# curve["curve"] is a mapping {maturity: yield_percent}

JavaScript

async function getCurveID(date) {
const url = new URL("https://bonds-api.com/api/v1/curve");
url.searchParams.set("country", "ID");
if (date) url.searchParams.set("date", date); // optional
const res = await fetch(url.toString(), { headers: { "X-API-Key": "YOUR_API_KEY" }});
return res.json();
}

PHP

<?php
$headers = "X-API-Key: YOUR_API_KEY\r\n";
$context = stream_context_create(["http" => ["method" => "GET", "header" => $headers]]);
$url = "https://bonds-api.com/api/v1/curve?country=ID";
$json = file_get_contents($url, false, $context);
$curve = json_decode($json, true);

Sample JSON response

Notes:

  • curve: Map of maturity string to yield percent.
  • inverted: Boolean indicating if the curve is inverted overall (a heuristic useful for macro screens).
  • date: Valuation date for the snapshot.

To build a custom curve from individual maturities using the latest endpoint, pass maturities as a comma-separated list (e.g., 1M,3M,6M,1Y,2Y,5Y,10Y,30Y) and assemble the curve from the payload. The curve endpoint saves you those extra calls by returning a consolidated slice on a single date.

Endpoint 6: Intraday snapshots

For trading-day applications, request multiple timestamps for a given maturity and date. This is useful for tracking moves around data releases or auction windows in Jakarta time (remember, the API timestamps are in UTC).

cURL

Python

import requests

params = {"country": "ID", "maturity": "10Y", "date": "2026-11-01"}
snap = requests.get(
"https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params
).json()
# Each snapshot has a yield percent and fetched_at timestamp (UTC).

JavaScript

async function getIntradayID() {
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-11-01");
const res = await fetch(url.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
});
return res.json();
}

PHP

<?php
$headers = "X-API-Key: YOUR_API_KEY\r\n";
$context = stream_context_create(["http" => ["method" => "GET", "header" => $headers]]);
$url = "https://bonds-api.com/api/v1/intraday?country=ID&maturity=10Y&date=2026-11-01";
$json = file_get_contents($url, false, $context);
$intraday = json_decode($json, true);

Sample JSON response

fetched_at is an ISO-8601 UTC timestamp. Align these with Jakarta time for intraday analyses. Use count for basic sanity checks.

Endpoint 7: Fluctuation over a period

Compute start, end, net change, min, and max for Indonesia over a window. This helps summarize moves over weeks or months for reporting or screening.

cURL

Python

import requests

params = {
"countries": "ID",
"maturity": "10Y",
"start": "2025-11-01",
"end": "2026-11-01"
}
fluc = requests.get(
"https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params
).json()
# Access fluc["data"]["ID"]["change"] etc. (percent).

JavaScript

async function getFluctuationID() {
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-11-01");
url.searchParams.set("end", "2026-11-01");
const res = await fetch(url.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
});
return res.json();
}

PHP

<?php
$headers = "X-API-Key: YOUR_API_KEY\r\n";
$context = stream_context_create(["http" => ["method" => "GET", "header" => $headers]]);
$url = "https://bonds-api.com/api/v1/fluctuation?countries=ID&maturity=10Y&start=2025-11-01&end=2026-11-01";
$json = file_get_contents($url, false, $context);
$fluc = json_decode($json, true);

Sample JSON response

All values are in percent. change is end_yield - start_yield in percentage points. min and max are the range extremes over the interval.

Using Indonesia yields in real applications

With these endpoints, you can:

  • Finance dashboards: Plot the Indonesia curve daily (Endpoint 5) and update the 10Y tile with Endpoint 1.
  • Risk tools: Stress-test portfolios using curve shifts or time series volatility (Endpoints 3 and 7).
  • Research: Compare Indonesia vs US or Germany spreads for macro views (Endpoint 4).
  • Trading monitors: Track intraday color around data events (Endpoint 6), with UTC timestamps normalized to Asia/Jakarta.

Tip: When aggregating multiple endpoints, verify that the dates align. For example, if you pull latest 2Y and 10Y and separately fetch a 1Y time series, ensure the displayed “as of” dates do not mismatch to avoid misleading comparisons.

Error handling and reliability

Common error shapes include success=false with an error message. Typical status codes:

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

Production recommendations:

  • Validate inputs (ISO2 codes like ID, maturities like 10Y, dates in Y-m-d).
  • Implement retries with backoff for transient 500s; do not retry 4xx except possibly 429 after a delay.
  • Cache immutable endpoints (historical, timeseries) aggressively; keep a short TTL for “latest” and intraday.
  • Record the returned date and timestamps and surface them in UI for clarity.

Sovereign bond fundamentals (quick context)

Indonesia sovereign bonds are issued by the government and their yields reflect market expectations for inflation, policy rates, fiscal health, and risk premia. The yield curve shape—steep, flat, or inverted—contains information about growth and policy paths. Developers and analysts often use the curve to discount cash flows, compute duration/convexity, and monitor macro signals.

Building an Indonesia yield curve from multiple symbols

Two common approaches:

  • Single-call snapshot: Use Endpoint 5 (/curve?country=ID). You receive a map of maturities to yields with the same valuation date, and an inverted flag for quick diagnostics.
  • Latest-by-maturity: Use Endpoint 1 with a comma-separated maturities list (e.g., 1M,3M,6M,1Y,2Y,5Y,10Y,30Y). Verify all returned date fields match before assembling, or reconcile by selecting the most conservative “as of” date.

For curve-fitting, convert the percentage yields into decimals (e.g., 4.52% as 0.0452) before computing discount factors or fitting splines. Keep maturities in consistent units (e.g., years) for curve models.

Caching, holidays, and update cadence for Indonesia

Daily endpoints reflect business days; Indonesia public holidays and weekends generally have no new fixes. Intraday snapshots cluster during local trading hours but are timestamped in UTC. Suggested caching:

  • latest: 1–5 minutes intraday; 15–60 minutes off-hours.
  • curve: 5–15 minutes on business days; 1–4 hours on weekends/holidays.
  • historical/timeseries/fluctuation: long-lived caches since these are immutable once published.
  • intraday: low TTL (e.g., 30–120 seconds) while markets are active.

If a date you request has no data (weekend/holiday), expect a 404. Fall back to the prior business day or inform the user.

End-to-end example: assembling an Indonesia 10Y monitoring panel

Typical panel components and the endpoints behind them:

  • Latest 10Y tile: Endpoint 1 (latest?countries=ID&maturities=10Y).
  • Intraday sparkline: Endpoint 6 (intraday for today’s date).
  • 1Y lookback chart: Endpoint 3 (timeseries for last 252 business days, approximate).
  • Spread vs US 10Y badge: Endpoint 4 (spread?country=ID&benchmark=US&maturity=10Y) shown in bps.
  • Attribution box: Endpoint 7 to show min, max, and net change over the lookback window.

Troubleshooting tips

  • Date parsing: Use Y-m-d for daily dates; use ISO-8601 UTC for intraday timestamps.
  • Units: Display yields with two decimals (e.g., 4.52%) and spreads in bps (e.g., 215 bps).
  • Consistency: When mixing endpoints, display the “as of” date near each widget to avoid mismatched time contexts.
  • Graceful degradation: On 404 for a date, fall back to prior business day or disable the widget with a clear message.

FAQ

Q: Are yields returned as decimals or percentages?
A: Percentages. For example, "yield": 4.52 means 4.52%.

Q: What timezone are the timestamps in?
A: Daily dates are Y-m-d without time; intraday timestamps use ISO-8601 in UTC (e.g., 2026-11-01T12:00:00Z). Convert to Asia/Jakarta for local views.

Q: How do I compute a spread vs US Treasuries?
A: Use /api/v1/spread with country=ID, benchmark=US, and an optional maturity parameter. The response includes spread_bps and both yields.

Q: How can I detect an inverted curve?
A: The /api/v1/curve response contains an "inverted" boolean. You can also compute your own criterion from the returned maturity map.

Q: What should I cache, and for how long?
A: Cache immutable endpoints (historical, timeseries, fluctuation) for long durations. Use short TTLs for latest, curve, and intraday depending on market hours.

Ready to integrate Indonesia yields into your stack? Explore the endpoints in the MCP, review the docs at bonds-api.com, and Register for your API key to start building today.

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.

Related posts

All posts →