The api.nbp.pl service operates a public Web API enabling HTTP clients to make enquiries on the following datasets published by the NBP.PL service:
Communication with the service based on parametrized HTTP GET requests send to the http://api.nbp.pl/api/ address.
Service reply is returned in the JSON or XML format, depending on client requirements. The reply format may be indicated in two ways – with an query parameter ?format
or with a HTTP Accept
header:
Accept: application/json
header or ?format=json
parameterAccept: application/xml
header or ?format=xml
parameterIf the format has not been determined, JSON is returned.
Historic data are available respectively:
and a single enquiry cannot cover a period longer than 93 days.
The time frame for enquiry results may be determined in one of the following ways:
The data for currency exchange rates are made available in two ways:
{table}
– table type (A
, B
, or C
){code}
– a three- letter currency code (ISO 4217 standard){topCount}
– a number determining the maximum size of the returned data series{date}
, {startDate}
, {endDate}
– a date in the YYYY-MM-DD format (ISO 8601 standard)Templates of enquiries about complete tables of currency exchange rates
{table}
http://api.nbp.pl/api/exchangerates/tables/{table}/
{topCount}
tables of exchange rates of type {table}
http://api.nbp.pl/api/exchangerates/tables/{table}/last/{topCount}/
{table}
published today (or lack of data)
http://api.nbp.pl/api/exchangerates/tables/{table}/today/
{table}
published on {date}
(or lack of data)
http://api.nbp.pl/api/exchangerates/tables/{table}/{date}/
{table}
published from {startDate}
to {endDate}
(or lack of data)
http://api.nbp.pl/api/exchangerates/tables/{table}/{startDate}/{endDate}/
Templates of enquiries about a particular currency exchange rate
{code}
from the exchange rate table of type {table}
http://api.nbp.pl/api/exchangerates/rates/{table}/{code}/
{topCount}
exchange rates of currency {code}
from the exchange rate table of type {table}
http://api.nbp.pl/api/exchangerates/rates/{table}/{code}/last/{topCount}/
{code}
from the exchange rate table of type {table}
published today (or lack of data)
http://api.nbp.pl/api/exchangerates/rates/{table}/{code}/today/
{code}
from the exchange rate table of type {table}
published on {date}
(or lack of data)
http://api.nbp.pl/api/exchangerates/rates/{table}/code}/{date}/
{code}
from the exchange rate table of type {table}
published from {startDate}
to {endDate}
(or lack of data)
http://api.nbp.pl/api/exchangerates/rates/{table}/{code}/{startDate}/{endDate}/
{topCount}
– a number determining the maximum size of returned data series{date}
, {startDate}
, {endDate}
– a date in the YYYY-MM-DD format (ISO 8601 standard)http://api.nbp.pl/api/cenyzlota
{topCount}
gold price quotations
http://api.nbp.pl/api/cenyzlota/last/{topCount}
http://api.nbp.pl/api/cenyzlota/today
{date}
(or lack of data)
http://api.nbp.pl/api/cenyzlota/{date}
{startDate}
to {endDate}
(or lack of data)
http://api.nbp.pl/api/cenyzlota/{startDate}/{endDate}
http://api.nbp.pl/api/exchangerates/rates/a/chf/
http://api.nbp.pl/api/exchangerates/rates/c/usd/today/
http://api.nbp.pl/api/exchangerates/rates/c/usd/2016-04-04/?format=json
http://api.nbp.pl/api/exchangerates/tables/a/
http://api.nbp.pl/api/exchangerates/tables/a/today/
http://api.nbp.pl/api/exchangerates/rates/a/gbp/last/10/?format=json
http://api.nbp.pl/api/exchangerates/rates/c/usd/last/10/?format=xml
http://api.nbp.pl/api/exchangerates/rates/a/gbp/2012-01-01/2012-01-31/
http://api.nbp.pl/api/exchangerates/rates/a/gbp/2012-01-02/
http://api.nbp.pl/api/exchangerates/tables/a/last/5/
http://api.nbp.pl/api/exchangerates/tables/a/2012-01-01/2012-01-31/
http://api.nbp.pl/api/exchangerates/tables/b/2016-03-30/
http://api.nbp.pl/api/cenyzlota/
http://api.nbp.pl/api/cenyzlota/last/30/?format=json
http://api.nbp.pl/api/cenyzlota/today/
http://api.nbp.pl/api/cenyzlota/2013-01-02/
http://api.nbp.pl/api/cenyzlota/2013-01-01/2013-01-31/
In the case of lack of data for a correctly determined time interval, 404 Not Found message is returned
In the case of incorrectly formulated enquiries, the service returns 400 Bad Request message
In the case of an enquiry/query exceeding the returned data size limit, the service returns the message 400 Bad Request - Limit exceeded