Historical Malaysian government bond analysis starts with a practical problem: yields arrive by maturity and observation date, while dashboards and risk models need aligned series, curves and spreads. This guide shows how to request Malaysia data, interpret the documented response formats and handle gaps without treating an old observation as a new one.
What Malaysian yield data represents
A sovereign bond is debt issued by a government. Its yield is a measure of the return implied by its price and cash flows; when a bond’s price falls, its yield generally rises. Analysts compare yields across maturities to study the curve and across dates to measure market moves.
For Malaysia, the API reference uses the country code MY and maturity labels such as 2Y and 10Y. The reference provides Malaysia examples, but the supplied live sample is for the US rather than Malaysia. Treat the Malaysia responses below as reference examples, not verified current market observations, and check availability for the maturity and date your application needs.
Yields in the examples are percentage figures: 4.52 means 4.52%, not 0.0452%. One percentage point equals 100 basis points, so a change of 0.31 percentage points is 31 basis points. Yield figures are not currency amounts; a currency field, where present, describes the instrument rather than changing the yield unit.
Authentication and the published live sample
The API reference specifies GET requests to https://bonds-api.com/api/v1/ and authentication through the X-API-Key header. The Malaysia requests in this article use that documented header. Replace YOUR_API_KEY with your own key and keep it out of source control and request logs.
The following published live example uses a query-string key instead. It concerns a US maturity, not Malaysia, and its response must not be interpreted as a Malaysian yield. Because its authentication format differs from the reference, confirm the supported format before using it in an integration; URLs containing keys can also be retained in logs and browser histories.
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": "a203443f-2d38-4747-9ddd-ddc7e8198a1b",
"timestamp": "2026-12-01T00:04:05+00:00"
}
}
In this sample, rates contains the yield and dates contains its observation date. updated_at and meta.timestamp are timestamps with explicit UTC offsets; they are not interchangeable with the date-only observation. The changes object reports comparison dates and movements in basis points and percentage terms.
Retrieve Malaysia observations
Latest yields
Use latest for a dashboard’s most recent available observations. The required countries parameter accepts comma-separated ISO2 codes; maturities is optional and can also contain a comma-separated list. Omitting maturities requests all available maturities.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/latest?countries=MY&maturities=2Y,10Y"
The reference illustrates the Malaysia response as follows:
{
"success": true,
"data": {
"MY": {
"2Y": { "yield": 4.25, "date": "2026-12-01", "source": "official" },
"10Y": { "yield": 4.52, "date": "2026-12-01", "source": "official" }
}
}
}
Read each maturity’s yield, date and source separately. In particular, do not assume that every maturity returned by a latest request has the same observation date. The Malaysia reference format differs from the published live sample above, so validate the actual response shape before mapping fields into storage.
One historical date
Use historical when a calculation needs one country, one maturity and one date. All three parameters—country, maturity and date—are required; dates use Y-m-d.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/historical?country=MY&maturity=10Y&date=2025-06-15"
{
"success": true,
"country": "MY",
"maturity": "10Y",
"date": "2025-06-15",
"yield": 4.38,
"source": "official"
}
The response identifies the requested country and maturity, the observation date, the percentage yield and its source. The date in this reference example should not be taken as evidence that every calendar date has an observation. Handle a missing country/maturity/date combination explicitly rather than silently substituting another day.
Time series
Use timeseries for charts, research datasets and repeated risk calculations. Supply country, maturity, start and end; the end date must not precede the start date.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/timeseries?country=MY&maturity=10Y&start=2025-12-01&end=2026-12-01"
The reference also supplies the following separate series example. Its observation dates are not within the request interval above, so it illustrates the response structure rather than the result of that particular request.
{
"success": true,
"country": "MY",
"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 entry pairs an observation date with a percentage yield. Sort or index by date in your own dataset, retain the requested maturity, and validate returned dates against the intended window. The reference does not describe pagination, so do not assume a pagination parameter or invent one.
Build curves and calculate spreads
Malaysia yield curve
The curve endpoint requests a country’s curve; an optional date selects a historical day. When the date is omitted, the reference says the endpoint uses the latest available day with data.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/curve?country=MY"
{
"success": true,
"country": "MY",
"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, while date identifies the curve’s observation day. inverted is an API-provided curve classification; the reference does not specify its detection rule. If your model defines inversion using a particular pair of maturities, calculate that comparison explicitly and retain the API flag separately.
Alternatively, request several maturity labels with latest and assemble the available points yourself. Order them by tenor rather than alphabetically, check each point’s date, and display missing maturities as missing. A curve made from mixed observation dates may look smooth while concealing stale inputs.
Benchmark spread
The spread endpoint compares Malaysia with a benchmark country. It requires country and benchmark; maturity is optional and defaults to 10Y. The following example explicitly requests the 10-year comparison with the US.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/spread?country=MY&benchmark=US&maturity=10Y"
{
"success": true,
"country": "MY",
"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 in basis points. In this example, subtracting 2.37 from 4.52 gives 2.15 percentage points, or 215 basis points. A cross-country spread is useful for relative-value analysis, but it does not by itself isolate currency, credit or other risk factors.
Track intraday snapshots and period changes
Intraday observations
For intraday analysis, request intraday with country, maturity and date. The response is a sequence of snapshots, not a promise that observations arrive at a fixed interval.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/intraday?country=MY&maturity=10Y&date=2026-12-01"
{
"success": true,
"country": "MY",
"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 contains a yield, a fetched_at timestamp and a source. The Z suffix denotes UTC, consistent with meta.timezone; preserve that timestamp when converting it for display. count reports the number of snapshots in the example.
Changes over a window
Use fluctuation for a period summary rather than calculating every statistic from a stored series. It requires comma-separated countries, one maturity, and start and end dates.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/fluctuation?countries=MY&maturity=10Y&start=2025-12-01&end=2026-12-01"
{
"success": true,
"maturity": "10Y",
"start": "2025-12-01",
"end": "2026-12-01",
"data": {
"MY": {
"start_yield": 4.21,
"end_yield": 4.52,
"change": 0.31,
"min": 3.87,
"max": 4.76
}
}
}
For Malaysia, the example reports starting and ending yields, their change, and the minimum and maximum over the period. The displayed change is in percentage points: multiply it by 100 to express it in basis points. Keep the requested window alongside the result, and do not infer which trading dates supplied the endpoints if the response does not provide them.
Implement and operate the integration
This Python example calls the same published live endpoint and reads its documented sample fields. It preserves that sample’s query-string authentication for reproducibility; the Malaysia reference requests above instead use the X-API-Key header.
import requests
response = requests.get(
"https://bonds-api.com/api/v1/latest",
params={
"countries": "US",
"maturities": "10Y",
"api_key": "YOUR_API_KEY",
},
timeout=30,
)
response.raise_for_status()
data = response.json()
if not data.get("success"):
raise RuntimeError("Yield request was not successful")
symbol = "US_10Y"
print(data["rates"][symbol])
print(data["dates"][symbol])
print(data["updated_at"][symbol])
For a Malaysia implementation, use the reference’s header-authenticated requests and read the actual response returned. Keep authentication and response parsing separate: the reference’s data.MY example and the live sample’s rates object are different schemas. A failed schema check should produce a visible error, not a zero yield.
Business days and market holidays matter in both historical and current views. A date with no observation can return a 404 for the requested combination. If your application carries a previous observation forward, make that an explicit analytical policy and show both the requested date and the actual observation date.
The reference does not state a fixed update frequency. Cache results according to the freshness your application requires, retain observation dates and timestamps, and label stale data rather than assuming a cache refresh means the market observation changed. Historical results and intraday snapshots may warrant different refresh policies; verify the behavior relevant to your workflow.
Handle HTTP and application errors together. The reference lists 401 for missing or invalid credentials, 403 for quota exhaustion, 404 for unavailable data, 422 for invalid parameters, 429 for rate limiting and 500 for server errors. Error bodies use success=false and an error message; avoid repeatedly retrying a request with invalid credentials or parameters.
For an interactive integration or analysis workflow, see MCP. Confirm the available Malaysia maturities and response shape before connecting a production dashboard, portfolio risk tool or research pipeline.
FAQ
Can I request several Malaysian maturities at once?
Yes. The reference’s latest endpoint accepts comma-separated maturity labels. Check each returned observation date before treating the points as a single curve.
What happens on a market holiday?
An observation may be unavailable, and the reference lists 404 for a missing country/maturity/date combination. Decide explicitly whether your analysis should leave a gap or use an earlier observation, and preserve its actual date.
Are yields and spreads in the same units?
No. The examples express yields as percentages and spread_bps in basis points. A percentage-point difference multiplied by 100 gives the corresponding basis-point difference.
How often should I refresh cached yields?
The supplied reference does not specify a fixed update schedule. Choose a refresh policy for your use case and display the observation date or timestamp so users can assess freshness.
To obtain an API key and test the documented Malaysia requests, Register.