DEV Community

Exchange Rate API
Exchange Rate API

Posted on Originally published at allratestoday.com

39 Banks in Spain: USD Buy and Sell Rates in One API Call

Every bank in Spain posts its own buy and sell prices for foreign currency, and they are rarely the same. AllRatesToday reads 39 of those bank boards and puts them in one table at Spain bank exchange rates, with the European Central Bank official rate as the reference row and the the EU customs authorities customs rate under it. This post shows what the table says today and how to get the same data from the API.

How bank rates work in Spain

Spanish banks quote foreign currency per 1 euro, with separate tables for non-cash currency (divisas) and bank notes (billetes); the non-cash table is shown here, inverted to euros per unit. The European Central Bank’s reference rate sits between the buy and sell. The European Central Bank official rate is shown next to each row.

USD at banks in Spain today

The US dollar on the boards read on 26 November 2026, in EUR per 1 USD, narrowest spread first (15 of 39 shown; the page lists all of them):

Bank Buy Sell Spread
European Central Bank (official) 0.9145
the EU customs authorities (customs) 0.8902
Ruralnostra 0.9097 0.9138 0.45%
Caja de Ingenieros 0.9099 0.9144 0.50%
Banco Cooperativo Español 0.9090 0.9146 0.61%
Banca March 0.9065 0.9175 1.20%
Kutxabank 0.9080 0.9199 1.30%
Caja Rural Central 0.9048 0.9189 1.55%
Cajamar Caja Rural 0.9064 0.9210 1.60%
Eurocaja Rural 0.9048 0.9234 2.04%
Arquia Banca 0.9025 0.9212 2.05%
Caja Rural de Teruel 0.9021 0.9217 2.15%
Caixa Rural de Onda 0.9021 0.9217 2.15%
Caja Rural de Zamora 0.8994 0.9245 2.75%
Caja Rural de Extremadura 0.8981 0.9259 3.05%
Caja Rural de Asturias 0.8981 0.9259 3.05%
Caixa Rural Galega 0.8981 0.9259 3.05%
  • Spread range: from 0.45% to 6.60% on USD across 39 transfer boards. Spread is (sell − buy) ÷ mid, the cost of a round trip before fees.
  • Best board for a customer: Caja de Ingenieros paid the most for USD (buy 0.9099), and Ruralnostra charged the least (sell 0.9138).
  • Official rate: the European Central Bank rate was 0.9145 EUR per USD. Bank buy and sell prices sit either side of it.
  • Customs rate: the EU customs authorities set 0.8902 EUR per USD for converting customs values. It is fixed for its period, so it drifts from the daily official rate (2.66% apart today).

The page switches between all 45 currencies the boards in Spain quote, and each row carries the bank's own last-updated time where the bank prints one.

Three rates, three uses

  • Bank board rate: what a customer of that bank is actually charged, at the counter or on a transfer. Retail and indicative: banks change it through the day.
  • Official rate: the European Central Bank rate. Use it for accounting, reporting and anything that has to match a published reference.
  • Customs rate: the rate set by the EU customs authorities, used to convert the value on an import declaration. It is set for a period, not daily.

Get the same data from the API

Every bank in Spain, latest board each, plus the official source and date:

curl "https://allratestoday.com/api/v1/bank-rates/es" \
  -H "Authorization: Bearer YOUR_API_KEY"
Enter fullscreen mode Exit fullscreen mode

One bank, one currency:

curl "https://allratestoday.com/api/v1/bank-rates/es/ruralnostra?ccy=USD" \
  -H "Authorization: Bearer YOUR_API_KEY"
Enter fullscreen mode Exit fullscreen mode

Each rate row returns ccy, buy, sell, mid, spread_pct, official and vs_official_pct, so ranking banks or alerting on a widening spread is a sort, not a scrape. Past days are kept: add ?date=YYYY-MM-DD, or read one currency over a range with /es/ruralnostra/history?ccy=USD&from=…&to=….

In JavaScript:

const res = await fetch('https://allratestoday.com/api/v1/bank-rates/es', {
  headers: { Authorization: `Bearer ${process.env.ALLRATES_KEY}` },
});
const { banks } = await res.json();
const rows = banks
  .map((b) => ({ bank: b.name, r: b.rates.find((x) => x.ccy === 'USD') }))
  .filter((x) => x.r && x.r.buy != null)
  .sort((a, b) => a.r.spread_pct - b.r.spread_pct);
console.table(rows.map((x) => ({ bank: x.bank, buy: x.r.buy, sell: x.r.sell, spread: x.r.spread_pct })));
Enter fullscreen mode Exit fullscreen mode

A free key is at allratestoday.com/register. The live table, with every bank and currency, is at Spain bank exchange rates.

Bank board rates are each bank's own retail prices as shown on its website when read; they are indicative and can change during the day. The official rate is the European Central Bank's.

Top comments (0)