The instruction how to retrieve currency exchange rates from the NBP website

Instructions for downloading exchange rates from the NBP website in XML format

Instructions for downloading exchange rates from the NBP website in XML format

Important API Update: Transition to HTTPS Only

Effective August 1, 2025, all API communications must be conducted over HTTPS. The HTTP protocol will no longer be supported for accessing our API services. This change is part of our ongoing commitment to enhancing security and protecting your data during transmission.

Action Required

To ensure uninterrupted access to our API services starting August 1, 2025, please update your integration to use HTTPS endpoints. Thank you for your understanding and cooperation as we make this important upgrade to enhance the security of our services.

Retrieving XML files containing NBP exchange rates

XML files containing NBP exchange rates can be found on the NBP website static.nbp.pl in folder:

/dane/kursy/xml/*.xml

In addition, the following file can be found in the same location under:

https://static.nbp.pl/dane/kursy/xml/dir.txt

It contains the names of files (without .xml extension) with tables specifying currency exchange rates. The file contains the current year’s data only. Data for the previous years can be found in dir2002.txt, dir2003.txt … dir 2015.txt files.

The names of all files have the same format, i.e.:

‘xnnnzrrmmdd.xml’

where particular letters denote the following:

x – letter denoting the type of a table:

  • a – table of average foreign currency exchange rates;
  • b – table of average exchange rates of inconvertible currencies;
  • c – table of purchase and sale exchange rates;
  • h – table of exchange rates of units of account.

nnn – 3-character (numerical) number of a table in a year;

z – letter ‘z’ (constant element)

rrmmdd – date of publication/effective date of the table in the following format (no spaces): last two digits of the number of a year, two digits of the number of a month and two digits of the number of a day.

.xml – standard extension of a xml file name.

The example of retrieving from the NBP website of an xml file with table A of average exchange rates published on 5 February 2010:

  1. In the dir.txt file, search is made by dates:
  2. The file being searched is found at:

Present (recent) files with tables A, B and C are also available under the following names: LastA.xml, LastB.xml, LastC.xml. respectively.

Good practice

  • Details of the current exchange rates of foreign currencies in zlotys defined in § 2.3 and § 3 of Resolution No. 51/2002 of the Management Board of Narodowy Bank Polski of 23 September 2002 on the way of calculating and announcing current exchange rates of foreign currencies are available in the following Official Journal of the NBP No. 15/2017 (in Polish).
  • The standard procedure is to download dir.txt file (after the date of its update). In this way, we get the list of all available names of files containing tables of currency exchange rates in a chronological order.
  • The rules for the use of data published on the NBP website can be found in NBP’s Regulations.