Overview

The National Bank of Poland (NBP) API offers direct access to the official exchange rates of foreign currencies against the Polish złoty (PLN), gold prices, and NBP interest rates. Established in 1945, the NBP is the central bank of Poland and is responsible for its monetary policy and financial stability. The NBP API provides a programmatic interface to the data published on the bank's official website, making it a resource for applications requiring authoritative economic data related to Poland.

The API is designed for developers, financial analysts, academic researchers, and businesses that need to integrate official Polish economic indicators into their systems. This includes financial software, currency converters, economic models, and reporting tools. The data is presented in JSON and XML formats, facilitating integration with various programming languages and platforms. The NBP API distinguishes itself by providing data directly from the official source, which is critical for compliance and accuracy in financial contexts. Unlike commercial exchange rate providers, the NBP API focuses exclusively on the Polish market and its interactions with other major currencies, offering specific tables for different types of exchange rates (Table A for average rates, Table B for non-convertible currencies, and Table C for buying and selling rates).

The NBP API is particularly useful for scenarios requiring historical data for trend analysis or for applications that must align with official Polish accounting and financial reporting standards. For instance, businesses operating in Poland might use the API to calculate the value of foreign currency transactions for tax purposes, ensuring they use the legally recognized exchange rates. Academic institutions can utilize the extensive historical data to conduct economic research on currency fluctuations and their impact on the Polish economy. Developers building financial tools can rely on the NBP's data for accuracy, while also considering other providers like the European Central Bank API for broader Eurozone data or commercial APIs like Open Exchange Rates for global coverage and additional features.

The API's straightforward structure and comprehensive documentation help developers quickly implement data retrieval. It supports queries for current rates, historical rates for specific dates, and a range of dates, allowing for flexible data collection. The data tables are updated daily, reflecting the latest official valuations. This makes the NBP API a foundational component for any system that requires precise and officially sanctioned Polish currency and gold price information.

Key features

  • Official Exchange Rates (Tables A, B, C): Access daily average exchange rates (Table A), rates for non-convertible currencies (Table B), and buying/selling rates (Table C) for major foreign currencies against the Polish złoty. These tables are updated regularly by the NBP as documented in the NBP exchange rates publication schedule.
  • Historical Data: Retrieve exchange rates and gold prices for specific dates or within a defined date range, enabling historical analysis and backtesting.
  • Gold Prices: Obtain daily average gold prices in Polish złoty per troy ounce, useful for commodity tracking and investment analysis.
  • Interest Rates: Access official NBP interest rates, which are key indicators for monetary policy and financial market analysis.
  • JSON and XML Formats: Data is available in both JSON and XML, providing flexibility for integration with various programming environments and data parsing requirements.
  • Free Access: All API endpoints are available without cost, making it an accessible resource for developers and researchers.
  • Direct Source: Provides data directly from the National Bank of Poland, ensuring accuracy and official validation for financial and economic applications.

Pricing

The National Bank of Poland API is provided free of charge for all users. There are no subscription fees, usage limits, or tiered access models for its data endpoints.

Service Tier Features Price (as of 2026-05-28) Details
Standard Access Access to all official exchange rates (Tables A, B, C), historical data, gold prices, and interest rates Free Unlimited requests, direct data from NBP. Official NBP economic data

Common integrations

The NBP API can be integrated into various applications and systems that require official Polish economic data. Due to its standard RESTful interface and JSON/XML output, it is compatible with most modern programming languages and data processing tools. Specific integration examples often involve:

  • Financial Management Systems: Integrating NBP exchange rates into ERP systems or accounting software to accurately convert foreign currency transactions for reporting and compliance purposes.
  • Data Visualization Tools: Connecting to business intelligence (BI) dashboards or custom charting applications to display historical currency trends and gold prices.
  • Academic Research Platforms: Incorporating NBP data into statistical software (e.g., R, Python with Pandas) for econometric modeling and research on the Polish economy.
  • Currency Converter Widgets: Developing web or mobile applications that provide real-time or historical Polish złoty exchange rates for users.
  • Automated Reporting: Building scripts to fetch daily rates and generate automated financial reports or alerts based on currency fluctuations.
  • Third-party API Orchestration: Utilizing integration platforms like Tray.io's API integration solutions to combine NBP data with other financial APIs, creating more complex workflows.

Alternatives

While the NBP API provides official Polish economic data, several other services offer broader or more specialized currency exchange rate information:

  • European Central Bank (ECB): Offers official Euro foreign exchange reference rates, providing a primary source for Eurozone currency data.
  • ExchangeRate-API: A commercial API offering current and historical exchange rates for 160+ currencies, with a focus on ease of use and broad coverage.
  • Open Exchange Rates: Provides real-time foreign exchange rates for 150+ currencies, updated frequently, and suitable for commercial applications.

Getting started

To begin using the National Bank of Poland API, you can make direct HTTP requests to its endpoints. The API does not require authentication for public data access. Below is a Python example demonstrating how to retrieve the current average exchange rate for a specific currency (e.g., USD) from Table A.

First, ensure you have the requests library installed:

pip install requests

Then, use the following Python code to fetch and parse the data:

import requests
import json

def get_current_nbp_exchange_rate(currency_code):
    """
    Fetches the current average exchange rate for a given currency code
    from NBP's Table A.
    """
    # Endpoint for current exchange rates from Table A
    # Example: https://api.nbp.pl/api/exchangerates/rates/a/usd/
    url = f"https://api.nbp.pl/api/exchangerates/rates/a/{currency_code.lower()}/?format=json"
    
    try:
        response = requests.get(url)
        response.raise_for_status()  # Raise an HTTPError for bad responses (4xx or 5xx)
        data = response.json()
        
        # Extract the relevant rate if data is available
        if data and 'rates' in data and data['rates']:
            rate_info = data['rates'][0]
            effective_date = rate_info.get('effectiveDate')
            mid_rate = rate_info.get('mid')
            
            print(f"Current NBP average exchange rate for 1 {currency_code.upper()}:")
            print(f"  Date: {effective_date}")
            print(f"  Rate: {mid_rate} PLN")
            return mid_rate
        else:
            print(f"No exchange rate data found for {currency_code.upper()}.")
            return None
            
    except requests.exceptions.HTTPError as http_err:
        print(f"HTTP error occurred: {http_err} - Status code: {response.status_code}")
    except requests.exceptions.ConnectionError as conn_err:
        print(f"Connection error occurred: {conn_err}")
    except requests.exceptions.Timeout as timeout_err:
        print(f"Timeout error occurred: {timeout_err}")
    except requests.exceptions.RequestException as req_err:
        print(f"An error occurred during the request: {req_err}")
    except json.JSONDecodeError:
        print("Failed to decode JSON response.")
    except Exception as e:
        print(f"An unexpected error occurred: {e}")
        
    return None

# Example usage:
get_current_nbp_exchange_rate('USD')
get_current_nbp_exchange_rate('EUR')
get_current_nbp_exchange_rate('GBP')
get_current_nbp_exchange_rate('CHF')

This script defines a function get_current_nbp_exchange_rate that takes a currency code (e.g., 'USD', 'EUR') and fetches the latest average exchange rate from the NBP API. It handles potential errors during the API call and prints the effective date and the mid-rate. For more detailed API usage, including historical data queries and different table types, refer to the National Bank of Poland API reference.