Currency Converter
Converts an amount between two currencies at our middle rate at noon (the 1200 session) for a given date.
Request
https://api.bnm.gov.my/v2/currency-converter| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | Yes | The currency to convert from: a 3-letter code from the list below, in any case. |
to | string | Yes | The currency to convert to: a 3-letter code from the list below, in any case. |
amount | string | No | The 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. |
date | string | No | The date of the rates, as YYYY-MM-DD. Default: the latest published date. |
- Only
GETandHEADare supported, and the path is exact: a trailing slash returns404. - 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 XDRThe 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. Withoutdate, the latest published date is used:data.datesays 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"
}
}| Field | Type | Description |
|---|---|---|
data.from | string | The currency converted from, in upper case. |
data.to | string | The currency converted to, in upper case. |
data.amount | string | The amount, as sent. |
data.rate | string | How much of to one unit of from buys, to 10 decimal places. |
data.result | string | amount converted into to, to 4 decimal places. |
data.myr_per_from | string | Our rate for from: ringgit per 1 unit. "1" when from is MYR. |
data.myr_per_to | string | Our rate for to: ringgit per 1 unit. "1" when to is MYR. |
data.rate_type | string | Always middle. |
data.session | string | Always 1200. |
data.date | string | The date of the rates used. |
meta.rounding | string | The 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_toEach 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."
}
}| Status | Name | Description |
|---|---|---|
400 | invalid_parameter | from or to missing, malformed or not a listed currency; amount or date malformed; an unknown or repeated parameter. |
401 | invalid_token | No API token, or one that is unknown or deleted. |
404 | rate_unavailable | No 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. |
404 | not_found | Wrong path, e.g. a trailing slash. |
405 | method_not_allowed | Any method other than GET or HEAD. |
503 | service_unavailable | Rates could not be loaded. Retry shortly. |
Try it
GET https://api.bnm.gov.my/v2/currency-converter?from=USD&to=MYR&amount=1Paste your token above to send a request.