/v2

Currency Converter

Converts an amount between two currencies at our middle rate at noon (the 1200 session) for a given date.

Request

GEThttps://api.bnm.gov.my/v2/currency-converter
ParameterTypeRequiredDescription
fromstringYesThe currency to convert from: a 3-letter code from the list below, in any case.
tostringYesThe currency to convert to: a 3-letter code from the list below, in any case.
amountstringNoThe amount to convert: a non-negative decimal of up to 15 integer digits and 8 decimal places, without a sign, exponent or thousands separators. Default 1.
datestringNoThe date of the rates, as YYYY-MM-DD. Default: the latest published date.
  • Only GET and HEAD are supported, and the path is exact: a trailing slash returns 404.
  • Any other query parameter, or a parameter given more than once, returns 400.

Currencies

MYR and the 27 currencies we publish a noon rate for:

AED AUD BND CAD CHF CNY EGP EUR GBP HKD IDR INR JPY KHR KRW MMK NPR NZD PHP PKR SAR SGD THB TWD USD VND XDR

The IMF’s Special Drawing Right is XDR; SDR is not accepted.

Dates

  • Rates exist for business days from 2 January 1997.
  • Each day’s rate is published after about 12:30 Malaysia time. Before then, today has no rate.
  • A date without a rate returns 404 (rate_unavailable); there is no fallback to an earlier date. Without date, the latest published date is used: data.date says which.
  • Some currencies were not quoted in earlier years (EUR in 1997, for example). Asking for one on such a date returns 404.

Response

{ "data": { "from": "USD", "to": "GBP", "amount": "1234.56", "rate": "0.7560930405", "result": "933.4422", "myr_per_from": "4.0795", "myr_per_to": "5.3955", "rate_type": "middle", "session": "1200", "date": "2026-09-30" }, "meta": { "rounding": "half up; rate to 10 decimal places, result to 4" } }
FieldTypeDescription
data.fromstringThe currency converted from, in upper case.
data.tostringThe currency converted to, in upper case.
data.amountstringThe amount, as sent.
data.ratestringHow much of to one unit of from buys, to 10 decimal places.
data.resultstringamount converted into to, to 4 decimal places.
data.myr_per_fromstringOur rate for from: ringgit per 1 unit. "1" when from is MYR.
data.myr_per_tostringOur rate for to: ringgit per 1 unit. "1" when to is MYR.
data.rate_typestringAlways middle.
data.sessionstringAlways 1200.
data.datestringThe date of the rates used.
meta.roundingstringThe rounding applied to rate and result.

Decimals are Strings

amount, rate, result, myr_per_from and myr_per_to are JSON strings, not numbers, so no precision is lost in transit. Parse them with a decimal type if you calculate with them.

Everything is per 1 Unit

rate is always for 1 unit of from, and myr_per_from and myr_per_to are ringgit per 1 unit, including the currencies we quote per 100 on our rate tables (JPY, IDR, THB and others). To quote per 100 or per 1,000 units, multiply rate: its 10 decimal places keep small values intact. amount is only the amount being converted, not a denomination.

How the Figures are Calculated

rate = myr_per_from ÷ myr_per_to result = amount × myr_per_from ÷ myr_per_to

Each line is calculated exactly and rounded once, half up. result comes from the exact rate, not the rounded rate field, so amount × rate may differ from result in the last digit. Rounding for display is up to you.

Errors

Errors use the standard error format.

{ "error": { "code": "rate_unavailable", "message": "No rate is available for 2026-09-27.", "hint": "Rates are published on business days after 12:30 MYT. Try an earlier date." } }
StatusNameDescription
400invalid_parameterfrom or to missing, malformed or not a listed currency; amount or date malformed; an unknown or repeated parameter.
401invalid_tokenNo API token, or one that is unknown or deleted.
404rate_unavailableNo rate for that date (a weekend, public holiday, not yet published, in the future or before 1997), or none for that currency on that date.
404not_foundWrong path, e.g. a trailing slash.
405method_not_allowedAny method other than GET or HEAD.
503service_unavailableRates could not be loaded. Retry shortly.

Try it

GET https://api.bnm.gov.my/v2/currency-converter?from=USD&to=MYR&amount=1

Paste your token above to send a request.