API to Get Poland Bond Yields

API to Get Poland Bond Yields

Quant teams and fintech developers working with Polish sovereign debt often struggle to source consistent, up-to-date yields across the full curve, query past dates for backtests, and compute spreads versus benchmarks without stitching multiple feeds. By the end of this article, you will be able to pull current Poland government bond yields, query historical and intraday data, build yield curves, and compute spreads vs. a benchmark—directly into your applications using the Bonds API.

What you get from the Bonds API for Poland

Bonds API provides sovereign bond yields as simple JSON over HTTPS. For Poland (ISO2: PL), you can:

  • Fetch latest yields by maturity (e.g., 2Y, 10Y) in percentage units.
  • Request the yield on a specific historical date (business days and observed market holidays reflected in availability).
  • Pull time series between two dates for backtesting and charting.
  • Build a country’s yield curve and detect inversion.
  • Compute spreads versus a benchmark (e.g., US Treasuries or German Bunds) in basis points.
  • Access intraday snapshots with precise UTC timestamps for the requested date.

All endpoints are GET requests under the base URL https://bonds-api.com/api/v1/ and authenticate with your API key via the X-API-Key header. Explore the full catalog and docs at bonds-api.com and run calls live in the MCP. To obtain an API key, visit Register or use these quick links: Register for Bonds API, Get started with Bonds API.

Data conventions, units, and timestamps

  • Yields are expressed in percent (e.g., 4.52 means 4.52%).
  • Spreads are returned in basis points (bps), where 1 bp = 0.01%.
  • Dates use the format YYYY-MM-DD.
  • Intraday timestamps are in ISO8601 UTC (e.g., 2026-11-11T12:00:00Z).
  • Latest endpoints return the most recent business day with data; weekends and Polish market holidays may show the last available business day.
  • Caching recommendation: cache latest responses for a few minutes intra-day; for historical/time series, cache aggressively since those values are stable once published.

Poland maturities in practice

You can target common Polish maturities individually (e.g., 2Y, 5Y, 10Y) or pull the full curve at once. The curve endpoint returns shorter bills like 1M–6M as well as longer tenors up to 30Y when available.

Maturity Typical Use Notes
1M–6M Short-term rates, liquidity analysis Useful for money market conditions
1Y–3Y Front-end of the curve, policy sensitivity Captures near-term rates expectations
5Y–10Y Benchmark tenors, risk premium 10Y is a common reference point for spreads
20Y–30Y Long-end risk, duration hedging Curve shape diagnostics

Endpoint: Latest yields for Poland

Fetch current yields for selected maturities or the full available set. Values are percentages; date is the business date of the quote.

cURL

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

Python (requests)

import requests

resp = requests.get(
"https://bonds-api.com/api/v1/latest",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"countries": "PL", "maturities": "2Y,10Y"}
)
data = resp.json()
# Access Poland 2Y and 10Y yields (percent) and the quote date
pl_2y = data["data"]["PL"]["2Y"]["yield"]
pl_2y_date = data["data"]["PL"]["2Y"]["date"]
pl_10y = data["data"]["PL"]["10Y"]["yield"]
pl_10y_date = data["data"]["PL"]["10Y"]["date"]
print(pl_2y, pl_2y_date, pl_10y, pl_10y_date)

JavaScript (fetch)

const url = "https://bonds-api.com/api/v1/latest?countries=PL&maturities=2Y,10Y";
fetch(url, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
const pl2y = j.data.PL["2Y"].yield; // percent
const pl2yDate = j.data.PL["2Y"].date; // YYYY-MM-DD
const pl10y = j.data.PL["10Y"].yield;
const pl10yDate = j.data.PL["10Y"].date;
console.log(pl2y, pl2yDate, pl10y, pl10yDate);
});

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=PL&maturities=2Y,10Y";
$json = file_get_contents($url, false, $context);
$data = json_decode($json, true);
$pl10y = $data["data"]["PL"]["10Y"]["yield"];
$plDate = $data["data"]["PL"]["10Y"]["date"];
echo $pl10y . " on " . $plDate;
?

Official JSON example

{
    "success": true,
    "date": "2026-11-10",
    "rates": {
        "US_10Y": 4.98
    },
    "dates": {
        "US_10Y": "2026-11-10"
    },
    "currencies": {
        "US_10Y": "USD"
    },
    "meta": {
        "request_id": "a99902d0-d2b6-42f3-a5e8-1f33ecc6711d",
        "timestamp": "2026-11-11T00:05:16+00:00"
    }
}

How to read it: yields are percent; date is the valuation day (YYYY-MM-DD). The source tells you whether the quote is from an official or market source for that day.

Endpoint: Historical yield on a specific date

Retrieve the Poland yield for a given maturity on a single date. If the date is a weekend or holiday, you may receive a 404 if no official quote exists for that date.

cURL

Python (requests)

import requests

params = {"country": "PL", "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()
if j.get("success"):
print(j["yield"], j["date"]) # yield in percent, date as YYYY-MM-DD
else:
print("Error:", j.get("error"))

JavaScript (fetch)

const params = new URLSearchParams({ country: "PL", maturity: "10Y", date: "2025-06-15" });
fetch("https://bonds-api.com/api/v1/historical?" + params.toString(), {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(j => {
if (j.success) {
console.log(j.yield, j.date); // percent, YYYY-MM-DD
} else {
console.error(j.error);
}
});

PHP (file_get_contents)

<?php
$params = http_build_query(["country" => "PL", "maturity" => "10Y", "date" => "2025-06-15"]);
$context = stream_context_create([
"http" => [
"method" => "GET",
"header" => "X-API-Key: YOUR_API_KEY\r\n"
]
]);
$url = "https://bonds-api.com/api/v1/historical?" . $params;
$json = file_get_contents($url, false, $context);
echo $json;
?

Official JSON example

Field notes: yield is percent; date is the requested valuation day. Use this for point-in-time backtests and event studies.

Endpoint: Time series between two dates

Pull daily yields for Poland for a selected maturity and date window. Missing days (e.g., weekends) are not included; the series contains the business days with available data.

cURL

Python (requests)

import requests

params = {
"country": "PL",
"maturity": "10Y",
"start": "2025-11-11",
"end": "2026-11-11"
}
r = requests.get("https://bonds-api.com/api/v1/timeseries",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params)
series = r.json()["series"]
# Example: compute average yield over the period
avg = sum(pt["yield"] for pt in series) / len(series)
print("Obs:", len(series), "Avg:", avg)

JavaScript (fetch)

const qs = new URLSearchParams({
country: "PL", maturity: "10Y",
start: "2025-11-11", end: "2026-11-11"
});
fetch("https://bonds-api.com/api/v1/timeseries?" + qs, {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(j => {
j.series.forEach(pt => console.log(pt.date, pt.yield));
});

PHP (file_get_contents)

<?php
$params = http_build_query([
"country" => "PL",
"maturity" => "10Y",
"start" => "2025-11-11",
"end" => "2026-11-11"
]);
$context = stream_context_create([
"http" => [
"method" => "GET",
"header" => "X-API-Key: YOUR_API_KEY\r\n"
]
]);
$json = file_get_contents("https://bonds-api.com/api/v1/timeseries?$params", false, $context);
echo $json;
?

Official JSON example

Interpretation: series is an array of daily points, each with a date and yield (percent). Use it for charts, regressions, or risk model calibrations.

Endpoint: Spread vs. benchmark

Compute the Poland spread to a benchmark country (e.g., US or DE) in basis points. You can specify a maturity; 10Y is the default.

cURL

Python (requests)

import requests

params = {"country": "PL", "benchmark": "US", "maturity": "10Y"}
resp = requests.get("https://bonds-api.com/api/v1/spread",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params)
j = resp.json()
if j["success"]:
print(j["spread_bps"], j["country_yield"], j["benchmark_yield"])

JavaScript (fetch)

const p = new URLSearchParams({ country: "PL", benchmark: "US", maturity: "10Y" });
fetch("https://bonds-api.com/api/v1/spread?" + p, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
console.log(j.spread_bps, j.country_yield, j.benchmark_yield);
});

PHP (file_get_contents)

<?php
$params = http_build_query(["country" => "PL", "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?$params", false, $ctx);
?

Official JSON example

How to read it: spread_bps is in basis points. country_yield and benchmark_yield are both percentages for the same maturity.

Endpoint: Full yield curve for Poland

Pull the entire Poland curve for the latest available date (or a specified date). Great for curve visualization, fitting, or interpolation between tenors.

cURL

Python (requests)

import requests

r = requests.get("https://bonds-api.com/api/v1/curve",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"country": "PL"})
j = r.json()
curve = j["curve"] # dict of maturity -> yield (percent)
is_inverted = j["inverted"] # boolean
curve_date = j["date"] # YYYY-MM-DD
print(curve_date, is_inverted, curve.get("10Y"))

JavaScript (fetch)

fetch("https://bonds-api.com/api/v1/curve?country=PL", {
headers: { "X-API-Key": "YOUR_API_KEY" }
})
.then(r => r.json())
.then(j => {
console.log("Date:", j.date, "Inverted:", j.inverted);
Object.entries(j.curve).forEach(([tenor, y]) => console.log(tenor, y));
});

PHP (file_get_contents)

<?php
$ctx = stream_context_create(["http" => ["method" => "GET", "header" => "X-API-Key: YOUR_API_KEY\r\n"]]);
$json = file_get_contents("https://bonds-api.com/api/v1/curve?country=PL", false, $ctx);
$data = json_decode($json, true);
echo $data["date"] . " inverted=" . ($data["inverted"] ? "true" : "false");
?

Official JSON example

Interpretation: curve maps each tenor to its yield (percent). inverted indicates whether short-dated yields exceed longer tenors overall. date is the valuation day for the curve.

Endpoint: Intraday snapshots for a Poland maturity

Use intraday snapshots to study within-day moves on a given date. Each snapshot has a fetched_at ISO8601 UTC timestamp and the yield at that time.

cURL

Python (requests)

import requests

p = {"country": "PL", "maturity": "10Y", "date": "2026-11-11"}
r = requests.get("https://bonds-api.com/api/v1/intraday",
headers={"X-API-Key": "YOUR_API_KEY"},
params=p)
j = r.json()
for snap in j["snapshots"]:
print(snap["fetched_at"], snap["yield"]) # UTC timestamp, percent

JavaScript (fetch)

const q = new URLSearchParams({ country: "PL", maturity: "10Y", date: "2026-11-11" });
fetch("https://bonds-api.com/api/v1/intraday?" + q, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
console.log("Count:", j.count, "TZ:", j.meta.timezone);
j.snapshots.forEach(s => console.log(s.fetched_at, s.yield));
});

PHP (file_get_contents)

<?php
$params = http_build_query(["country" => "PL", "maturity" => "10Y", "date" => "2026-11-11"]);
$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?$params", false, $ctx);
?

Official JSON example

Field notes: yield is percent at the snapshot time; fetched_at is UTC. count confirms the number of snapshots returned for the date.

Endpoint: Fluctuation over a period

Get the start and end yields, absolute change, and period min/max for Poland for a specified maturity and date range. This is useful for dashboards and risk monitors.

cURL

Python (requests)

import requests

params = {
"countries": "PL",
"maturity": "10Y",
"start": "2025-11-11",
"end": "2026-11-11"
}
r = requests.get("https://bonds-api.com/api/v1/fluctuation",
headers={"X-API-Key": "YOUR_API_KEY"},
params=params)
j = r.json()
pl = j["data"]["PL"]
print(pl["start_yield"], pl["end_yield"], pl["change"], pl["min"], pl["max"])

JavaScript (fetch)

const s = new URLSearchParams({
countries: "PL", maturity: "10Y", start: "2025-11-11", end: "2026-11-11"
});
fetch("https://bonds-api.com/api/v1/fluctuation?" + s, { headers: { "X-API-Key": "YOUR_API_KEY" } })
.then(r => r.json())
.then(j => {
const out = j.data.PL;
console.log(out.start_yield, out.end_yield, out.change, out.min, out.max);
});

PHP (file_get_contents)

<?php
$q = http_build_query([
"countries" => "PL",
"maturity" => "10Y",
"start" => "2025-11-11",
"end" => "2026-11-11"
]);
$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);
?

Official JSON example

Interpretation: all yield values are percentages; change is an absolute percentage-point difference (e.g., 0.31 means +31 bps over the period).

Error handling and non-trading days

Common error responses share the shape success=false with an error message string. Typical HTTP statuses include 401 (missing/invalid API key), 403 (quota exceeded), 404 (no data for the requested combination), 422 (invalid parameter), 429 (rate limit), and 500 (server error). On weekends and Polish market holidays, latest will reflect the last available business day. For historical and timeseries, request business dates to reduce 404s; otherwise, validate and retry adjacent business days in your code if appropriate.

Building a Poland yield curve and spreads in your app

  • Use /curve to pull the full set of maturities for Poland in one call; the response includes an inverted boolean for quick diagnostics.
  • Alternatively, call /latest with multiple maturities if you only need a subset for your chart or risk model.
  • For spreads, call /spread with country=PL and benchmark=US or DE; use the returned country_yield and benchmark_yield to display the absolute levels alongside the spread_bps.
  • Cache /curve and /latest for several minutes to stabilize dashboards. Back-testing endpoints (/historical, /timeseries) can be cached for hours or indefinitely once confirmed.

Real-world use cases

  • Financial dashboards: display Poland 2Y–30Y curves with inversion flags and day-over-day changes.
  • Portfolio risk: alert on 10Y spread to US crossing a threshold in basis points using /spread and /intraday for confirmation.
  • Economic research: run event studies on Poland 10Y around macro data releases using /historical and /timeseries.
  • Fixed income analytics: fit a spline to the /curve output to infer zero-coupon or forward curves.

For more patterns and tools, visit bonds-api.com or try requests live in the MCP.

Official sample (verbatim)

The following sample block is provided verbatim from an official source:

Note: yields are percent; date and meta.timestamp are ISO8601 date/time strings. Use your API key in place of YOUR_API_KEY.

Sovereign bond basics (Poland context)

Polish government bonds are debt securities issued by the Republic of Poland. The yield reflects the market’s required return and embeds expectations for future policy rates, inflation, and risk premia. Analysts monitor curve shape (e.g., 2s10s) and international spreads (PL vs US/DE) to assess relative value and macro conditions.

Putting it all together: from raw quotes to analytics

  • Start with /latest or /curve for Poland to populate your UI with headline levels across tenors.
  • Use /timeseries to compute realized vol, rolling averages, or beta vs. benchmarks.
  • Invoke /spread for cross-market comparisons; visualize both absolute yields and spread_bps.
  • On high-volatility days, query /intraday to capture within-day dynamics and timestamp events in UTC.
  • Summarize periods with /fluctuation to show min/max and net change over user-selected ranges.

All endpoints are simple GET requests with an X-API-Key header. For rapid prototyping and testing, head to bonds-api.com and the interactive MCP.

FAQ

What units are yields and spreads in?
Yields are percentages (e.g., 4.52 means 4.52%). Spreads are in basis points (bps), where 100 bps = 1 percentage point.

What time zone are timestamps?
Intraday fetched_at timestamps are UTC. Daily dates are valuation days in YYYY-MM-DD.

How often are latest yields updated?
Latest endpoints reflect the most recent business day with available data. Intra-day snapshots are available via /intraday for the specified date.

How should I cache results?
Cache /latest and /curve for several minutes during market hours. Cache /historical, /timeseries, and /fluctuation more aggressively since historical values are stable after publication.

How do I build a custom Poland yield curve?
Use /curve for a full snapshot or /latest with specific maturities (e.g., 2Y,5Y,10Y,30Y). Then interpolate as needed for intermediate points.

Ready to integrate Poland sovereign yields in your stack? Use your API key with the GET endpoints above, try calls in the MCP, and Register to get an API key and ship your Poland bond analytics today.

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.