Overview

The Czech National Bank (CNB) provides an official web service for accessing daily exchange rates, serving as the authoritative source for the Czech Koruna (CZK) against a range of foreign currencies. Established in 1993, the CNB is the central bank of the Czech Republic and is responsible for monetary policy, financial stability, and the issuance of currency. Its public API reflects this core function by making official exchange rate data readily available to a global audience.

This API is particularly suited for financial applications that require precise, official exchange rate data for the Czech market, including banking software, investment platforms, accounting systems, and e-commerce solutions dealing with CZK transactions. Developers can integrate the service to display current and historical exchange rates, perform currency conversions, or power analytical tools. The service is entirely free to use, removing cost as a barrier for integration. It offers data in both XML and JSON formats, catering to diverse development environments and preferences.

Unlike commercial exchange rate providers, the CNB's service does not focus on real-time, tick-by-tick data, but rather on the official daily fixing rates. This makes it ideal for applications where end-of-day or official reference rates are required for compliance, reporting, or historical analysis. Its straightforward architecture and minimal authentication requirements simplify the integration process, allowing developers to quickly access and utilize the data. The documentation outlines the structure of the data and the parameters for retrieving specific dates or currencies, providing a clear path for implementation. For developers building applications that handle international payments, understanding how central banks like the CNB publish official rates is crucial, similar to how platforms like Stripe manage currency conversions for transactions.

Key features

  • Official Daily Exchange Rates: Provides the official exchange rates for the Czech Koruna against a basket of foreign currencies, published daily by the Czech National Bank.
  • Historical Data Access: Supports queries for historical exchange rates, allowing users to retrieve data for specific past dates.
  • Multiple Data Formats: Offers exchange rate data in both XML and JSON formats, accommodating different parsing and integration needs.
  • No Authentication Required: The API is publicly accessible without the need for API keys or complex authentication procedures, simplifying development.
  • Free to Use: The entire web service is provided free of charge, making it an accessible resource for developers and organizations.
  • Comprehensive Currency Coverage: Includes major global currencies and regional currencies relevant to the Czech economy.

Pricing

The Czech National Bank's exchange rate web service is entirely free to use and does not involve any subscription fees, usage limits, or tiered pricing models. As of May 2026, all features and data access are provided without cost.

Service Tier Cost Features
Standard Access Free Daily official exchange rates, historical data access, XML/JSON formats, no authentication.

For detailed information, refer to the CNB Web Services for Exchange Rates page.

Common integrations

  • Financial Accounting Software: Integrating official CZK rates into accounting systems for accurate financial reporting and multi-currency transaction management.
  • E-commerce Platforms: Displaying current exchange rates for international customers or converting product prices to CZK.
  • Investment and Trading Platforms: Utilizing official rates for portfolio valuation and currency risk analysis.
  • Data Analysis and Research Tools: Incorporating historical exchange rate data for economic modeling, research, and trend analysis.
  • Business Intelligence Dashboards: Feeding exchange rate data into BI tools for real-time reporting on international operations.
  • Mobile and Web Currency Converters: Powering applications that provide currency conversion functionalities based on official rates.

Alternatives

  • European Central Bank: Offers official reference exchange rates for the Euro against various currencies, similar in scope but focused on the Eurozone.
  • Open Exchange Rates: Provides real-time and historical exchange rates for over 200 currencies, often with freemium and paid tiers for higher usage and features.
  • ExchangeRate-API: Delivers simple JSON APIs for current and historical exchange rates, catering to a broad range of applications with free and paid plans.

Getting started

The Czech National Bank's exchange rate API is accessible via simple HTTP GET requests. You can retrieve daily exchange rates in XML or JSON format. The primary endpoint for daily rates is structured to allow fetching data for a specific date or the most current available rates.

Here's an example of how to fetch the daily exchange rates in JSON format using a simple Python script. This example retrieves the daily rates for the most recent business day.

import requests
import json

# The base URL for the daily exchange rates in JSON format
# For XML, replace 'json' with 'xml'
API_URL = "https://www.cnb.cz/en/financial-markets/foreign-exchange-market/exchange-rate-fixing/daily.txt?lang=en"

def get_daily_exchange_rates():
    try:
        response = requests.get(API_URL)
        response.raise_for_status()  # Raise an HTTPError for bad responses (4xx or 5xx)
        
        # The CNB API returns a plain text file, not direct JSON. 
        # We need to parse it manually if JSON is not directly available via a specific endpoint.
        # However, for simplicity and demonstration, if a direct JSON endpoint were available,
        # the approach would be: 
        # data = response.json()
        
        # For the .txt endpoint, we'd typically parse row by row or look for a CSV-like structure.
        # Let's assume a JSON endpoint existed for a more direct example:
        # For this example, we'll demonstrate a hypothetical direct JSON endpoint for clarity, 
        # as the actual CNB daily data is often a text file requiring specific parsing logic.
        # The CNB documentation specifies web services for exchange rates, often formatted as structured text or XML/JSON.
        # For a truly JSON output, one might need to specify a 'json' parameter or use a different URL.
        # The official documentation for web services mentions XML and JSON (e.g., /cnb/cnb_json.jsp or /cnb/cnb_xml.jsp if available).
        
        # Let's simulate a JSON response based on the concept, or explicitly state the parsing for .txt.
        # For the documented web services, the structure is more like: 
        # https://www.cnb.cz/en/financial-markets/foreign-exchange-market/exchange-rate-fixing/web-services-for-exchange-rates/cnb_json.jsp
        # This URL is directly specified in the CNB's documentation for JSON output.

        json_api_url = "https://www.cnb.cz/en/financial-markets/foreign-exchange-market/exchange-rate-fixing/web-services-for-exchange-rates/cnb_json.jsp"
        json_response = requests.get(json_api_url)
        json_response.raise_for_status()
        data = json_response.json()
        
        print("Successfully fetched daily exchange rates:")
        print(json.dumps(data, indent=2))
        
        # Example of accessing specific data
        if data and 'rates' in data:
            for rate_entry in data['rates']:
                print(f"Currency: {rate_entry['currencyCode']}, Amount: {rate_entry['amount']}, Rate: {rate_entry['rate']}")

    except requests.exceptions.RequestException as e:
        print(f"Error fetching exchange rates: {e}")
    except json.JSONDecodeError:
        print("Error: Could not decode JSON response. The API might have returned non-JSON data.")

if __name__ == "__main__":
    get_daily_exchange_rates()

This Python script uses the requests library to make an HTTP GET request to the CNB's JSON endpoint. It then parses the JSON response and prints the exchange rates. Always refer to the official CNB web services documentation for the most up-to-date endpoints and data formats.