NBP

wersja polska

NBP Web API

Currency exchange rates and gold prices in the XML and JSON formats

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:

  1. current and historic exchange rates of foreign currencies:
    • table A of middle exchange rates of foreign currencies,
    • table B of middle exchange rates of foreign currencies,
    • table C of buy and sell prices of foreign currencies;
  2. current and historic prices of gold calculated at NBP.

Communication with the service based on parametrized HTTP GET requests send to the http://api.nbp.pl/api/ address.

User manual

General Information

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:

If the format has not been determined, XML 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:

Description of API functions concerning currency exchange rates

The data for currency exchange rates are made available in two ways:

Query string parameters

Queries for complete tables

Templates of enquiries about complete tables of currency exchange rates

Queries for particular currency

Templates of enquiries about a particular currency exchange rate

Description of response parameters

Description of API functions concerning enquiries about gold prices

Query string parameters

Queries for gold prices

Description of response parameters

Query examples

Currency exchange rates

Gold prices

Error messages

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 covering more than three months, the service returns the message 400 Bad Request - Przekroczony limit 93 dni / Limit of 93 days has been exceeded

This site uses cookies to ensure its more efficient operation.
To find out more about the cookie technology, please click here: NBP Privacy Policy »
In order to browse through the content, it is necessary to accept cookies from this site Accept