Ask "what is the USD to EUR rate right now?" and there are at least three correct answers:

  1. The mid-market rate: the live midpoint between buy and sell on the currency market. It moves every few seconds.
  2. The official rate: the one figure a central bank or tax authority sets for a given day. It never changes afterwards, and it is the number a tax return, customs declaration or audit asks for.
  3. The bank rate: the buy and sell prices a commercial bank shows its customers. This is what someone actually gets when they exchange money or receive a transfer.

They are not interchangeable. On an ordinary day they can sit a few percent apart, and for some currencies much further than that.

Most exchange rate APIs serve only the first. If your app also needs the second or third, you usually end up with three providers, three keys and three data shapes.

All three from one key

AllRatesToday serves all three layers behind the same key and the same JSON conventions:

Layer Endpoint Coverage
Mid-market, real time /api/v1/rates 160+ currencies, refreshed every 60 seconds
Official /api/v1/central-bank/{source}/latest 123 central banks + 6 tax authorities
Commercial bank boards /api/v1/bank-rates/{country}/{bank} 1,219 banks in 124 countries

We haven't found another API that combines all three. That combination is the reason this API exists.

KEY=your_api_key # 1. Mid-market, now curl -H "Authorization: Bearer $KEY" \ "https://allratestoday.com/api/v1/rates?source=USD&target=LKR" # 2. Official: Central Bank of Sri Lanka curl -H "Authorization: Bearer $KEY" \ "https://allratestoday.com/api/v1/central-bank/cbsl/latest?source=USD&target=LKR" # 3. What a Sri Lankan bank pays for those dollars curl -H "Authorization: Bearer $KEY" \ "https://allratestoday.com/api/v1/bank-rates/lk" 

Which one should you use?

  • Showing a price, a converter or a dashboard? Use the mid-market rate.
  • Booking an invoice, filing VAT, valuing customs or closing the books? Use the official rate from the authority your rules name, and store its rate_date.
  • Telling a user how much their transfer will actually be worth? Use the bank's buy rate, and show the spread.

Many apps need two of these, and some need all three. A remittance app quotes the mid-market rate, shows the receiving bank's buy rate, and records the central bank's official rate for compliance.

Get started

A free API key is available at allratestoday.com/register. The documentation covers every endpoint, and there are SDKs for JavaScript, Python, PHP and Go.