Building a Greece sovereign yield curve inside your analytics stack typically requires consistent data across maturities, clear timestamps, and careful handling of market holidays. By the end of this guide, you will query Greece (GR) government bond yields from multiple endpoints on https://bonds-api.com, assemble a yield curve and spreads, and integrate results into Python, JavaScript, and PHP code with production-ready details on units, dates, caching, and update cadence.
What you can fetch for Greece and how yields are expressed
Bonds API serves Greece’s sovereign bond yields across short bills to long bonds via simple REST endpoints under https://bonds-api.com/api/v1/. All requests are GET-only. Authentication uses the X-API-Key header. Yields are returned as percentages (e.g., 4.52 means 4.52%), unless a field explicitly indicates basis points (bps). Dates are in Y-m-d, and timestamps (e.g., intraday fetched_at) are ISO-8601 in UTC.
Typical Greece maturities in the curve endpoint include 1M, 3M, 6M, 1Y, 2Y, 5Y, 10Y, and 30Y. Business-day and holiday effects apply: daily data won’t publish on Greek or major market holidays, so you should handle the latest available business day and gaps in time series.
Useful links for reference and testing:
Official live sample (verbatim)
The following curl and JSON block is provided from a live sample. Copying verbatim is useful to validate connectivity and response parsing in your environment.
curl -s "https://bonds-api.com/api/v1/latest?countries=US&maturities=10Y&api_key=YOUR_API_KEY"
{
"success": true,
"date": "2026-10-30",
"rates": {
"US_10Y": 4.928
},
"dates": {
"US_10Y": "2026-10-30"
},
"currencies": {
"US_10Y": "USD"
},
"meta": {
"request_id": "99eb2f77-fc32-4a0e-a303-09d9643a074a",
"timestamp": "2026-10-30T00:06:16+00:00"
}
}
Current Greece yields: GET /api/v1/latest
Use this endpoint to fetch the latest available yields for Greece. You can request multiple maturities in one call. Yields are percentages; the date field is the market date (Y-m-d) for that observation.
cURL
Python (requests)
import requests
resp = requests.get(
'https://bonds-api.com/api/v1/latest',
headers={'X-API-Key': 'YOUR_API_KEY'},
params={'countries': 'GR', 'maturities': '2Y,10Y'}
)
data = resp.json()
# data['data']['GR']['2Y']['yield'] is a percentage (e.g., 4.25)
# data['data']['GR']['2Y']['date'] is "YYYY-MM-DD"
print(data)
JavaScript (fetch)
const url = new URL('https://bonds-api.com/api/v1/latest');
url.search = new URLSearchParams({ countries: 'GR', maturities: '2Y,10Y' });
fetch(url, { headers: { 'X-API-Key': 'YOUR_API_KEY' } })
.then(r => r.json())
.then(d => {
const twoY = d.data.GR['2Y'].yield; // percent
const tenY = d.data.GR['10Y'].yield; // percent
console.log(twoY, tenY);
});
PHP
<?php
$context = stream_context_create([
'http' => [
'method' => 'GET',
'header' => "X-API-Key: YOUR_API_KEY\r\n"
]
]);
$query = http_build_query(['countries' => 'GR', 'maturities' => '2Y,10Y']);
$json = file_get_contents("https://bonds-api.com/api/v1/latest?$query", false, $context);
$data = json_decode($json, true);
echo $data['data']['GR']['10Y']['yield'];
?>
Sample JSON response
How to read this:
- yield: percentage value (e.g., 4.52 means 4.52%).
- date: Y-m-d market date for the observation, typically last business day.
- source: “official” indicates the primary market source.
Point-in-time Greece yield: GET /api/v1/historical
Retrieve the Greece yield for a specific maturity on a single date. Useful for backtests or audit.
cURL
Python (requests)
import requests
params = {'country': 'GR', '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)
print(r.json())
JavaScript (fetch)
const params = new URLSearchParams({ country: 'GR', maturity: '10Y', date: '2025-06-15' });
fetch(`https://bonds-api.com/api/v1/historical?${params}`, {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
}).then(r => r.json()).then(console.log);
PHP
<?php
$params = http_build_query(['country' => 'GR', 'maturity' => '10Y', 'date' => '2025-06-15']);
$opts = ['http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]];
$ctx = stream_context_create($opts);
echo file_get_contents("https://bonds-api.com/api/v1/historical?$params", false, $ctx);
?>
Sample JSON response
Field notes:
- yield: percentage at that date’s close or official report.
- date: target calendar date (Y-m-d). If it’s a holiday/weekend, expect no data (404 or nearest business-day logic in your app).
Time series for Greece: GET /api/v1/timeseries
Query daily yields between two dates for a single maturity. Missing dates usually represent weekends/holidays. Use to power charts or compute moving averages and vol.
cURL
Python (requests)
import requests
params = {
'country': 'GR',
'maturity': '10Y',
'start': '2025-10-30',
'end': '2026-10-30'
}
ts = requests.get('https://bonds-api.com/api/v1/timeseries',
headers={'X-API-Key': 'YOUR_API_KEY'},
params=params).json()
# ts['series'] is an array of {date, yield} with yields in percent
print(ts['series'][:3])
JavaScript (fetch)
const p = new URLSearchParams({
country: 'GR', maturity: '10Y', start: '2025-10-30', end: '2026-10-30'
});
fetch(`https://bonds-api.com/api/v1/timeseries?${p}`, {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
}).then(r => r.json()).then(d => {
// e.g., compute simple average
const avg = d.series.reduce((s, x) => s + x.yield, 0) / d.series.length;
console.log('avg', avg);
});
PHP
<?php
$p = http_build_query([
'country' => 'GR',
'maturity' => '10Y',
'start' => '2025-10-30',
'end' => '2026-10-30'
]);
$ctx = stream_context_create(['http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
echo file_get_contents("https://bonds-api.com/api/v1/timeseries?$p", false, $ctx);
?>
Sample JSON response
Each element is a Y-m-d and percentage yield pair. Use these to compute return proxies, DV01 shifts, or to drive sparkline charts.
Greece spread vs. benchmark: GET /api/v1/spread
Compute the spread between Greece and a benchmark like Germany (DE) or the US (US). spread_bps is in basis points. Maturity defaults to 10Y if omitted.
cURL
Python (requests)
import requests
params = {'country': 'GR', 'benchmark': 'US', 'maturity': '10Y'}
sp = requests.get('https://bonds-api.com/api/v1/spread',
headers={'X-API-Key': 'YOUR_API_KEY'},
params=params).json()
# sp['spread_bps'] is integer/float basis points, e.g. 215 bps
print(sp)
JavaScript (fetch)
const spParams = new URLSearchParams({ country: 'GR', benchmark: 'US', maturity: '10Y' });
fetch(`https://bonds-api.com/api/v1/spread?${spParams}`, {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
}).then(r => r.json()).then(d => {
console.log(`Spread: ${d.spread_bps} bps; GR ${d.country_yield}% vs US ${d.benchmark_yield}%`);
});
PHP
<?php
$q = http_build_query(['country' => 'GR', 'benchmark' => 'US', 'maturity' => '10Y']);
$ctx = stream_context_create(['http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
echo file_get_contents("https://bonds-api.com/api/v1/spread?$q", false, $ctx);
?>
Sample JSON response
Interpretation:
- spread_bps: Greece-10Y minus US-10Y, in basis points (1 bp = 0.01%).
- country_yield and benchmark_yield: both percentages aligned to the same market date.
Full Greece curve: GET /api/v1/curve
This endpoint builds the Greece yield curve across available maturities on a single date. Use it to interpolate a par curve, compute forward rates, or visualize term structure. The inverted flag signals whether shorter maturities exceed longer ones overall.
cURL
Python (requests)
import requests
curve = requests.get('https://bonds-api.com/api/v1/curve',
headers={'X-API-Key': 'YOUR_API_KEY'},
params={'country': 'GR'}).json()
# curve['curve'] is a dict from maturity string to percentage yield
print(curve)
JavaScript (fetch)
fetch('https://bonds-api.com/api/v1/curve?country=GR', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
}).then(r => r.json()).then(d => {
// Turn into sorted pairs for plotting
const order = ['1M','3M','6M','1Y','2Y','5Y','10Y','30Y'];
const points = order.filter(k => d.curve[k] !== undefined).map(k => [k, d.curve[k]]);
console.log(points);
});
PHP
<?php
$q = http_build_query(['country' => 'GR']);
$ctx = stream_context_create(['http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
$resp = file_get_contents("https://bonds-api.com/api/v1/curve?$q", false, $ctx);
echo $resp;
?>
Sample JSON response
All curve values are percentages for the stated maturities on a single date. If inverted is true, short-dated yields are higher than long-dated, signaling potential recession risk in some frameworks.
Viewing the curve at a glance
| Maturity | Yield (%) |
|---|---|
| 1M | 5.31 |
| 3M | 5.27 |
| 6M | 5.18 |
| 1Y | 4.98 |
| 2Y | 4.25 |
| 5Y | 4.39 |
| 10Y | 4.52 |
| 30Y | 4.71 |
Intraday Greece snapshots: GET /api/v1/intraday
Fetch multiple yield snapshots during a market day for a maturity. Useful for trading dashboards and monitoring moves. Timestamps are in UTC.
cURL
Python (requests)
import requests
p = {'country': 'GR', 'maturity': '10Y', 'date': '2026-10-30'}
intra = requests.get('https://bonds-api.com/api/v1/intraday',
headers={'X-API-Key': 'YOUR_API_KEY'},
params=p).json()
# Each snapshot has 'yield' (percent) and 'fetched_at' (UTC ISO-8601)
print(intra['snapshots'])
JavaScript (fetch)
const pi = new URLSearchParams({ country: 'GR', maturity: '10Y', date: '2026-10-30' });
fetch(`https://bonds-api.com/api/v1/intraday?${pi}`, {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
}).then(r => r.json()).then(d => {
d.snapshots.forEach(s => {
console.log(s.fetched_at, s.yield);
});
});
PHP
<?php
$p = http_build_query(['country' => 'GR', 'maturity' => '10Y', 'date' => '2026-10-30']);
$ctx = stream_context_create(['http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
echo file_get_contents("https://bonds-api.com/api/v1/intraday?$p", false, $ctx);
?>
Sample JSON response
Field notes:
- yield: percentage at the snapshot time.
- fetched_at: UTC ISO timestamp. Convert client-side for local display.
- count: number of snapshots returned.
Greece fluctuations over a window: GET /api/v1/fluctuation
Summarize change, min, and max yields between two dates for Greece. Use for risk summaries and alerting.
cURL
Python (requests)
import requests
params = {
'countries': 'GR',
'maturity': '10Y',
'start': '2025-10-30',
'end': '2026-10-30'
}
fl = requests.get('https://bonds-api.com/api/v1/fluctuation',
headers={'X-API-Key': 'YOUR_API_KEY'},
params=params).json()
delta_bps = fl['data']['GR']['change'] * 100 # change is in percentage points
print(fl, delta_bps)
JavaScript (fetch)
const f = new URLSearchParams({
countries: 'GR', maturity: '10Y', start: '2025-10-30', end: '2026-10-30'
});
fetch(`https://bonds-api.com/api/v1/fluctuation?${f}`, {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
}).then(r => r.json()).then(d => {
const stats = d.data.GR;
console.log(`Δ: ${stats.change} pp, min: ${stats.min}%, max: ${stats.max}%`);
});
PHP
<?php
$q = http_build_query([
'countries' => 'GR',
'maturity' => '10Y',
'start' => '2025-10-30',
'end' => '2026-10-30'
]);
$ctx = stream_context_create(['http' => ['method' => 'GET', 'header' => "X-API-Key: YOUR_API_KEY\r\n"]]);
echo file_get_contents("https://bonds-api.com/api/v1/fluctuation?$q", false, $ctx);
?>
Sample JSON response
Interpretation:
- change: percentage points over the period (e.g., 0.31 pp = 31 bps).
- min/max: range of observed daily yields (percent) in the interval.
Handling holidays, updates, and caching
Daily endpoints (latest, curve, historical, timeseries, fluctuation) reflect market business days. Expect no new data on Greek and major international market holidays. The intraday endpoint provides multiple UTC-stamped snapshots when markets are active.
Practical tips:
- Cache by date and country/maturity: Daily data is immutable once published, so cache keys like GR-10Y-2026-10-30 are safe.
- Retry logic: If you query for today’s date before close, you may not get final values; poll at intervals or fall back to the last business day.
- Time zones: Intraday times are UTC. Convert at the edge (UI or gateway) to avoid confusion.
- Gaps: Weekends and holidays result in missing dates in timeseries. Interpolate or forward-fill as appropriate to your risk model.
Building a Greece yield curve from multiple symbols
There are two approaches:
- Use /api/v1/curve for a cohesive, same-day set across maturities. This is the fastest path to a term structure.
- Use /api/v1/latest with the maturities parameter (e.g., 1Y,2Y,5Y,10Y,30Y) to retrieve selective points. Combine them into an ordered set and interpolate as needed (cubic spline, Nelson–Siegel, or simple linear between nodes).
Once you have the curve as maturity-yield pairs, you can:
- Compute spreads between any two points (e.g., 2s10s = 10Y − 2Y, in percent or convert to bps ×100).
- Fit curve models to derive zero rates or forwards.
- Monitor inversion by testing monotonicity across maturities or use the inverted flag from /curve.
Error handling and response validation
Bonds API uses consistent error shapes for common cases:
- 401: Missing or invalid X-API-Key.
- 403: Account quota exceeded.
- 404: No data for the requested country/maturity/date combination.
- 422: Invalid parameter (e.g., wrong date format; must be Y-m-d or unknown ISO2 code).
- 429: Rate limit exceeded; back off with exponential delay.
- 500: Server error; retry with jitter.
Always check success before using fields. For example, in Python:
data = resp.json()
if not data.get('success', False):
raise RuntimeError(data.get('error', 'Unknown error'))
Where Greece yields power real applications
- Financial dashboards: Display GR yield curve and intraday 10Y moves with alerts on threshold breaches.
- Portfolio risk tools: Feed GR timeseries into VaR and stress scenarios; use fluctuation for quick range checks.
- Economic research: Study regime shifts by comparing GR spreads versus US or DE benchmarks over time.
- Fixed income analytics: Fit Greece curve to derive discount factors for pricing local-risk cashflows.
Explore the endpoints and schema interactively in the MCP, then move to production with your own key from Register. The main site is here: bonds-api.com.
Appendix: Full endpoint coverage with quick references
- /api/v1/latest: Latest Greece yields for requested maturities. Percent yields; date as Y-m-d.
- /api/v1/historical: Point-in-time Greece yield for a maturity on a specific Y-m-d.
- /api/v1/timeseries: Daily series between start and end dates; percent yields.
- /api/v1/spread: Basis-point spread vs. a benchmark country at a given maturity.
- /api/v1/curve: Complete Greece term structure on a given date; includes inverted flag.
- /api/v1/intraday: Multiple UTC-stamped snapshots for a single day and maturity.
- /api/v1/fluctuation: Start/end yields, change (pp), and min/max across a period.
FAQ
Q1: What units are yields returned in?
A: All yield fields are in percent (e.g., 4.52 means 4.52%), unless a field name indicates basis points (e.g., spread_bps).
Q2: How should I handle missing data on weekends or holidays?
A: Query the latest available business day when daily updates aren’t published. For time series, expect gaps; forward-fill or interpolate only if it aligns with your methodology.
Q3: Do intraday timestamps reflect local market time?
A: No. Intraday fetched_at fields are UTC ISO-8601. Convert to your display timezone on the client side.
Q4: Can I request multiple Greece maturities in one call?
A: Yes, via /api/v1/latest with the maturities parameter (e.g., 2Y,5Y,10Y). For a comprehensive set, use /api/v1/curve.
Q5: What’s the difference between change (pp) and spread_bps?
A: change is in percentage points over time (e.g., 0.31 pp = 31 bps), while spread_bps explicitly returns a cross-country spread in basis points at a point in time.
Ship your Greece yield integrations today. Get an API key from Register and explore endpoints interactively in the MCP. For more, visit bonds-api.com.