TL;DR
Narodowy Bank Polski (NBP) provides a free, official API for Polish zloty exchange rates and gold prices, with data going back to 2002. The API serves JSON and XML formats, covering all major currencies (EUR, USD, CHF, GBP, etc.) as well as gold fixing prices. No registration or API key is needed — this is open public data published by the Polish central bank.
Quick start: http://api.nbp.pl/api/cenyzlota/last/30/?format=json
No API key needed — just make a request!
How to Use This API
1. Gold Prices — Last 30 Days
Returns the official gold fixing price (in PLN per gram) for each of the last 30 trading days:
http://api.nbp.pl/api/cenyzlota/last/30/?format=json
Each entry returns a data (date) and cena (price in PLN) field.
2. Current EUR/PLN Exchange Rate
http://api.nbp.pl/api/exchangerates/rates/A/EUR/?format=json
Table A covers the most traded currencies. Replace EUR with USD, CHF, GBP, or any other supported currency code.
3. Historical USD/PLN Rate for a Specific Date
http://api.nbp.pl/api/exchangerates/rates/A/USD/2024-01-15/?format=json
4. JavaScript — Fetch Gold Prices
fetch('http://api.nbp.pl/api/cenyzlota/last/30/?format=json')
.then(res => res.json())
.then(data => {
data.forEach(entry => {
console.log(`${entry.data}: ${entry.cena} PLN/g`);
});
});
5. Python — Check EUR Rate
import requests
resp = requests.get(
'http://api.nbp.pl/api/exchangerates/rates/A/EUR/?format=json'
)
data = resp.json()
rate = data['rates'][0]['mid']
print(f"EUR/PLN mid rate: {rate}")
http://api.nbp.pl/api/cenyzlota/last/30/?format=json
Frequently Asked Questions
- What currency exchange rate tables does NBP offer?
- Table A (mid rates for major currencies, updated daily), Table B (mid rates for minor/non-traded currencies, updated weekly), and Table C (bid/ask rates, updated daily). Use the URL pattern
/exchangerates/rates/{table}/{code}/. - How far back does historical data go?
- Exchange rate data is available from 2002 onward. Gold prices go back to 2013. You can query by specific date or date ranges using the pattern
/rates/A/USD/2024-01-01/2024-01-31/. - What format does the API return?
- JSON is the default. Append
?format=jsonor use?format=xmlfor XML output. JSON is recommended for web use. - Is there a rate limit on the NBP API?
- The API is publicly available with no documented rate limits, but NBP discourages excessive automated polling. Cache responses where possible.
- Does this cover gold prices?
- Yes. The
/api/cenyzlota/endpoint returns the official gold fixing price in PLN per gram. Use/last/{n}/for the most recent N days, or/start/end/dates for a range. - Can I use this commercially?
- Yes. NBP data is public and free to use for any purpose, including commercial applications. No attribution is required but is appreciated.
API Details
- API URL
http://api.nbp.pl/api- Documentation
- api.nbp.pl
- Category
- Finance
- Authentication
- Not Required
- Geographic Coverage
- Poland (PL) — Polish zloty rates and gold prices
What You Can Build
- Polish zloty currency converter for e-commerce sites serving Polish customers
- Gold price tracking dashboard for investors monitoring NBP fixing prices
- Historical exchange rate analyzer comparing PLN against EUR, USD, and CHF over decades
- Accounting tool that imports official NBP mid rates for invoice conversion
- Multi-source rate aggregator comparing NBP rates with commercial forex APIs