Euro exchange rates
The official reference rates of the European Central Bank since 1999: a free static JSON API, with no server and no keys, and a PHP library. It updates itself every business day; latest publication: 2026-11-09.
JSON API PHP library Self-hosted API Packagist GitHub
JSON files on GitHub Pages: no server, no keys, open CORS.
codecruz/currency-flow on Packagist: lookups, history, cross rates and conversions.
The same data on your own domain, with custom ranges and a health check.
API
Every route is a static JSON file served by GitHub Pages, with open CORS. A route without data returns 404.
| Route | Contents |
|---|---|
/v1/latest.json | Latest publication, every currency |
/v1/rates/{YYYY-MM-DD}.json | Any day since 1999-01-04. Weekends and holidays return the previous publication. |
/v1/history/{CUR}.json | Full series of a currency |
/v1/history/{CUR}/{YYYY}.json | Series of a currency for one year |
/v1/currencies.json | Every currency ever published, with its period and whether it is still active |
/v1/meta.json | Source, coverage and generation time |
curl https://codecruz.github.io/currency-flow-api/v1/rates/2025-03-23.json
{
"base": "EUR",
"date": "2025-03-21",
"requested_date": "2025-03-23",
"source": "ECB",
"rates": { "AUD": "1.724", "BRL": "6.1911", "…": "…", "USD": "1.0827" }
}
- Rates state how many units of the currency equal 1 EUR.
- Values are decimal strings exactly as the ECB publishes them, so no precision is lost.
dateis the publication used andrequested_datethe date asked for. If they differ, it was a weekend or holiday.- The ECB publishes around 16:00 Frankfurt time on every TARGET business day.
PHP library
The same data for PHP 8.2+, with a PSR-16 cache, history, cross rates between any pair of currencies and conversions. Available on Packagist:
composer require codecruz/currency-flow
use CodeCruz\CurrencyFlow\CurrencyFlow;
$flow = CurrencyFlow::ecb();
$flow->rate('USD', '2025-03-23')->value; // "1.0827" (Sunday → Friday 21)
$flow->rate('GBP', '2025-03-21', base: 'USD')->value; // "0.773668"
$flow->convert(100, 'USD', 'GBP', '2025-03-21')->result; // "77.37"
$flow->history('USD', '2024-01-01', '2024-12-31'); // list<Rate>
Full documentation in the README.
Self-hosted API
If you need custom date ranges, your own domain or a health endpoint for your monitoring, the repository includes a ready-to-deploy HTTP API (Slim 4, RFC 7807 errors, ETags and an OpenAPI 3.1 specification):
GET /v1/rates/USD?date=2025-03-23
GET /v1/rates/USD/history?from=2024-06-01&to=2025-05-31
GET /health
Installation and deployment in server/README.md.