Mexico 10Y Sovereign Yields: Latest and Curve via API

Mexico 10Y Sovereign Yields: Latest and Curve via API

You need reliable, machine-readable Mexico 10-year sovereign yields to power pricing, risk, or macro dashboards. By the end of this guide, you’ll be able to fetch the latest MX 10Y, retrieve historical points, stream intraday snapshots, compute spreads, and assemble a full Mexico yield curve via simple GET calls to Bonds API — all with copy-pasteable code.

What you’ll build: Mexico 10Y yields, curves, and spreads via REST

Bonds API serves sovereign bond yields for 60+ countries as JSON over HTTPS. For Mexico (ISO2: MX), you can query the 10-year benchmark directly, pull a time series for model calibration, and build a yield curve by fetching multiple maturities. Every endpoint uses GET and authenticates with an X-API-Key header.

Illustration: Mexico 10Y Sovereign Yields: Latest and Curve via API

Yields are returned as percentages (e.g., 4.52 means 4.52%). Spreads are returned in basis points (bps). Dates are YYYY-MM-DD. Intraday timestamps are ISO 8601 with a trailing Z (UTC).

Helpful links:

API essentials you’ll use for Mexico 10Y

  • Base URL: https://bonds-api.com/api/v1/
  • Auth: X-API-Key: YOUR_API_KEY
  • HTTP method: GET for all endpoints

We will cover all seven endpoints and how to apply them to Mexico (MX): latest, historical, time series, spread vs benchmark, yield curve, intraday snapshots, and fluctuation analytics.

Endpoint: Latest yields for Mexico (MX)

Fetch current yields for selected maturities in one request. For building a spot MX curve or a dashboard, request 2Y and 10Y simultaneously.

cURL

curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"

JSON response (official sample)

{
"success": true,
"date": "2026-10-02",
"rates": {
"US_10Y": 5.28
},
"dates": {
"US_10Y": "2026-10-02"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "c88aa2d4-e0a1-4db5-8383-160904de93ba",
"timestamp": "2026-10-04T00:04:04+00:00"
}
}

How to read:

  • yield: percentage (e.g., 4.52 means 4.52%)
  • date: market date in YYYY-MM-DD
  • source: data provenance, e.g., “official”

Python

import requests

resp = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "MX", "maturities": "2Y,10Y"}
)
data = resp.json()
mx_10y = data["data"]["MX"]["10Y"]["yield"]
mx_10y_date = data["data"]["MX"]["10Y"]["date"]
print("MX 10Y:", mx_10y, "on", mx_10y_date)

JavaScript (fetch)

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

fetch(url.toString(), {
method: "GET",
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(json => {
const mx10y = json.data.MX["10Y"].yield;
const mx10yDate = json.data.MX["10Y"].date;
console.log("MX 10Y:", mx10y, "on", mx10yDate);
});

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=MX&maturities=2Y,10Y";
$response = file_get_contents($url, false, $context);
$data = json_decode($response, true);
$mx10y = $data["data"]["MX"]["10Y"]["yield"];
$mx10yDate = $data["data"]["MX"]["10Y"]["date"];
echo "MX 10Y: $mx10y on $mx10yDate\n";

Endpoint: Historical yield for Mexico 10Y on a given date

Use this to retrieve a specific daily fixing (e.g., for backfilling or building event studies).

cURL

JSON response (official sample)

Fields:

  • yield: percentage at the daily close for that date
  • date: requested YYYY-MM-DD
  • source: “official” indicates the feed origin

Python

import requests

params = {"country": "MX", "maturity": "10Y", "date": "2025-06-15"}
r = requests.get("https://bonds-api.com/api/v1/historical",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
j = r.json()
print("MX", j["maturity"], "on", j["date"], "=", j["yield"], "%")

JavaScript (fetch)

const p = { country: "MX", maturity: "10Y", date: "2025-06-15" };
const u = "https://bonds-api.com/api/v1/historical?" + new URLSearchParams(p);

fetch(u, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => console.log(`MX ${j.maturity} on ${j.date} = ${j.yield}%`));

PHP

<?php
$q = http_build_query(["country" => "MX", "maturity" => "10Y", "date" => "2025-06-15"]);
$ctx = stream_context_create(["http" => ["method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$res = file_get_contents("https://bonds-api.com/api/v1/historical?$q", false, $ctx);
$j = json_decode($res, true);
echo "MX {$j['maturity']} on {$j['date']} = {$j['yield']}%\n";

Endpoint: Time series for Mexico 10Y

Retrieve a continuous daily series between two dates for modeling, beta estimation, or drawdowns.

cURL

JSON response (official sample)

Each entry contains:

  • date: business days only; market holidays/weekends are skipped
  • yield: percentage close for that date

Python

import requests, pandas as pd

params = {"country": "MX", "maturity": "10Y", "start": "2025-10-04", "end": "2026-10-04"}
r = requests.get("https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"}, params=params)
j = r.json()
df = pd.DataFrame(j["series"]) # columns: date (str), yield (float)
print(df.head())

JavaScript (fetch)

const params = { country: "MX", maturity: "10Y", start: "2025-10-04", end: "2026-10-04" };
const urlTS = "https://bonds-api.com/api/v1/timeseries?" + new URLSearchParams(params);

fetch(urlTS, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
const series = j.series.map(p => [p.date, p.yield]);
console.log(series.slice(0, 3));
});

PHP

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

Endpoint: Spread vs benchmark (Mexico vs US 10Y)

Compute Mexico’s 10Y spread to a benchmark such as the US Treasury. Output is in basis points (1 bp = 0.01%).

cURL

JSON response (official sample)

Interpretation:

  • spread_bps: Mexico 10Y yield minus US 10Y yield in basis points
  • country_yield, benchmark_yield: both in percent

Python

import requests

p = {"country": "MX", "benchmark": "US", "maturity": "10Y"}
r = requests.get("https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"}, params=p)
j = r.json()
print(f"MX vs US {j['maturity']} spread: {j['spread_bps']} bps (MX={j['country_yield']}%, US={j['benchmark_yield']}%)")

JavaScript (fetch)

const p2 = { country: "MX", benchmark: "US", maturity: "10Y" };
const u2 = "https://bonds-api.com/api/v1/spread?" + new URLSearchParams(p2);

fetch(u2, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => console.log(`MX vs US ${j.maturity} = ${j.spread_bps} bps`));

PHP

<?php
$q = http_build_query(["country" => "MX", "benchmark" => "US", "maturity" => "10Y"]);
$ctx = stream_context_create(["http" => ["method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$res = file_get_contents("https://bonds-api.com/api/v1/spread?$q", false, $ctx);
$j = json_decode($res, true);
echo "MX vs US {$j['maturity']}: {$j['spread_bps']} bps (MX={$j['country_yield']}%, US={$j['benchmark_yield']}%)\n";

Endpoint: Full Mexico yield curve

Pull the on-the-run curve across standard bills and bonds in one call. Great for discounting, interpolation, and curve shape monitoring.

cURL

JSON response (official sample)

Fields:

  • date: curve date (business day)
  • inverted: boolean indicating negative short–long slope
  • curve: dictionary of maturity → yield (%)

Curve snapshot

MaturityYield (%)
1M5.31
3M5.27
6M5.18
1Y4.98
2Y4.25
5Y4.39
10Y4.52
30Y4.71

Python

import requests

r = requests.get("https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "MX"})
j = r.json()
tenor10 = j["curve"]["10Y"]
print("Curve date:", j["date"], "| MX 10Y:", tenor10, "%", "| Inverted:", j["inverted"])

JavaScript (fetch)

const u3 = "https://bonds-api.com/api/v1/curve?country=MX";
fetch(u3, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
console.log("Curve date:", j.date, "MX 10Y:", j.curve["10Y"], "Inverted:", j.inverted);
});

PHP

<?php
$ctx = stream_context_create(["http" => ["method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$res = file_get_contents("https://bonds-api.com/api/v1/curve?country=MX", false, $ctx);
$j = json_decode($res, true);
echo "Curve " . $j["date"] . " | 10Y=" . $j["curve"]["10Y"] . "% | Inverted=" . ($j["inverted"] ? "true" : "false") . "\n";

Endpoint: Intraday snapshots for Mexico 10Y

For trading UIs and alerting, retrieve multiple intraday observations (UTC) for the requested date and maturity.

cURL

JSON response (official sample)

Fields:

  • snapshots[].yield: percent at snapshot time
  • snapshots[].fetched_at: ISO 8601 UTC timestamp (Z)
  • count: number of snapshots returned
  • meta.timezone: “UTC”

Python

import requests, statistics

p = {"country": "MX", "maturity": "10Y", "date": "2026-10-04"}
r = requests.get("https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"}, params=p)
j = r.json()
yields = [s["yield"] for s in j["snapshots"]]
print("Intraday count:", j["count"], "| mean(%)=", round(statistics.mean(yields), 4))

JavaScript (fetch)

const p3 = { country: "MX", maturity: "10Y", date: "2026-10-04" };
const u4 = "https://bonds-api.com/api/v1/intraday?" + new URLSearchParams(p3);

fetch(u4, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
const ys = j.snapshots.map(s => s.yield);
const avg = ys.reduce((a,b)=>a+b, 0) / (ys.length || 1);
console.log("Intraday snapshots:", j.count, "Avg:", avg.toFixed(4), "Timezone:", j.meta.timezone);
});

PHP

<?php
$q = http_build_query(["country" => "MX", "maturity" => "10Y", "date" => "2026-10-04"]);
$ctx = stream_context_create(["http" => ["method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$res = file_get_contents("https://bonds-api.com/api/v1/intraday?$q", false, $ctx);
$j = json_decode($res, true);
foreach ($j["snapshots"] as $s) {
echo $s["fetched_at"] . " " . $s["yield"] . "% (" . $s["source"] . ")\n";
}

Endpoint: Fluctuation analytics for Mexico 10Y

Summarize change, min, and max over a period — ideal for performance summaries and risk digests.

cURL

JSON response (official sample)

Fields:

  • start_yield, end_yield: period endpoints (percent)
  • change: end minus start (percentage points)
  • min, max: extrema within the window

Python

import requests

p = {"countries": "MX", "maturity": "10Y", "start": "2025-10-04", "end": "2026-10-04"}
r = requests.get("https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"}, params=p)
j = r.json()
mx = j["data"]["MX"]
print(f"MX 10Y: start={mx['start_yield']}%, end={mx['end_yield']}%, Δ={mx['change']}pp, min={mx['min']}%, max={mx['max']}%")

JavaScript (fetch)

const p4 = { countries: "MX", maturity: "10Y", start: "2025-10-04", end: "2026-10-04" };
const u5 = "https://bonds-api.com/api/v1/fluctuation?" + new URLSearchParams(p4);

fetch(u5, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
const mx = j.data.MX;
console.log(`Δ=${mx.change}pp, range=[${mx.min}, ${mx.max}]`);
});

PHP

<?php
$q = http_build_query(["countries" => "MX", "maturity" => "10Y", "start" => "2025-10-04", "end" => "2026-10-04"]);
$ctx = stream_context_create(["http" => ["method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$res = file_get_contents("https://bonds-api.com/api/v1/fluctuation?$q", false, $ctx);
$j = json_decode($res, true);
$mx = $j["data"]["MX"];
echo "Start={$mx['start_yield']} End={$mx['end_yield']} Change={$mx['change']} Min={$mx['min']} Max={$mx['max']}\n";

Business days, updates, caching, and error handling

Bonds settle on business days and follow local market calendars. Daily endpoints return values for business days; weekends and market holidays are omitted. Intraday snapshots are timestamps in UTC, so plan any local-time conversions as needed.

Update frequency depends on the feed type noted in the source field (e.g., “official”, “market”). For dashboards, cache latest responses for a minute or two; for batch analytics, caching per business date avoids redundant calls.

Handle common HTTP errors using the unified error shape success=false and error=message:

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

Retry idempotent GETs on 429/500 with backoff. Validate parameters before requests. For batch series, prefer timeseries over looping historical calls.

Building a Mexico yield curve for valuation

Two options:

  • Single-call curve: Use /curve to get a full on-the-run set in one payload (includes flags like inverted).
  • Manual composition: Use /latest with maturities to select only the points you need (e.g., 2Y, 5Y, 10Y, 30Y) and fit an interpolator in your app.

When pricing, keep yields as percentages. If your pricer uses decimals, convert 4.52% to 0.0452. Document the curve date and ensure all tenors refer to the same day to avoid mixing stale points.

Real-world use cases for Mexico 10Y

  • Financial dashboards: show MX 10Y with daily change and intraday ticks; add spread to US 10Y for context.
  • Portfolio risk: compute VaR shocks using /timeseries; stress with min/max from /fluctuation.
  • Macro research: monitor curve shape via /curve and detect inversion regimes; track re-pricing of policy rates along the front-end.
  • Relative value: plot MX–US spread and regress against FX or oil beta using synchronized business dates.

Explore more on bonds-api.com, and use the MCP to orchestrate your models: MCP.

Official live sample blocks (verbatim)

The following official sample illustrates a live latest-rates call and response schema for a US 10Y data point. Copying these verbatim ensures consistency with the documented shapes provided below.

Field notes:

  • rates: percent yield (e.g., 5.28 means 5.28%)
  • date/dates: daily fixing date(s)
  • currencies: base currency for the instrument (USD)
  • meta.timestamp: ISO 8601 with offset; UTC-equivalent timing

Sovereign bond fundamentals (fast context)

Sovereign bonds are government-issued debt across maturities from bills (months) to long bonds (decades). The yield reflects market-implied cost of capital, policy expectations, and term/risk premia. Analysts track the 10Y as a liquid benchmark for discounting and macro signaling. Curve shape (e.g., inversion) informs growth and inflation regime assessments.

Putting it together: a minimal MX 10Y dashboard loop

A simple polling workflow for a dashboard could be:

  1. Call /latest for MX 10Y every minute, cache the response, and display yield and date.
  2. Call /spread vs US 10Y to show relative value in bps.
  3. On click, load /timeseries for the last 12 months and chart it.
  4. For the curve page, call /curve once per business day and annotate inverted state.
  5. Provide a “Today” tab that calls /intraday to plot snapshot ticks in UTC.

All calls are GET and authenticated with X-API-Key. When the market is closed, latest will continue to show the most recent business date, allowing you to maintain a stable view.

Practical implementation notes that save time

  • Units: Yields are percentages; spreads are basis points. Convert consistently before math.
  • Dates: Daily endpoints use YYYY-MM-DD; intraday timestamps use Z (UTC). Align timezones in charts.
  • Business calendars: Time series will skip weekends and holidays; don’t “forward-fill” blindly in analytics.
  • Caching: Cache latest/curve for a minute or two; cache time series by date ranges to avoid re-downloads.
  • Error handling: Parse JSON error messages on non-2xx; back off on 429/500; validate params to avoid 422.
  • Benchmarking: For spreads, explicitly set maturity to 10Y (default is 10Y) to keep apples-to-apples.

FAQ

How are yields expressed?
All yields are percentages. A value of 4.52 means 4.52%. For spread calculations, spread_bps is basis points; 100 bps = 1.00 percentage points.

What timezone are timestamps in?
Dates are YYYY-MM-DD (market dates). Intraday fetched_at timestamps are UTC (Z). Use the meta.timezone field where present.

How do I handle missing days?
Weekends and market holidays are omitted from daily series. If you need contiguous calendar days, reindex your series and forward-fill carefully, or restrict to business days.

Can I build a curve from selected maturities only?
Yes. Use /latest with countries=MX and maturities like 2Y,5Y,10Y,30Y. For the full official set in one call, use /curve.

What errors should I expect and how to recover?
Expect 401 for missing/invalid key, 422 for bad params, 404 for unavailable combinations, 429 for rate limits, and 500 for server errors. Implement retries with exponential backoff for 429/500 and fix inputs for 422.

Ready to integrate Mexico 10Y yields and curves into your stack? Get an API key and start calling the endpoints today: Register. Explore orchestration and modeling tools at Bonds API MCP and the docs on bonds-api.com.

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.