Historical Thai government bond analysis requires more than a yield value: applications need a maturity, an observation date, consistent units and a way to handle days when no data is available. This guide shows how to request Thailand data from Bonds-API, interpret the responses, build a curve and integrate the results into research and risk tools.
The examples use the Thailand country code TH and the request and response formats in the Bonds-API reference. The supplied catalog information conflicts on whether Thailand is available, so confirm coverage for the maturities and dates you need before relying on these examples in production.
Understand the data before requesting it
Government bonds are debt instruments issued by a sovereign borrower. Their yields help analysts compare financing conditions across maturities and track changes in market expectations. A Thai yield curve places available Thai government yields alongside their maturities; a spread compares two yields on a consistent basis.
In the reference examples, yield values are expressed as percentages. For example, a yield of 4.52 means 4.52%, not 0.0452%. A difference of one percentage point equals 100 basis points, so the difference between 4.52% and 4.25% is 27 basis points.
Maturity labels describe the requested term, such as 1M, 2Y or 10Y. Coverage varies by country, maturity and date. Treat the observation date as part of the data: a latest response can contain the most recent available observation rather than a value from the day your application makes its request.
The API base URL is https://bonds-api.com/api/v1/. Send requests using GET and provide the key in the X-API-Key header. The examples below use illustrative reference responses, not a claim that those values are current market observations.
Request the latest and historical yields
Latest yields for selected maturities
Use /latest to request the most recent available yields. The countries parameter is required; maturities accepts a comma-separated list and can be omitted to request all available maturities.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/latest?countries=TH&maturities=2Y,10Y"
{
"success": true,
"data": {
"TH": {
"2Y": { "yield": 4.25, "date": "2026-11-30", "source": "official" },
"10Y": { "yield": 4.52, "date": "2026-11-30", "source": "official" }
}
}
}
success indicates whether the request succeeded. Under data, country and maturity identify each observation; yield is the percentage, date is the observation date and source identifies its source. Check the date for each maturity before treating several values as one curve.
One yield on a specified date
Use /historical when a calculation must refer to a particular date. It requires the singular parameters country, maturity and date, with the date in YYYY-MM-DD format.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/historical?country=TH&maturity=10Y&date=2025-06-15"
{
"success": true,
"country": "TH",
"maturity": "10Y",
"date": "2025-06-15",
"yield": 4.38,
"source": "official"
}
Here, country, maturity and date describe the requested observation, while yield and source describe the returned value. A date is a calendar date, not a timestamp. The API reference lists a 404 response when no data exists for a requested country, maturity and date combination; do not assume a missing date is automatically filled from a previous session.
Analyze changes through time
Historical time series
The /timeseries endpoint requests one maturity over a date range. Supply country, maturity, start and end; the end date must be on or after the start date.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/timeseries?country=TH&maturity=10Y&start=2025-11-30&end=2026-11-30"
{
"success": true,
"country": "TH",
"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 entry in series has an observation date and a percentage yield. The reference’s series dates fall outside its example request range, so this response should not be treated as the result of that particular request. In an integration, validate returned dates against the requested window before using observations in a chart or calculation.
Time-series observations need not appear for every calendar day. Weekends, Thai market holidays and other data gaps can interrupt a series. Keep the original dates and decide explicitly whether an analysis requires missing values to remain missing or uses a documented carry-forward rule; a carried value is not a new market observation.
Intraday snapshots
For observations within a day, /intraday requires country, maturity and date.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/intraday?country=TH&maturity=10Y&date=2026-11-30"
{
"success": true,
"country": "TH",
"maturity": "10Y",
"date": "2026-11-30",
"snapshots": [
{ "yield": 4.51, "fetched_at": "2026-11-30T09:30:00Z", "source": "market" },
{ "yield": 4.53, "fetched_at": "2026-11-30T12:00:00Z", "source": "market" },
{ "yield": 4.52, "fetched_at": "2026-11-30T15:30:00Z", "source": "market" }
],
"count": 3,
"meta": { "timezone": "UTC" }
}
Each snapshot contains a percentage yield, its source and a fetched_at timestamp. The trailing Z denotes UTC, consistent with meta.timezone; convert timestamps for display without discarding the original UTC value. count is the number of snapshots returned. A fetch timestamp describes when the snapshot was fetched, not necessarily when a bond traded.
Period change and range
Use /fluctuation for a period summary. It takes 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=TH&maturity=10Y&start=2025-11-30&end=2026-11-30"
{
"success": true,
"maturity": "10Y",
"start": "2025-11-30",
"end": "2026-11-30",
"data": {
"TH": {
"start_yield": 4.21,
"end_yield": 4.52,
"change": 0.31,
"min": 3.87,
"max": 4.76
}
}
}
The response identifies the requested maturity and range, then provides the starting and ending yields, their change, and the period minimum and maximum. In this example, the change is 0.31 percentage points, or 31 basis points. For a research workflow, retain the underlying series when you need to inspect individual observations or establish how gaps affect the period calculation.
Build a Thailand curve and compare spreads
Curve across maturities
The /curve endpoint requires country and accepts an optional date. Without a date, 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=TH"
{
"success": true,
"country": "TH",
"date": "2026-11-30",
"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
}
}
date identifies the curve’s observation day, and curve maps maturity labels to percentage yields. inverted is the API’s curve-inversion indicator. The reference does not define its detection rule; if your application defines inversion using a particular maturity pair, calculate and label that result separately rather than assuming it uses the same rule.
You can also construct a partial curve from a single /latest request using multiple comma-separated maturities, as in the earlier 2Y and 10Y example. Verify that observations share an acceptable date, sort by actual term rather than alphabetically, and leave unavailable maturities absent. Do not silently interpolate or carry forward values unless the application states that methodology.
Spread against a benchmark
Use /spread to compare Thailand with a benchmark country at the same maturity. country and benchmark are required; maturity is optional and defaults to 10Y.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://bonds-api.com/api/v1/spread?country=TH&benchmark=US&maturity=10Y"
{
"success": true,
"country": "TH",
"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 the difference in basis points. In the example, 4.52 minus 2.37 is 2.15 percentage points, or 215 basis points. This response does not include observation dates, so a time-sensitive comparison should verify the underlying dates before presenting the spread as synchronized.
Integrate and operate the requests
The following Python sample calls the same latest endpoint shown above. It reads the returned maturity, yield, date and source rather than assuming that every requested maturity is present.
import os
import requests
response = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": os.environ["BONDS_API_KEY"]},
params={"countries": "TH", "maturities": "2Y,10Y"},
timeout=30,
)
response.raise_for_status()
payload = response.json()
if not payload.get("success"):
raise RuntimeError(payload.get("error", "Request failed"))
for maturity, observation in payload.get("data", {}).get("TH", {}).items():
print(
maturity,
observation["yield"],
observation["date"],
observation["source"],
)
Set BONDS_API_KEY in the runtime environment before running the script. Keep the key out of source control and application logs. The same GET and header pattern applies to the other endpoints, with their respective parameters and response shapes.
The reference identifies 401 for missing or invalid authentication, 403 for an account quota issue, 404 for unavailable data, 422 for invalid parameters, 429 for rate limiting and 500 for a server error. Check both the HTTP status and the response’s success field. Surface missing historical data differently from a bad key or a temporary server failure; retry transient failures with backoff rather than repeatedly sending an invalid request.
Choose caching according to the endpoint and your application’s freshness requirements. Historical results can be cached by country, maturity and date, while latest and intraday results generally need shorter refresh intervals. Store the observation date and fetch time alongside cached data, and allow for historical corrections. The reference does not specify an update schedule, so monitor returned timestamps or dates rather than promising a particular refresh frequency.
The documented requests do not include pagination parameters. For large research workloads, use the documented date ranges and test the returned data volume before scheduling repeated extractions. A dashboard can display latest maturities with observation dates; a risk tool can convert yield moves to basis points; and a research pipeline can retain dated series for reproducible analysis.
For programmatic access through the related interface, see MCP.
FAQ
Why might a historical Thailand request return no data?
The requested maturity or date may not be available. Weekends, market holidays and coverage gaps matter; handle a 404 explicitly rather than substituting an earlier observation without labeling it.
How do I convert a yield change to basis points?
Subtract the percentage yields and multiply the difference in percentage points by 100. Keep the sign so a rise and a fall remain distinguishable.
Can I request several Thai maturities together?
Yes. The latest endpoint accepts comma-separated maturities; the curve endpoint returns available curve points for a country. Check observation dates before combining points in an analysis.
Does a date field include a time zone?
A YYYY-MM-DD date identifies a calendar day, not a time of day. Intraday fetched_at values include timestamps, and the example identifies their timezone as UTC.
To get an API key and start testing the documented requests, Register. Confirm Thailand coverage and the dates you need before deploying your integration.