Exchange rate API
The rates published by the BNR and by the ECB, as JSON: free, no key, no registration.
- GET
- JSON
- UTF-8
- CORS
- v1
- free
- no key
Base URL https://b24.ro/api/v1
Rules
- The base address is https://b24.ro/api/v1. Every request is a GET and every response is JSON (UTF-8). Requests from browsers are allowed from any origin (CORS).
- Limit per IP address: bursts of 60 requests, then 60 per minute. Every response carries the RateLimit-Limit and RateLimit-Remaining headers; over the limit the response is 429, with a Retry-After header.
- Rates change once per banking day. Keep responses locally and honour the Cache-Control header instead of repeating the same request.
- If you display the data, name its source: the National Bank of Romania or the European Central Bank.
The rates of a day
GET /api/v1/rates
The rates in effect on a date: those published that day or, on weekends and holidays, the last ones published before it.
| Parameter | Meaning |
|---|---|
date | The date (YYYY-MM-DD). Default: the latest published day. The earliest is 2005-01-03; a date in the future is rejected. |
source | The source: bnr (default; RON for one unit or for 100 units of each currency) or ecb (units of each currency for 1 euro). |
currencies | Only these currencies: three-letter codes separated by commas, for example EUR,USD. Default: all. |
$ curl "https://b24.ro/api/v1/rates?date=2026-09-18¤cies=EUR,USD,HUF"
{
"source": "BNR",
"quote_currency": "RON",
"date": "2026-09-18",
"requested_date": "2026-09-18",
"rates": {
"EUR": {
"rate": 5.2644,
"multiplier": 1,
"unit_rate": 5.2644
},
"HUF": {
"rate": 1.4472,
"multiplier": 100,
"unit_rate": 0.014472
},
"USD": {
"rate": 4.5839,
"multiplier": 1,
"unit_rate": 4.5839
}
}
}
Conversion
GET /api/v1/convert
Converts an amount from one currency to another with exact arithmetic. The result is rounded as on the site: two decimals from 1 upwards, four significant digits below 1.
| Parameter | Meaning |
|---|---|
from | The currency to convert from, a three-letter code (required). |
to | The currency to convert to, a three-letter code (required). |
amount | The amount, with a decimal point, for example 100 or 99.50. Default 1. |
date | The date (YYYY-MM-DD). Default: the latest published day. The earliest is 2005-01-03; a date in the future is rejected. |
source | The source: bnr (default; RON for one unit or for 100 units of each currency) or ecb (units of each currency for 1 euro). |
$ curl "https://b24.ro/api/v1/convert?from=EUR&to=RON&amount=100&date=2026-09-18"
{
"source": "BNR",
"date": "2026-09-18",
"requested_date": "2026-09-18",
"from": "EUR",
"to": "RON",
"amount": 100,
"rate": 5.2644,
"result": 526.44,
"basis": "direct"
}
Console
Send a real request to the API from this page: the answer received appears below, with its time. Without JavaScript, the form opens the JSON answer.
{
"source": "BNR",
"date": "2026-09-18",
"requested_date": "2026-09-18",
"from": "EUR",
"to": "RON",
"amount": 100,
"rate": 5.2644,
"result": 526.44,
"basis": "direct"
}
Errors
An error has the fitting HTTP status and a JSON body shaped like {"error":{"code":"…","message":"…"}}. Messages are in English; programs should rely on the code field.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_query | The query string cannot be parsed. |
| 400 | invalid_date | The date is not YYYY-MM-DD or is given twice. |
| 400 | date_in_future | The requested date is after tomorrow. |
| 404 | no_rates_for_date | The date is before the first day of the history. |
| 400 | invalid_source | The source is neither bnr nor ecb. |
| 400 | invalid_currency | A currency code is missing or is not three letters. |
| 400 | invalid_amount | The amount is not a positive number with a decimal point, or is too large. |
| 404 | currency_not_quoted | The currency has no rate at the requested source and date. |
| 429 | rate_limited | Too many requests; see the Retry-After header. |
| 503 | data_incomplete | The history around the requested date is not fully imported yet. |
| 503 | no_data | Rates are not loaded yet; try again in a minute. |
| 404 | not_found | The address is not an endpoint of the API. |