Access to HNB exchange rates
As a free service to the community, we provide access to Croatian National Bank (HNB) exchange rates through SmartAccount, with 99.99% availability.
If you have ever integrated with the HNB v2 or v3 API, you will have noticed its non-standard data formatting, numbers as text and similar issues. There is also the issue of availability. As part of our ongoing efforts to improve SmartAccount and give back to the community, we now provide free access to exchange rate data for USD, GBP and JPY currencies, and for historical data also EUR.
The API is also available without a SmartAccount account.
Example: USD ($) exchange rate
$ curl "https://app.smartaccount.hr/api/rates?currency=USD" | jq{
"data": {
"buying": 1.0824,
"middle": 1.0808,
"selling": 1.0792
},
"meta": {
"date": "2023-08-28",
"currency": "USD",
"base_currency": "EUR"
}
}Values use the decimal type.
Historical data
You can specify a date to view historical data. The date must be sent in ISO8601 format.
$ curl "https://app.smartaccount.hr/api/rates?currency=USD&date=2023-05-01" | jq{
"data": {
"buying": 1.0997,
"middle": 1.0981,
"selling": 1.0965
},
"meta": {
"date": "2023-05-01",
"currency": "USD",
"base_currency": "EUR"
}
}Error 400
The API returns a 400 Bad request error with an explanation.
$ curl "https://app.smartaccount.hr/api/rates" | jq{
"errors": {
"currency": [
"can't be blank"
]
}
}Validation
| Field | Description |
|---|---|
| currency | Possible values: USD, GBP, JPY, EUR |
| date | ISO8601 format (e.g. 2023-01-01), must not be in the future |
Note: EUR can only be requested for dates before 2023-01-01.
Availability and versioning
The API is entirely free to integrate into existing and new systems, with a soft limit of 10 requests per second.
The API will not change, except for the addition of new currencies depending on client needs and requests.
For further questions, please contact us.