ECB Exchange Rates
Finance Credits / request: 1Returns the latest exchange rates published by the European Central Bank. The base currency is EUR.
GET
https://api.apikodu.com/api/v1/exchangerates/ecb
Documentation
Overview
Returns ECB euro-based rates.
Authentication
Every request requires the x-api-key header. Credits used and remaining quota are returned in response headers (x-api-credits-used, x-api-remaining-credits, x-rate-limit-*).
Request
GET
https://api.apikodu.com/api/v1/exchangerates/ecb?code=USD
Query string. Empty code returns all rates.
Parameters
| Name | Type | Required | Default | Options | Description |
|---|---|---|---|---|---|
code |
string | Optional | — | USD JPY BGN CZK DKK GBP HUF PLN RON SEK CHF ISK NOK TRY AUD BRL CAD CNY HKD IDR ILS INR KRW MXN MYR NZD PHP SGD THB ZAR |
Currency code. Empty returns all rates. |
Response
| Name | Type | Description |
|---|---|---|
date |
string | ECB rate date (ISO datetime). |
source |
string | Always ECB. |
baseCurrency |
string | Base currency. Always EUR. rate is the amount per 1 EUR. |
rates |
array | Rate list. A single item when code is set. |
rates[].code |
string | ISO currency code (USD, GBP, TRY ...). |
rates[].rate |
number | 1 EUR = rate units of code. May be null. |
Errors
| HTTP | code | Description |
|---|---|---|
400 |
-225 |
code is not in the ECB list. |
503 |
-226 |
ECB rate cache is empty or could not be retrieved. |
401 |
-100 |
x-api-key is missing, empty, malformed, inactive, banned, expired, IP-restricted, or not allowed for this API. |
429 |
-221 |
Per-minute request limit exceeded. Response headers: x-rate-limit-limit, x-rate-limit-remaining, x-rate-limit-reset. |
429 |
— | Package credit quota cannot cover this request. Body may be { error, limit, currentUsage, requestCost } (no code field). |
500 |
-1 |
Unexpected server error. message is a generic error text without technical details. |
Notes
- Success body is { data: { ... } }. Error body is { code, message }. code is an ApiResponseCode enum value (negative integer).
Sample response
{
"data": {
"date": "2026-08-19T00:00:00",
"source": "ECB",
"baseCurrency": "EUR",
"rates": [
{
"code": "USD",
"rate": 1.0876
},
{
"code": "GBP",
"rate": 0.8542
},
{
"code": "TRY",
"rate": 36.2140
}
]
}
}
Code samples
const response = await fetch('https://api.apikodu.com/api/v1/exchangerates/ecb', {
method: 'GET',
headers: {
'x-api-key': 'YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data);
import requests
headers = {
'x-api-key': 'YOUR_API_KEY'
}
response = requests.get('https://api.apikodu.com/api/v1/exchangerates/ecb', headers=headers)
print(response.json())
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
var response = await client.GetStringAsync("https://api.apikodu.com/api/v1/exchangerates/ecb");
Console.WriteLine(response);
$response = file_get_contents('https://api.apikodu.com/api/v1/exchangerates/ecb', false, stream_context_create([
'http' => [
'header' => "x-api-key: YOUR_API_KEY"
]
]));
print_r(json_decode($response, true));
curl -X GET 'https://api.apikodu.com/api/v1/exchangerates/ecb' \
-H 'x-api-key: YOUR_API_KEY'
Start building in minutes
Create a free account, get your API key and send your first request in minutes.