National Bank of Poland API

Free to Use Varies (check documentation)

Overview

The National Bank of Poland (NBP) API is an official government data source providing daily exchange rates for 35+ currencies relative to the Polish Zloty (PLN), published on each banking day. It supports both JSON and XML output, covers historical data going back many years, and requires no authentication. The API is ideal for financial applications operating in the Polish market or requiring authoritative exchange rate data.

💡

Beginner Tip

No API key required. Use `https://api.nbp.pl/api/exchangerates/tables/A/?format=json` to get today's mid-market rates for all currencies. Rates are denominated in PLN. Add `Accept: application/json` header to ensure JSON output. The API has two tables: Table A (mid-market) and Table C (bid/ask spread).

Available Data

exchange rate between currencies
conversion result
supported currency list
historical rates
country name and code
population

Example Response

JSON Response
{
  "base": "USD",
  "date": "2025-01-15",
  "rates": {
    "EUR": 0.92,
    "GBP": 0.79,
    "JPY": 149.5,
    "CAD": 1.35
  }
}

Field Reference

table The table identifier — `A` for mid-market rates or `C` for bid/ask rates.
no Official publication number of this rate table (e.g., `073/A/NBP/2024`).
effectiveDate The date these rates apply to, in YYYY-MM-DD format.
rates Array of currency objects, each with the currency name, code, and mid-market rate.
rates[].currency Full name of the foreign currency (e.g., `euro`).
rates[].mid The mid-market exchange rate of 1 unit of this currency in PLN.

Implementation Example

const url = "http://api.nbp.pl/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

406 Not Acceptable Not including an `Accept` header, causing the server to default to XML output when JSON is expected.
Always include the header `Accept: application/json` in your request, or append `?format=json` to the URL.
404 Not Found for a specific date Requesting a date that falls on a weekend or Polish public holiday when the NBP does not publish rates.
Use the `/last/{n}/` endpoint to get the last N published rates, or query the nearest weekday.
HTTP instead of HTTPS warning The official docs reference `http://api.nbp.pl`, but browsers and strict clients may warn about non-HTTPS.
Use `https://api.nbp.pl` — the server supports HTTPS and it is the recommended approach.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 10/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 301ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →