Blog·Craft·

Which day's exchange rate?

A currency conversion needs a date as well as a rate. Historical lookups use the last published rate on or before the date you ask for.

If you rerun last month's report, it shouldn't quietly use a newer exchange rate just because you ran the code again. The date is part of the input.

The currency pair endpoint accepts it directly:

GET /currency/EUR/USD?date=2026-08-28&amount=100

date asks for the last published reference rates on or before that day. amount is optional. It adds the converted amount, rounded to the destination currency's number of decimal places. You can leave it off if you only need the rate.

Published rates don't have an entry for every calendar day. If you ask about a weekend and the latest available publication is from Friday, the response uses that earlier publication. It carries a date alongside rate, so your application can retain the publication date with the result instead of assuming it matches the requested date.

This is also why the endpoint doesn't fill missing history with the current rate. If either currency lacks a published rate in the history available for your request, the lookup returns 404. A successful-looking conversion using the wrong period would be much harder to spot later.

Without ?date=, you get the latest available reference rate. With it, an older report can ask about its own period. Keep the two currency codes, requested date, and returned result together, and the conversion remains understandable after the code that produced it has finished running.