DEV Community

Exchange Rate API
Exchange Rate API

Posted on Originally published at allratestoday.com

OTP Bank Exchange Rate API: HUF Buy and Sell Rates as JSON

OTP Bank is Hungary’s largest bank. It re-issues its rate list several times each business day, with valuta (cash), deviza (transfer) and cheque columns for about 25 currencies and a validity time on every issue. This guide shows how to read that board as JSON: what the rates mean, how they compare with the Magyar Nemzeti Bank official rate, and the calls that return them.

What the OTP board shows

  • 26 currencies against the Hungarian forint: AED, AUD, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD, ILS, JPY, KRW, MXN, NOK, NZD, PLN, RON, RSD, RUB, SEK, SGD, TRY, UAH, USD and ZAR. Every value is HUF per 1 unit of the foreign currency.
  • The transfer (deviza) buy / sell pair. Hungarian banks publish a valuta board (cash) and a deviza board (transfers and account conversions), re-issued several times a day. The pair here is deviza. Yen and won are quoted per 100 units and shown here per 1. The Magyar Nemzeti Bank sets one official rate per business day.
  • USD on 13 November 2026: OTP bought at 327.01 and sold at 335.29 HUF, a spread of 2.50%. The Magyar Nemzeti Bank official rate was 330.65, so the bank's mid sat +0.15% from it.
  • The bank's own timestamp. The page prints a last-updated stamp (2026-11-13T11:55:05.000+01:00 on the board above), returned as bank_updated_at next to our captured_at.
  • Every day's board is kept permanently, from 13 November 2026, the day collection started. Read one past day with ?date=, or a range for one currency with the /history endpoint (paid plans).

Spreads across the board

On the 13 November 2026 board the tightest spreads were UAH (2.47%), RUB (2.48%), NOK (2.48%) and the widest TRY (2.59%), RSD (2.57%), CZK (2.54%). Spread is (sell − buy) ÷ mid: what a round trip through the bank costs, before any fees. The API returns it on every row as spread_pct, so you can rank currencies or alert when a bank widens its board.

Get the board (REST)

You need an API key; the free key works. The full board:

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

What comes back (the 13 November 2026 board, first three rows):

{
  "bank": "otp",
  "name": "OTP Bank",
  "country": "hu",
  "quote_ccy": "HUF",
  "bank_updated_at": "2026-11-13T11:55:05.000+01:00",
  "basis": "Transfer (deviza) buy / sell",
  "captured_at": "2026-11-13T12:18:50.471Z",
  "rates": [
    {"ccy":"AED","buy":89.03,"sell":91.29,"mid":90.16,"spread_pct":2.507,"official":null,"vs_official_pct":null},
    {"ccy":"AUD","buy":221.99,"sell":227.61,"mid":224.8,"spread_pct":2.5,"official":224.71,"vs_official_pct":0.04},
    {"ccy":"CAD","buy":229.2,"sell":235.01,"mid":232.105,"spread_pct":2.503,"official":231.89,"vs_official_pct":0.093},
    … 23 more currencies
  ],
  "disclaimer": "…",
  "attribution": { … }
}
Enter fullscreen mode Exit fullscreen mode

One currency, with the row fields at the top level:

curl "https://allratestoday.com/api/v1/bank-rates/hu/otp?ccy=USD" \
  -H "Authorization: Bearer art_live_your_key"
Enter fullscreen mode Exit fullscreen mode
{
  "bank": "otp",
  "name": "OTP Bank",
  "country": "hu",
  "quote_ccy": "HUF",
  "bank_updated_at": "2026-11-13T11:55:05.000+01:00",
  "basis": "Transfer (deviza) buy / sell",
  "captured_at": "2026-11-13T12:18:50.471Z",
  "ccy": "USD",
  "buy": 327.01,
  "sell": 335.29,
  "mid": 331.15,
  "spread_pct": 2.5,
  "official": 330.65,
  "vs_official_pct": 0.151,
  "disclaimer": "Retail buy/sell rates as displayed on each bank’s own website at capture time, quoted as home currency per 1 unit of foreign currency. Indicative only: banks change these through the day, apply them at the counter or in-app, and they are not official or reference rates. For the rate a regulation names, use the central-bank endpoints.",
  "attribution": {
    "source": "Board rates published by OTP Bank on its own website, collected by AllRatesToday",
    "bank_url": "https://www.otpbank.hu/portal/en/Arfolyamok/OTP",
    "url": "https://allratestoday.com/bank-exchange-rate-api/hu/otp/",
    "terms": "Public pages that show the rates need a visible link to allratestoday.com"
  }
}
Enter fullscreen mode Exit fullscreen mode

The board as it stood on a past day:

curl "https://allratestoday.com/api/v1/bank-rates/hu/otp?date=2026-11-13" \
  -H "Authorization: Bearer art_live_your_key"
Enter fullscreen mode Exit fullscreen mode

One currency over a date range, one row per day (paid plans; add &format=csv, xml or xlsx for a file):

curl "https://allratestoday.com/api/v1/bank-rates/hu/otp/history?ccy=USD&from=2026-11-13&to=2026-11-13" \
  -H "Authorization: Bearer art_live_your_key"
Enter fullscreen mode Exit fullscreen mode

JavaScript

npm install @allratestoday/sdk
Enter fullscreen mode Exit fullscreen mode
import { AllRatesToday } from '@allratestoday/sdk';

const client = new AllRatesToday({ apiKey: 'art_live_your_key' });

// OTP Bank's USD row
const r = await client.bankRates('hu', { bank: 'otp', ccy: 'USD' });
console.log(`OTP buys USD at ${r.buy}, sells at ${r.sell} HUF`);

// The board as it stood on a past day
const past = await client.bankRates('hu', { bank: 'otp', date: '2026-11-13' });
console.log(past.snapshot_date, past.rates.length);
Enter fullscreen mode Exit fullscreen mode

Python

import requests

r = requests.get(
    "https://allratestoday.com/api/v1/bank-rates/hu/otp",
    headers={"Authorization": "Bearer art_live_your_key"},
    timeout=10,
)
r.raise_for_status()
for row in r.json()["rates"]:
    print(row["ccy"], row["buy"], row["sell"], row["spread_pct"])
Enter fullscreen mode Exit fullscreen mode

Board rate or official rate?

The Magyar Nemzeti Bank rate is the one tax, accounting and customs rules in Hungary name; nobody transacts at it. OTP's board is the price a customer actually gets. The API puts both on every row: official is the central bank's rate for the same currency and vs_official_pct is how far the bank's mid sits from it. Use the board to show customers a real price, compare banks for a remittance, or keep a dated record of what the bank quoted; use the Magyar Nemzeti Bank endpoint when a rule asks for the official rate.

FAQ

Where do the OTP Bank rates come from?

From the bank's own public rates page (https://www.otpbank.hu/portal/en/Arfolyamok/OTP), read hourly. AllRatesToday does not change the numbers: each row is the buy and sell price OTP shows, with the mid, the spread and the Magyar Nemzeti Bank rate added.

Are these the official HUF exchange rates?

No. They are OTP's retail prices for customers. The official rate in Hungary is the Magyar Nemzeti Bank rate, which the API returns as official on each row where the central bank has one, and in full from the central-bank endpoint.

How often is the OTP board updated?

AllRatesToday reads the page every hour. The bank's own last-updated stamp is returned as bank_updated_at, so you can tell a fresh read of an unchanged board from a new board.

Can I get OTP rates for a past date?

Yes, from 13 November 2026 onward; every day's board is kept permanently. Add ?date=YYYY-MM-DD for one day: the response is the board captured that day, or the nearest earlier day within five days, with date_requested and snapshot_date added. For a range, /history?ccy=USD&from=…&to=… returns one row per day as JSON, CSV, XML or XLSX on paid plans.

Do I need an API key?

Yes. Commercial bank boards need an API key; any plan works, the free key included, and each call counts against the plan. Public pages or widgets that show the rates need a visible link to allratestoday.com.


Live board, refreshed hourly: OTP Bank rates on AllRatesToday. Every bank in Hungary side by side: Hungary bank rates.

Top comments (0)