Croatian National Bank API
Free Croatian National Bank API with no key: official EUR buying, middle and selling rates for every quoted currency, current or for any past date. Tested example included.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the Croatian National Bank API?
The Croatian National Bank publishes its official exchange rate list as a free JSON API at api.hnb.hr, with no key required. Since Croatia adopted the euro the list is euro-based, and each entry carries separate buying, middle and selling rates.
Most central bank feeds give you one number per currency. The HNB gives three — `kupovni_tecaj`, `srednji_tecaj` and `prodajni_tecaj` — because Croatian practice distinguishes the buying, middle and selling rate, and different rules point at different ones. Picking the middle rate by default is common but not automatically correct for whatever you are computing, so decide deliberately.
There is a formatting trap that will silently corrupt your numbers: every rate is a **string using a comma as the decimal separator**, as in `"1,169900"`. Passing that straight to `parseFloat` in JavaScript yields `1`, not `1.1699`, with no error thrown anywhere. Replace the comma with a dot before parsing, and write a test that would catch it if the API ever switches format.
Quick facts
- Base URL
https://api.hnb.hr/tecajn-eur/v3- Authentication
- No key or registration. Published by the Croatian National Bank as open data.
- Rate limit
- No documented limit. The list is published once per working day.
- Pricing
- Free.
- CORS
- Not enabled — call it from your server
- Official docs
- Read the docs
How to use the Croatian National Bank API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. Official EUR/USD rate from the current HNB list
GET https://api.hnb.hr/tecajn-eur/v3?valuta=USD
curl 'https://api.hnb.hr/tecajn-eur/v3?valuta=USD'const res = await fetch("https://api.hnb.hr/tecajn-eur/v3?valuta=USD");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://api.hnb.hr/tecajn-eur/v3?valuta=USD", timeout=20)
res.raise_for_status()
print(res.json())[
{
"broj_tecajnice": "163",
"datum_primjene": "2026-08-21",
"drzava": "SAD",
"drzava_iso": "USA",
"kupovni_tecaj": "1,169900",
"prodajni_tecaj": "1,166300",
"sifra_valute": "840",
"srednji_tecaj": "1,168100",
"valuta": "USD"
}
]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
valuta | query | Optional | ISO 4217 code to filter to a single currency. Omit to receive the whole list. USD |
datum-primjene | query | Optional | Application date in `YYYY-MM-DD`, for a historical list. 2026-08-20 |
datum-primjene-od / datum-primjene-do | query | Optional | Start and end of a date range, for a series rather than one day. 2026-08-01 |
Response fields
valutastring- ISO 4217 currency code.
srednji_tecajstring- Middle rate — units of this currency per 1 EUR. Comma decimal separator.
kupovni_tecaj / prodajni_tecajstring- Buying and selling rates, also comma-separated decimals.
datum_primjenestring- Date the list applies from, in ISO form.
broj_tecajnicestring- Sequential number of the rate list within the year.
drzava / drzava_isostring- Country name in Croatian and its ISO country code.
sifra_valutestring- ISO 4217 numeric currency code, zero-padded.
What you can build with the Croatian National Bank API
- Convert euro amounts using the rate Croatian reporting rules point at
- Fetch a date range to chart an official rate over a month
- Reconcile Croatian bank statements against the published list
- Compare buying and selling rates to show the official spread
Common errors and how to fix them
Parsed rate comes out as 1
The comma decimal separator was fed to a dot-expecting parser.
Fix: Replace `,` with `.` before parsing. This fails silently in JavaScript and is the single most common bug against this API.
Empty array
No list exists for the requested date.
Fix: Weekends and Croatian public holidays have no publication. Ask for a range and take the last entry, or step back a day.
404
Wrong path version.
Fix: The euro-based list lives under `/tecajn-eur/v3`. Older kuna-era paths are retired.
Croatian National Bank API — frequently asked questions
Is the Croatian National Bank exchange rate API free?
Yes. api.hnb.hr needs no key or registration and publishes the official rate list as open data, with both current and historical dates available.
Why are the rates returned as strings with commas?
The API preserves Croatian decimal formatting, where a comma is the decimal separator. Convert the comma to a dot before parsing — most language parsers will otherwise truncate the value without raising an error.
Which of the three rates should I use?
That depends on the rule you are following, not on the API. `srednji_tecaj` is the middle rate and the most commonly cited, while the buying and selling rates bracket it. Check the requirement you are meeting rather than defaulting.
Are rates still quoted against the kuna?
No. Croatia adopted the euro in January 2023 and the current v3 list is euro-based, so every rate expresses units of the foreign currency per one euro.
Tools that pair with this API
VAT Calculator
Add VAT to a net price or extract VAT from a gross amount. Preset 5%, 10%, 20% and 23% rates plus custom, showing net, VAT and gross values instantly.
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
Percentage Change Calculator
Work out the percentage increase or decrease between an old and a new value. See the absolute change and whether it went up or down, instantly and privately.
Croatian National Bank is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.