API to Get Indonesia Bond Yields

API to Get Indonesia Bond Yields

You need reliable, machine-readable Indonesia government bond yields inside your own models and dashboards. By the end of this guide you will know exactly how to fetch Indonesia (ISO2: ID) sovereign yields, assemble a yield curve, compute US–Indonesia spreads, pull intraday snapshots, and manage historical time windows using the Bonds API over simple GET requests.

What you can build and how the data is structured

Bonds API delivers sovereign bond yields for 60+ countries as JSON over REST at https://bonds-api.com. Yields are expressed in percent (for example 4.52 means 4.52%), while spreads are expressed in basis points (for example 215 means 2.15%). Dates are calendar dates in YYYY-MM-DD. Intraday timestamps are UTC ISO-8601 (for example 2026-11-16T12:00:00Z).

Illustration: API to Get Indonesia Bond Yields

Core Indonesia use cases include:

  • Yield-curve monitors for ID across short bills (1M–1Y) and long bonds (2Y–30Y).
  • Risk dashboards showing 10Y ID yield vs US Treasuries spread in basis points.
  • Backtests and event studies using time series and period fluctuations.
  • Trading and treasury tools that display intraday snapshots for the on-the-run 10Y.

All endpoints are under https://bonds-api.com/api/v1/, use HTTP GET, and authenticate via the X-API-Key header. Learn more and explore coverage at bonds-api.com. When you are ready to call the API, use Register to obtain your API key.

Latest yields: get current Indonesia bonds by maturity

Use this endpoint to fetch the latest available yields for Indonesia across one or more maturities. If you omit the maturities parameter, the API returns all available points on the curve for that country.

Endpoint: GET /api/v1/latest

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": "ID", "maturities": "2Y,10Y"}
)
data = resp.json()
# Example: read the Indonesia 10Y latest yield and date
id_10y = data["data"]["ID"]["10Y"]["yield"]
id_10y_date = data["data"]["ID"]["10Y"]["date"]
print(id_10y, id_10y_date)

JavaScript (fetch)

const url = new URL("https://bonds-api.com/api/v1/latest");
url.search = new URLSearchParams({ countries: "ID", maturities: "2Y,10Y" }).toString();

fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(json => {
const id2y = json.data.ID["2Y"].yield;
const id2yDate = json.data.ID["2Y"].date;
console.log("ID 2Y:", id2y, "as of", id2yDate);
});

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=ID&maturities=2Y,10Y";
$json = file_get_contents($url, false, $context);
$data = json_decode($json, true);
$id10y = $data["data"]["ID"]["10Y"]["yield"];
$id10yDate = $data["data"]["ID"]["10Y"]["date"];
echo $id10y . " " . $id10yDate;

Sample JSON response

{
    "success": true,
    "date": "2026-11-16",
    "rates": {
        "US_10Y": 5.151
    },
    "dates": {
        "US_10Y": "2026-11-16"
    },
    "currencies": {
        "US_10Y": "USD"
    },
    "meta": {
        "request_id": "69f5e5ef-e11f-4198-b440-59ff47e25d6e",
        "timestamp": "2026-11-16T00:06:47+00:00"
    }
}

How to read it:

  • yield: percentage (for example 4.52 means 4.52%).
  • date: trading day in YYYY-MM-DD when the yield is valid.
  • source: data origin label (for example official).

Yield on a specific date

Pull a single Indonesia maturity for an exact historical date. Useful for point-in-time portfolio valuation, event studies, and backfilling.

Endpoint: GET /api/v1/historical

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)
hist = resp.json()
print(hist["country"], hist["maturity"], hist["date"], hist["yield"])

JavaScript (fetch)

const params = new URLSearchParams({ country: "ID", maturity: "10Y", date: "2025-06-15" });
fetch(`https://bonds-api.com/api/v1/historical?${params}`, {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(json => {
console.log(json.country, json.maturity, json.date, json.yield);
});

PHP (file_get_contents)

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

Sample JSON response

Fields:

  • yield: percent.
  • date: the calendar date requested.
  • source: origin label.

Time series between two dates

Fetch daily Indonesia yields between start and end dates (inclusive). Ideal for plotting, regressions, and volatility estimates.

Endpoint: GET /api/v1/timeseries

cURL

Python (requests)

import requests

params = {
"country": "ID",
"maturity": "10Y",
"start": "2025-11-16",
"end": "2026-11-16"
}
r = requests.get("https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
series = r.json()["series"]
for point in series:
print(point["date"], point["yield"])

JavaScript (fetch)

const tsParams = new URLSearchParams({
country: "ID", maturity: "10Y", start: "2025-11-16", end: "2026-11-16"
});
fetch(`https://bonds-api.com/api/v1/timeseries?${tsParams}`, {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(json => json.series.forEach(p => console.log(p.date, p.yield)));

PHP (file_get_contents)

<?php
$params = http_build_query([
"country" => "ID",
"maturity" => "10Y",
"start" => "2025-11-16",
"end" => "2026-11-16"
]);
$context = stream_context_create(["http" => ["method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$json = file_get_contents("https://bonds-api.com/api/v1/timeseries?$params", false, $context);
$data = json_decode($json, true);
foreach ($data["series"] as $row) {
echo $row["date"] . " " . $row["yield"] . PHP_EOL;
}

Sample JSON response

Each element in series contains date (YYYY-MM-DD) and yield (percent) for a business day when the market posted a value. If a date is a weekend or Indonesia market holiday, it will not appear in the series.

Spread vs benchmark (e.g., Indonesia 10Y vs US 10Y)

Compute the interest-rate differential in basis points between Indonesia and a benchmark country (for example US). This is useful for cross-market relative value and FX-hedged carry screens.

Endpoint: GET /api/v1/spread

cURL

Python (requests)

import requests

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

JavaScript (fetch)

const spParams = new URLSearchParams({ country: "ID", benchmark: "US", maturity: "10Y" });
fetch(`https://bonds-api.com/api/v1/spread?${spParams}`, {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(j => console.log("Spread (bps):", j.spread_bps));

PHP (file_get_contents)

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

Sample JSON response

Fields:

  • spread_bps: basis points (1 bp = 0.01%). 215 bps equals 2.15 percentage points.
  • country_yield: Indonesia yield in percent.
  • benchmark_yield: benchmark country yield in percent.

Full Indonesia yield curve (single day)

Retrieve the entire Indonesia curve on a given date (or the latest available date by default). Use this to build curve visualizations, bootstraps, or interpolation grids.

Endpoint: GET /api/v1/curve

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()
date = curve["date"]
points = curve["curve"] # dict keyed by maturities like "1M","3M","6M",...,"30Y"
print(date, points)

JavaScript (fetch)

const paramsCurve = new URLSearchParams({ country: "ID" });
fetch(`https://bonds-api.com/api/v1/curve?${paramsCurve}`, {
headers: { "X-API-Key": "YOUR_API_KEY" }
}).then(r => r.json())
.then(j => {
console.log("Date:", j.date, "Inverted:", j.inverted);
Object.entries(j.curve).forEach(([tenor, y]) => console.log(tenor, y));
});

PHP (file_get_contents)

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

Sample JSON response

Notes:

  • inverted: boolean indicating whether shorter maturities exceed longer ones.
  • curve: object mapping maturities to yields (percent).

Intraday snapshots for Indonesia yields

Get multiple yield snapshots across a specific trading day. Useful for day-trading tools and market microstructure analysis.

Endpoint: GET /api/v1/intraday

cURL

Python (requests)

import requests

params = {"country": "ID", "maturity": "10Y", "date": "2026-11-16"}
resp = requests.get("https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params)
snapshots = resp.json()["snapshots"]
for s in snapshots:
print(s["fetched_at"], s["yield"], s["source"])

JavaScript (fetch)

const intradayParams = new URLSearchParams({ country: "ID", maturity: "10Y", date: "2026-11-16" });
fetch(`https://bonds-api.com/api/v1/intraday?${intradayParams}`, {
headers: { "X-API-Key": "YOUR_API_KEY" }
}).then(r => r.json())
.then(j => {
j.snapshots.forEach(s => console.log(s.fetched_at, s.yield));
console.log("Count:", j.count, "TZ:", j.meta.timezone);
});

PHP (file_get_contents)

<?php
$params = http_build_query(["country" => "ID", "maturity" => "10Y", "date" => "2026-11-16"]);
$ctx = stream_context_create(["http" => ["method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$json = file_get_contents("https://bonds-api.com/api/v1/intraday?$params", false, $ctx);
echo $json;

Sample JSON response

Fields:

  • snapshots[].yield: percent at the snapshot time.
  • snapshots[].fetched_at: UTC timestamp for the observation.
  • count: number of intraday observations returned.

Fluctuation over a period (change, min, max)

Compute start, end, absolute change, minimum, and maximum yields over a date range. Ideal for risk summaries and drawdown-style analytics.

Endpoint: GET /api/v1/fluctuation

cURL

Python (requests)

import requests

params = {
"countries": "ID",
"maturity": "10Y",
"start": "2025-11-16",
"end": "2026-11-16"
}
r = requests.get("https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
fl = r.json()["data"]["ID"]
print(fl["start_yield"], fl["end_yield"], fl["change"], fl["min"], fl["max"])

JavaScript (fetch)

const paramsFl = new URLSearchParams({
countries: "ID", maturity: "10Y", start: "2025-11-16", end: "2026-11-16"
});
fetch(`https://bonds-api.com/api/v1/fluctuation?${paramsFl}`, {
headers: { "X-API-Key": "YOUR_API_KEY" }
}).then(r => r.json())
.then(j => console.log(j.data.ID));

PHP (file_get_contents)

<?php
$params = http_build_query([
"countries" => "ID",
"maturity" => "10Y",
"start" => "2025-11-16",
"end" => "2026-11-16"
]);
$ctx = stream_context_create(["http" => ["method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$json = file_get_contents("https://bonds-api.com/api/v1/fluctuation?$params", false, $ctx);
echo $json;

Sample JSON response

Fields:

  • start_yield/end_yield: percent at the range boundaries.
  • change: absolute percent change (end minus start), not basis points.
  • min/max: extrema in percent across the window.

Error handling and common response shapes

All endpoints return success=true on success. Errors set success=false with an error message and an HTTP status code. Typical errors include:

  • 401: missing or invalid X-API-Key.
  • 403: account quota exceeded.
  • 404: no data for the requested country/maturity/date.
  • 422: invalid parameter (for example wrong date format).
  • 429: rate limit exceeded.
  • 500: server error.

Build robust client code by checking HTTP status and the success field. For retries, consider exponential backoff on 429 and 500. Cache successful responses to reduce calls and improve app performance.

Practical details: maturities, market days, caching, and yield-curve assembly

Maturities available for Indonesia typically span money-market bills to long-dated bonds. The curve endpoint returns a keyed object for each tenor present that day. Common points include 1M, 3M, 6M, 1Y, 2Y, 5Y, 10Y, 30Y.

Maturity Instrument type Curve usage
1M–6M T-bills Front-end funding curve
1Y–5Y Short-to-intermediate bonds Macro sensitivity, policy-cycle views
10Y–30Y Benchmark bonds Duration, spread, and asset-liability models

Business days and holidays: time series include only trading days with data. Weekends and Indonesia market holidays are excluded. For the latest endpoint, data typically updates on market days; intraday snapshots provide additional granularity when available.

Update cadence: daily endpoints (latest, historical, timeseries, fluctuation, curve) serve end-of-day-like values for each business day. The intraday endpoint exposes multiple snapshots with UTC timestamps for the selected date.

Caching: since many queries are repeated (for example the same date range or latest day), cache responses by request URL and header. Respect that intraday data may change during the day; choose a short TTL for intraday and a longer TTL for daily endpoints.

How to assemble a multi-point yield curve:

  • Preferred: use GET /api/v1/curve?country=ID to fetch all points at once. This guarantees cross-tenor consistency for that date and includes the inverted flag.
  • Alternative: call GET /api/v1/latest with countries=ID and a comma-separated maturities list when you only need a subset (for example 2Y,5Y,10Y).
  • If you need a backdated curve, call GET /api/v1/curve with a date parameter for that historical day.

To explore schemas and test calls in your browser, visit MCP. For production integrations, keep your key safe and send it in the X-API-Key header.

Sovereign bond fundamentals for context

Indonesia government bonds are debt securities issued by the Republic of Indonesia. Yields reflect the market’s required return for holding these bonds and move with expectations for inflation, central bank policy, growth, and risk appetite. Analysts monitor the shape of the curve (for example normal vs inverted), level changes (for example 10Y +20 bps day-over-day), and spreads to benchmark issuers (for example US Treasuries) to diagnose macro conditions and relative value.

Reference sample block (verbatim)

The following official sample demonstrates a latest-yield request and response structure presented exactly as provided. Use it as a reference when validating your client’s JSON parsing.

Fields to note in this schema:

  • rates: yields are in percent.
  • date/dates: day context for the quote.
  • meta.timestamp: UTC ISO-8601 timestamp for the response.

Putting it together: dashboard ideas and analytical recipes

  • Daily Indonesia curve panel: GET /api/v1/curve for ID, plot 1M–30Y, color the plot if inverted=true.
  • 10Y watcher with US spread: GET /api/v1/latest for ID 10Y and /api/v1/spread with benchmark=US; display spread_bps prominently.
  • Macro change heatmap: use /api/v1/fluctuation across selected windows (for example month-to-date, quarter-to-date) to surface min/max and change by tenor.
  • Intraday ticker: poll /api/v1/intraday for 10Y to show last snapshot and day’s range.
  • Backtest module: use /api/v1/timeseries to feed regressions on ID 10Y vs macro predictors.

As you implement, keep consistent units: yields in percent, spreads in basis points, timestamps in UTC. Always check the date field to ensure alignment with your valuation date and handle holidays explicitly when rolling windows.

For additional documentation and updates, refer to bonds-api.com. When ready to integrate, get your key here: Register.

FAQ

Which units should I expect for yields and spreads?
Yields are returned in percent (for example 4.52 means 4.52%). Spreads from the spread endpoint are in basis points (for example 215 means 2.15 percentage points).

How do I handle weekends and Indonesia market holidays?
Daily series only include business days with observations. If you request a holiday or weekend via historical, you may receive a 404 for that date. For time windows, use timeseries to iterate over actual trading days present.

What timezone are timestamps in?
Dates are plain YYYY-MM-DD. Intraday timestamps are in UTC (for example 2026-11-16T12:00:00Z). Convert to your display timezone as needed.

Can I fetch multiple Indonesia maturities in one call?
Yes. Use the latest endpoint with maturities as a comma-separated list (for example maturities=2Y,5Y,10Y) or use the curve endpoint to retrieve all availabilities for a single date.

How often should I refresh data?
Daily endpoints typically change once per business day. Use short polling or webhooks in your app as desired, and set an appropriate cache TTL. For intraday needs, poll the intraday endpoint at your desired cadence and cache for brief intervals.

Build your Indonesia fixed-income analytics with a few GET requests. Explore the schema in the MCP, then obtain your key and start integrating today: Register.

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.