You might expect every central bank to agree on what one US dollar was worth in euros today. They don't. Each sets its rate at a different local time, from a different market snapshot, and some round differently. The result is a spread of official rates for the same pair on the same day.

That matters when:

  • a group company books the same transaction in several countries,
  • you need the rate a specific regulator names, not just "an official rate", or
  • you want to check a figure someone sent you against its claimed source.

Every source in one call

/api/v1/central-banks/rates returns the latest official rate for one pair from every covered source: 123 central banks and 6 tax authorities.

curl -H "Authorization: Bearer $KEY" \ "https://allratestoday.com/api/v1/central-banks/rates?source=USD&target=EUR" 

Two rules keep this honest:

  • If a bank does not quote the pair directly, it is cross-computed from that bank's own table only. Banks are never mixed to make up a rate, and computed values are flagged as derived.
  • Sources whose tables are more than 30 days old (quarterly ones, for example) are still returned but marked stale, and they are left out of the min/max/median statistics.

Picking the one your rule names

const res = await fetch( 'https://allratestoday.com/api/v1/central-bank/bcb/latest?source=USD&target=BRL', { headers: { Authorization: `Bearer ${process.env.ALLRATES_KEY}` } } ); const { rate, rate_date, rate_type } = await res.json(); 

rate_type tells you which side of the table you got (reference, mid, buy or sell). Where a bank sets two sides, add type=buy or type=sell to choose.

The full picture

Official rates are one of three layers AllRatesToday serves from the same key:

  • Real-time mid-market: 160+ currencies, refreshed every 60 seconds.
  • Official: 123 central banks and 6 tax authorities, with history.
  • Commercial bank boards: buy and sell from 1,219 banks in 124 countries.

Compare the official spread with the live market and the banks' boards, and you can see exactly where a given number came from.

Docs: allratestoday.com/docs · Free key: allratestoday.com/register