Historical Colombia government bond analysis depends on more than fetching a yield: you need to identify the maturity, preserve the observation date, handle non-trading days and distinguish a historical curve from a current snapshot. This guide explains the Bonds-API endpoints for those tasks and shows a documented request you can use to test an integration.
Colombia yields and the available example
A sovereign bond is debt issued by a government. Its yield is a measure of the return implied by its price and cash flows; yields at different maturities help analysts examine the term structure of borrowing costs. A historical series can support portfolio risk monitoring, economic research and fixed-income dashboards, provided observations are compared on a consistent basis.
The endpoint reference describes Colombia using the country code CO, but the supplied live sample says Colombia is not in the published catalog. Treat Colombia coverage as unconfirmed until you verify it with Bonds-API; a documented country code alone does not establish that a particular maturity or date is available. The executable sample below is the supplied US example, not a Colombia yield.
There is also an authentication discrepancy worth resolving before deployment. The endpoint reference specifies the X-API-Key header, while the supplied live example places the key in the query string. The example is reproduced as supplied; confirm the supported authentication method with Bonds-API before building a production client, and avoid exposing keys in URL logs.
Run the documented request
This request asks the latest endpoint for the US 10-year maturity. Replace YOUR_API_KEY with your key. It is a connection and response-parsing example, not a substitute for historical Colombia data.
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
The supplied response is:
{
"success": true,
"date": "2026-11-25",
"rates": {
"US_10Y": 4.917
},
"dates": {
"US_10Y": "2026-11-25"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "774ab656-969a-432e-850c-1b815fdeec10",
"timestamp": "2026-11-25T00:07:32+00:00"
}
}
success indicates whether the request succeeded. The value under rates.US_10Y is a yield expressed in percent, while dates.US_10Y identifies its observation date. The top-level date is also a calendar date; neither date should be interpreted as an intraday observation time.
currencies.US_10Y identifies the currency for the sampled instrument; it is not a currency conversion instruction. The response does not establish a currency for Colombia. In meta, request_id can help correlate a request, and timestamp is an ISO 8601 timestamp: its +00:00 offset denotes UTC.
The following Python example calls the same endpoint with the same parameters and reads the fields used above. Set the environment variable YOUR_API_KEY before running it. As with the supplied curl request, verify the authentication method before production use.
import os
import requests
response = requests.get(
"https://bonds-api.com/api/v1/latest",
params={
"countries": "US",
"maturities": "10Y",
"api_key": os.environ["YOUR_API_KEY"],
},
timeout=30,
)
response.raise_for_status()
payload = response.json()
if not payload.get("success"):
raise RuntimeError(payload.get("error", "Request failed"))
symbol = "US_10Y"
yield_percent = payload["rates"][symbol]
observation_date = payload["dates"][symbol]
currency = payload["currencies"][symbol]
response_timestamp = payload["meta"]["timestamp"]
print(symbol, yield_percent, observation_date, currency, response_timestamp)
The live sample uses a different response layout from the endpoint reference’s latest example, which nests results under data by country and maturity. Do not silently assume that both layouts are interchangeable. Confirm the response contract for your account and validate the fields before storing observations or calculating a curve.
Choose an endpoint for the analysis
All endpoints in the reference use GET. The historical, time-series and curve operations are useful for Colombia analysis if the requested data is available; the latest, spread, intraday and fluctuation operations add context for monitoring and comparison. The parameter names below follow the endpoint reference rather than the distinct live sample.
Latest yields: /api/v1/latest
Supply countries as a comma-separated list of ISO2 codes. Optionally supply comma-separated maturities; omitting that parameter requests all available maturities. For a Colombia application, CO is the code described in the reference, subject to the coverage qualification above.
The reference response has success and data. Inside data, each country contains maturity entries with yield, date and source. A dashboard should display the returned observation date next to each yield rather than assume that every maturity was updated on the same day.
One historical observation: /api/v1/historical
Supply country, maturity and date. The date uses Y-m-d format. This endpoint is appropriate when a risk report needs a specific maturity on a specific reporting date.
The reference response identifies the request with country, maturity and date, and provides yield and source alongside success. Store the returned date with the value. If a date has no data, do not silently substitute a nearby observation: the reference does not define a previous-business-day fallback.
Historical series: /api/v1/timeseries
Supply country, maturity, start and end; the end date must be on or after the start date. The response identifies the country and maturity and returns a series of entries containing date and yield.
Use each entry’s date as the time-series key, and check the returned observations before calculating changes or joining them to other datasets. A gap can reflect a weekend, market holiday or unavailable observation; the response alone may not establish which. Preserve missing observations as missing unless your analysis explicitly specifies an imputation rule.
Benchmark spread: /api/v1/spread
Supply country and benchmark as ISO2 codes. maturity is optional and defaults to 10Y. A Colombia-versus-US comparison, if available, should use the same maturity on both sides and should be interpreted in the context of the instruments and currencies involved.
The response includes country, benchmark, maturity, spread_bps, country_yield and benchmark_yield. Yields are percentages; the spread is in basis points, where one percentage point equals 100 basis points. The reference example expresses the spread as the country yield minus the benchmark yield, multiplied by 100.
Full curve: /api/v1/curve
Supply country and optionally date. When the date is omitted, the reference says the endpoint defaults to the latest available day with data. For historical analysis, provide the intended date and retain the returned date with the curve.
The response contains country, date, inverted and a curve mapping maturities to percentage yields. inverted is a curve-inversion indicator; the reference does not define the exact maturity comparison behind it. If an application needs a specific inversion rule, calculate and label that rule separately from the returned flag.
Intraday snapshots: /api/v1/intraday
Supply country, maturity and date. The response includes snapshots, count and meta.timezone, as well as the country, maturity and date. Each snapshot contains a yield, a fetched_at timestamp and a source.
Read fetched_at as the snapshot’s fetch time, not automatically as the time of a trade. The reference example uses timestamps ending in Z and identifies the timezone as UTC. Keep the timestamp and source with each value when charting intraday changes.
Period fluctuation: /api/v1/fluctuation
Supply countries, maturity, start and end, with the end date on or after the start date. The response echoes the maturity and period, then provides country entries under data.
Each country entry contains start_yield, end_yield, change, min and max. Interpret the yields and change in percentage-point terms; multiply a percentage-point change by 100 to express it in basis points. Confirm which observations underpin the period boundaries before reconciling the summary with a separately downloaded series.
Build and operate a historical curve workflow
A yield curve compares yields across maturities at a common point in time. The reference’s curve endpoint is the direct choice for a historical date; the multiple-maturity latest endpoint can instead provide a selected current set. Check that each requested maturity is present and that the returned observation dates are compatible before drawing a line between them.
Sort maturities by their actual term, not alphabetically, and label missing tenors rather than treating them as zero. The reference’s coverage spans maturities from short bills to long bonds across countries, but that does not guarantee every tenor for Colombia. Interpolation, if your application uses it, is an analytical choice and should be distinguished from an observed API value.
For historical changes, compare curves built with the same maturity set and a clearly stated date policy. For a spread, retain the underlying yields as well as the basis-point result. Differences in currency, instrument characteristics or observation dates can affect interpretation; a sovereign spread is not automatically a pure measure of credit risk.
Business days and market holidays matter for both scheduled reports and backtests. A calendar date in a request is not a promise that a market observation exists on that date. Define whether your report requires an exact match or an explicitly selected earlier observation, and retain the actual returned date so downstream users can see the distinction.
The reference does not specify an update frequency or a pagination contract. Choose a polling and caching policy based on the freshness your application needs, and confirm operational details with Bonds-API rather than assuming an intraday schedule or page format. Cache historical observations with their country, maturity and observation date; use shorter-lived caches for latest and intraday views, and allow for corrections to previously stored data.
Handle failures as data states rather than replacing them with yields. The reference lists 401 for a missing or invalid key, 403 for an account quota issue, 404 for an unavailable country/maturity/date combination, 422 for invalid parameters, 429 for rate limiting and 500 for a server error. Its common error body contains success=false and an error message.
Validate input before sending a request, avoid retrying invalid parameters unchanged, and use controlled retries for transient failures. Keep API keys out of source control and logs. The MCP link provides another way to explore the Bonds-API integration context.
FAQ
Can I retrieve historical Colombia yields now?
The reference describes CO, but the supplied live-sample note says Colombia is not in the published catalog. Verify coverage and the required maturity and dates with Bonds-API before relying on the integration.
How do I convert a yield change to basis points?
Subtract the earlier percentage yield from the later percentage yield, then multiply the percentage-point difference by 100. Keep the observation dates with the result.
What happens on a market holiday?
A requested date may have no observation. The reference does not specify an automatic fallback, so handle missing data explicitly and use a documented date-selection policy in reports.
Should I use the curve endpoint or several latest maturities?
Use curve when you need the available curve for a specified historical date. Use latest with multiple maturities for a selected current view, checking each returned maturity and date.
To obtain an API key and verify the data and authentication contract for your application, Register with Bonds-API.