You need reliable, developer-friendly access to India’s sovereign yield curve—for dashboards, models, and risk systems. By the end of this article you will be able to fetch the latest Indian government bond yields, reconstruct full curves, compute spreads, pull historical and intraday snapshots, and cache the data correctly using the Bonds API.
What Indian sovereign yields represent and how they’re returned
The Bonds API delivers Indian government bond yields as percentages (not basis points) at standard maturities from short-term bills (1M, 3M, 6M) through long-dated bonds (up to 30Y; coverage can vary day by day). Unless a field explicitly ends in _bps, treat the numeric values as yields in percent. Dates are in Y-m-d (e.g., 2026-10-23). Timestamps are ISO 8601 in UTC (e.g., 2026-10-23T12:00:00Z).
India’s primary trading days follow Indian business days; yields for non-trading days will reflect the latest available official or market source. Updates typically occur during the active trading day and end-of-day, but frequency may vary depending on the maturity and data source noted by the source field. For integration details and to get an API key, visit bonds-api.com and Get started with Bonds API.
Key maturities for India and how to build the curve
The API exposes a range of Indian sovereign maturities, which can include bills and bonds such as 1M, 3M, 6M, 1Y, 2Y, 5Y, 10Y, and 30Y. To build a curve, use the Curve endpoint to get all available tenors for a single date, or query latest yields across specific maturities if you want a subset for faster loads or a particular analysis.
| Maturity | Typical Use | Data Field |
|---|---|---|
| 1M–6M | Short-term funding, bill yields | curve["1M"], curve["3M"], curve["6M"] |
| 1Y–5Y | Front/middle of curve, policy expectations | curve["1Y"], curve["2Y"], curve["5Y"] |
| 10Y | Benchmark long-term rate | curve["10Y"] |
| 30Y | Long-dated liabilities, pension discounting | curve["30Y"] |
Authentication, HTTP and base URL
All endpoints are HTTP GET calls under the base URL https://bonds-api.com/api/v1/. Authenticate with your API key using the X-API-Key header. Do not send the key as a query parameter.
- Base URL: https://bonds-api.com/api/v1/
- HTTP Method: GET
- Header: X-API-Key: YOUR_API_KEY
You can explore endpoints interactively in the Bonds API MCP and the developer-focused MCP console.
Endpoint: Latest yields (current levels)
Use this to fetch the latest available yields for India across selected maturities. If you omit the maturities parameter, the API returns all available tenors for the country.
cURL
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
JSON response
{
"success": true,
"date": "2026-10-23",
"rates": {
"US_10Y": 4.949
},
"dates": {
"US_10Y": "2026-10-23"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "7549f0d1-58eb-4a9b-bf6b-10a7b184dd0c",
"timestamp": "2026-10-23T00:05:52+00:00"
}
}
How to read this:
- data.IN.2Y.yield and data.IN.10Y.yield are yields in percent.
- date is the observation date (Y-m-d); may be the most recent business day.
- source describes the provenance (e.g., official).
Python (requests)
import requests
resp = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "IN", "maturities": "2Y,10Y"}
)
data = resp.json()
in_2y = data["data"]["IN"]["2Y"]["yield"]
in_10y = data["data"]["IN"]["10Y"]["yield"]
print("IN 2Y:", in_2y, "IN 10Y:", in_10y)
JavaScript (fetch)
const url = new URL("https://bonds-api.com/api/v1/latest");
url.searchParams.set("countries", "IN");
url.searchParams.set("maturities", "2Y,10Y");
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
const in2y = j.data.IN["2Y"].yield;
const in10y = j.data.IN["10Y"].yield;
console.log("IN 2Y", in2y, "IN 10Y", in10y);
});
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=IN&maturities=2Y,10Y";
$json = file_get_contents($url, false, $context);
$data = json_decode($json, true);
echo "IN 10Y: " . $data["data"]["IN"]["10Y"]["yield"] . PHP_EOL;
Endpoint: Historical (yield on a specific date)
Retrieve a single Indian yield for a given maturity and date. This helps you pin a valuation date for backtesting or accounting.
cURL
JSON response
Interpretation:
- yield is a percent level for the requested date; if the date is a non-business day, expect the nearest available observation.
- source clarifies whether the figure comes from an official or market feed.
Python
import requests
r = requests.get(
"https://bonds-api.com/api/v1/historical",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "IN", "maturity": "10Y", "date": "2025-06-15"}
)
j = r.json()
print(j["date"], j["maturity"], j["yield"])
JavaScript
const u = new URL("https://bonds-api.com/api/v1/historical");
u.searchParams.set("country", "IN");
u.searchParams.set("maturity", "10Y");
u.searchParams.set("date", "2025-06-15");
fetch(u, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => console.log(j.date, j.maturity, j.yield));
PHP
<?php
$ctx = stream_context_create(['http' => [
'method' => 'GET',
'header' => "X-API-Key: YOUR_API_KEY\r\n"
]]);
$url = "https://bonds-api.com/api/v1/historical?country=IN&maturity=10Y&date=2025-06-15";
echo file_get_contents($url, false, $ctx);
Endpoint: Time series (between two dates)
Build historical charts or run regressions using a clean daily series for a single maturity.
cURL
JSON response
Interpretation:
- series is an array of daily records with date (Y-m-d) and yield (percent).
- Holidays and weekends will be absent or represented by the closest available date depending on data source latency.
Python
import requests, pandas as pd
r = requests.get(
"https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "IN", "maturity": "10Y", "start": "2025-10-23", "end": "2026-10-23"}
)
s = r.json()["series"]
df = pd.DataFrame(s).set_index("date").astype({"yield":"float"})
print(df.head())
JavaScript
const ts = new URL("https://bonds-api.com/api/v1/timeseries");
ts.searchParams.set("country", "IN");
ts.searchParams.set("maturity", "10Y");
ts.searchParams.set("start", "2025-10-23");
ts.searchParams.set("end", "2026-10-23");
fetch(ts, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => console.log(j.series.length, "points"));
PHP
<?php
$ctx = stream_context_create(['http' => [
'method' => 'GET',
'header' => "X-API-Key: YOUR_API_KEY\r\n"
]]);
$u = "https://bonds-api.com/api/v1/timeseries?country=IN&maturity=10Y&start=2025-10-23&end=2026-10-23";
echo file_get_contents($u, false, $ctx);
Endpoint: Spread versus benchmark
Calculate the India-United States 10Y spread in basis points for cross-market analysis and relative value screens.
cURL
JSON response
Interpretation:
- spread_bps is the yield difference in basis points (1 bp = 0.01%).
- country_yield and benchmark_yield are percent yields for India and the US, respectively.
Python
import requests
r = requests.get(
"https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "IN", "benchmark": "US", "maturity": "10Y"}
)
j = r.json()
print(f"IN–US 10Y spread: {j['spread_bps']} bps")
JavaScript
const sp = new URL("https://bonds-api.com/api/v1/spread");
sp.searchParams.set("country", "IN");
sp.searchParams.set("benchmark", "US");
sp.searchParams.set("maturity", "10Y");
fetch(sp, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => console.log("Spread (bps):", j.spread_bps));
PHP
<?php
$ctx = stream_context_create(['http' => [
'method' => 'GET',
'header' => "X-API-Key: YOUR_API_KEY\r\n"
]]);
$u = "https://bonds-api.com/api/v1/spread?country=IN&benchmark=US&maturity=10Y";
echo file_get_contents($u, false, $ctx);
Endpoint: Full yield curve (one call)
Fetch an entire Indian curve for the latest available date, or specify a date for historical curve analysis. Use this to populate charts and to derive forwards, par curves, or interpolated tenors.
cURL
JSON response
Interpretation:
- curve contains tenors as keys and yields as percent values.
- inverted indicates whether the curve is downward sloping from short to long maturities.
- date is the curve observation date in Y-m-d.
Python
import requests
r = requests.get(
"https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "IN"}
)
curve = r.json()["curve"]
tenors = sorted(curve.keys(), key=lambda k: ["M","Y"].index(k[-1]) if k[-1] in "MY" else 2)
print([(t, curve[t]) for t in tenors])
JavaScript
const cu = new URL("https://bonds-api.com/api/v1/curve");
cu.searchParams.set("country", "IN");
fetch(cu, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => console.log("Curve date:", j.date, "Tenors:", Object.keys(j.curve)));
PHP
<?php
$ctx = stream_context_create(['http' => [
'method' => 'GET',
'header' => "X-API-Key: YOUR_API_KEY\r\n"
]]);
$u = "https://bonds-api.com/api/v1/curve?country=IN";
echo file_get_contents($u, false, $ctx);
Endpoint: Intraday snapshots
For real-time dashboards or trading tools, fetch multiple snapshots within a day for a specific maturity. Times are UTC.
cURL
JSON response
Interpretation:
- snapshots[].yield is percent; fetched_at is an ISO 8601 UTC timestamp.
- Use count to sanity-check completeness; meta.timezone clarifies timestamp basis.
Python
import requests, datetime as dt
r = requests.get(
"https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "IN", "maturity": "10Y", "date": "2026-10-23"}
)
j = r.json()
for s in j["snapshots"]:
print(s["fetched_at"], s["yield"])
JavaScript
const iday = new URL("https://bonds-api.com/api/v1/intraday");
iday.searchParams.set("country", "IN");
iday.searchParams.set("maturity", "10Y");
iday.searchParams.set("date", "2026-10-23");
fetch(iday, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => j.snapshots.forEach(s => console.log(s.fetched_at, s.yield)));
PHP
<?php
$ctx = stream_context_create(['http' => [
'method' => 'GET',
'header' => "X-API-Key: YOUR_API_KEY\r\n"
]]);
$u = "https://bonds-api.com/api/v1/intraday?country=IN&maturity=10Y&date=2026-10-23";
echo file_get_contents($u, false, $ctx);
Endpoint: Fluctuation (change, min, max)
Summarize yield changes over a period, including start value, end value, absolute change (percent), and min/max during the window. Supports multiple countries; here we isolate India for 10Y.
cURL
JSON response
Interpretation:
- All values are percent, except that change is the arithmetic difference in percent points.
- Use this for performance reports, VaR windows, or alert thresholds.
Python
import requests
r = requests.get(
"https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "IN", "maturity": "10Y", "start": "2025-10-23", "end": "2026-10-23"}
)
j = r.json()
f = j["data"]["IN"]
print("Δ(10Y) = ", f["change"], "pp; range:", f["min"], "-", f["max"])
JavaScript
const fl = new URL("https://bonds-api.com/api/v1/fluctuation");
fl.searchParams.set("countries", "IN");
fl.searchParams.set("maturity", "10Y");
fl.searchParams.set("start", "2025-10-23");
fl.searchParams.set("end", "2026-10-23");
fetch(fl, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
const f = j.data.IN;
console.log("Start", f.start_yield, "End", f.end_yield, "Change", f.change);
});
PHP
<?php
$ctx = stream_context_create(['http' => [
'method' => 'GET',
'header' => "X-API-Key: YOUR_API_KEY\r\n"
]]);
$u = "https://bonds-api.com/api/v1/fluctuation?countries=IN&maturity=10Y&start=2025-10-23&end=2026-10-23";
echo file_get_contents($u, false, $ctx);
Handling dates, market holidays, updates, and caching
Dates are always Y-m-d. On weekends and Indian market holidays, latest endpoints may report the most recent trading day’s values, flagged by the associated date field. Intraday snapshots provide UTC timestamps, so convert to your local timezone for display but store as UTC for consistency.
Update frequency varies by maturity and source; if you build a polling loop, use conditional fetching (e.g., if the last-observed date or timestamp has not changed, skip downstream computations). Cache responses keyed by (endpoint, params) and add a short TTL during trading hours; for end-of-day archives, a longer TTL is reasonable. Handle errors by inspecting the standard error schema fields and responding accordingly.
Error handling
Common errors include:
- 401 Unauthorized: missing or invalid X-API-Key header.
- 403 Quota exceeded: pause or reduce polling frequency, then retry later.
- 404 Not found: check ISO2 code (IN), maturity string (e.g., 10Y), or the requested date.
- 422 Invalid parameter: verify date format Y-m-d and supported maturities.
- 429 Rate limit exceeded: backoff and retry with jitter.
- 500 Server error: use retry with exponential backoff and circuit breaking.
Include minimal retries with exponential backoff and respect 429 responses. For historical backfills, partition requests by month or quarter if necessary to ensure predictable throughput.
Real-world uses
- Financial dashboards: Plot the Indian curve from 1M to 30Y using the Curve endpoint; highlight inversion state and key slope spreads (2s10s, 5s30s).
- Portfolio risk tools: Poll the Latest endpoint for 2Y and 10Y to compute hedge ratios and DV01 approximations; summarize changes with Fluctuation.
- Economic research: Pull long time series for 10Y India bonds, run regressions versus macro indicators, and compare IN vs US using Spread to analyze risk premia.
- Alerting: Use Intraday to detect threshold breaches (e.g., 10Y crosses a defined level) and notify portfolio managers in real time.
Find more details at bonds-api.com and explore interactively in the Bonds API MCP.
Putting it together: building India’s curve and spreads step by step
1) Load the full curve
Call the Curve endpoint for IN to get a complete tenor set and check inverted. This single response can populate a curve chart and a tenor table.
2) Track key benchmarks
Use Latest for 2Y and 10Y to compute slope spreads (e.g., 10Y − 2Y). Cache with a short TTL (e.g., 30–60 seconds during market hours) to balance freshness and rate limits.
3) Compare to the US market
Use the Spread endpoint with benchmark=US to get IN–US differentials in basis points; this is useful for global macro dashboards and currency-hedged return analysis.
4) Contextualize with history
Fetch the Time series and Fluctuation endpoints for 10Y (or other maturities) to compute rolling min/max and visualize where current yields sit relative to the past year.
5) Add intraday monitoring
Use Intraday snapshots for day-trading views or to validate closing moves with multiple timestamps in UTC.
FAQ
What units are yields in?
Yields are percentages (e.g., 4.52 means 4.52%). Only fields explicitly ending in _bps (like spread_bps) are basis points.
How do I handle non-trading days for India?
The Latest and Curve endpoints return the most recent available observation date. Always read and display the date field to communicate the data’s effective date.
What timezone are intraday timestamps in?
UTC. Use meta.timezone and the ISO 8601 fetched_at string for precise time handling. Convert to your users’ local time for UI while storing UTC internally.
Can I request multiple countries at once?
Yes, Latest and Fluctuation support comma-separated lists in countries. For India-only analytics, set countries=IN.
What’s the best way to cache?
Cache by endpoint and parameters with short TTLs during active hours (e.g., 30–120 seconds) and longer TTLs for historical data. Invalidate when the date or timestamp changes.
Ready to integrate India’s sovereign yield curve into your stack? Get an API key and start building today: Register. You can also explore endpoints live in the MCP. For quick access, use these as well: Register for Bonds API and Bonds API MCP.