BYTETOOLS

Bank Negara Malaysia API

Free Bank Negara Malaysia API with no key: official ringgit exchange rates with buying, selling and middle rates, plus base rates and Islamic finance series. Tested example.

No API key requiredHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

What is the Bank Negara Malaysia API?

Bank Negara Malaysia, the Malaysian central bank, publishes an open API needing no key. Its exchange rate endpoint returns official ringgit rates against every quoted currency with separate buying, selling and middle rates, along with the quotation unit each rate applies to.

The detail that makes this a genuine central bank feed rather than a consumer converter is the `unit` field. The yen is quoted per 100 units, the Emirati dirham per 100, the Australian dollar per 1, because those are the market conventions Bank Negara publishes against. Divide the rate by its unit before doing anything with it, or a yen conversion comes out two orders of magnitude wrong. Three rates come back for each currency — `buying_rate`, `selling_rate` and `middle_rate` — and only the middle rate is appropriate for indicative conversion.

There is one hard requirement that defeats most first attempts: you must send `Accept: application/vnd.BNM.API.v1+json`. Without it the server returns a bare 404 with an empty message, which reads exactly like a wrong URL and sends people hunting for a path that was correct all along. The same host serves base lending rates, interbank rates, Islamic interbank rates and kijang emas gold prices under sibling paths, all with the same header requirement. No CORS headers come back either, so browser code needs a proxy.

Quick facts

Base URL
https://api.bnm.gov.my/public
Authentication
No API key, but the custom `Accept: application/vnd.BNM.API.v1+json` header is mandatory — omit it and every endpoint returns 404.
Rate limit
No published limit. Rates are set once per business day, so cache for the day rather than polling.
Pricing
Free. Bank Negara Malaysia publishes the data openly for public use.
CORS
Not enabled — call it from your server
Official docs
Read the docs

How to use the Bank Negara Malaysia API

Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.

1. Fetch official ringgit exchange rates

GET https://api.bnm.gov.my/public/exchange-rate

curl
curl 'https://api.bnm.gov.my/public/exchange-rate' \
  -H 'Accept: application/vnd.BNM.API.v1+json'
JavaScript (fetch)
const res = await fetch("https://api.bnm.gov.my/public/exchange-rate", {
  headers: {
    "Accept": "application/vnd.BNM.API.v1+json",
  },
});
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

headers = {
    "Accept": "application/vnd.BNM.API.v1+json",
}

res = requests.get("https://api.bnm.gov.my/public/exchange-rate", headers=headers, timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200 (truncated)
{
  "data": [
    {
      "currency_code": "JPY",
      "unit": 100,
      "rate": {
        "date": "2026-08-21",
        "buying_rate": 2.5424,
        "selling_rate": 2.5462,
        "middle_rate": 2.5443
      }
    },
    {
      "currency_code": "AED",
      "unit": 100,
      "rate": {
        "date": "2026-08-21",
        "buying_rate": 110.0795,
        "selling_rate": 110.2216,
        "middle_rate": 110.1506
      }
    },
    {
      "currency_code": "AUD",
      "unit": 1,
      "rate": {
        "date": "2026-08-21",
        "buying_rate": 2.8859,
        "selling_rate": 2.8919,
        "middle_rate": 2.8889
      }
    },
    {
      "currency_code": "BND",
      "unit": 1,
      "rate": {
        "date": "2026-08-21",
        "buying_rate": 3.1827,
        "selling_rate": 3.1872,
        "middle_rate": 3.1849
      }
    },
    {
      "currency_code": "CAD",
      "unit": 1,
      "rate": {
        "date": "2026-08-21",
        "buying_rate": 2.9369,
        "selling_rate": 2.9408,
        "middle_rate": 2.9389
      }
    },
    {
      "currency_code": "CHF",
      "unit": 1,
      "rate": {
        "date": "2026-08-21",
        "buying_rate": 5.0556,
        "selling_rate": 5.0625,
        "middle_rate": 5.0591
      }
    },
    {
      "currency_code": "CNY",
      "unit": 1,
      "rate": {
        "date": "2026-08-21",
        "buying_rate": 0.6014,
        "selling_rate": 0.6023,
        "middle_rate": 0.6018
      }
    },
    {
      "currency_code": "EGP",
      "unit": 1,
      "rate": {
        "date": "2026-08-21",
        "buying_rate": 0.079

Parameters

ParameterTypeRequiredDescription
AcceptheaderRequiredMust be `application/vnd.BNM.API.v1+json`. This is not optional. application/vnd.BNM.API.v1+json
/exchange-ratepathOptionalLatest official exchange rates for all quoted currencies. /exchange-rate
sessionqueryOptionalQuotation session — rates are published at several times each business day. 1200
quotequeryOptional`rm` quotes against the ringgit, `fx` against the foreign currency. rm
/base-ratepathOptionalBase lending and financing rates by bank. /base-rate

Response fields

dataarray
One entry per quoted currency.
data[].currency_codestring
ISO 4217 code such as `JPY`, `AUD` or `AED`.
data[].unitinteger
How many units of the foreign currency the rate applies to — 100 for the yen, 1 for the Australian dollar. Divide by this before converting.
data[].rate.datestring
Business date the quotation applies to.
data[].rate.buying_ratefloat
Rate at which the bank buys the currency.
data[].rate.selling_ratefloat
Rate at which the bank sells it.
data[].rate.middle_ratefloat
Midpoint between the two. This is the rate to use for indicative conversion.
metaobject
Quote basis, session and last-updated stamp accompanying the data block.

What you can build with the Bank Negara Malaysia API

  • Convert amounts to and from Malaysian ringgit at official rates
  • Show a central bank reference rate rather than a market feed
  • Track ringgit movements against a basket of currencies
  • Compare Malaysian base lending rates across banks

Common errors and how to fix them

404 with an empty message

The custom Accept header is missing.

Fix: Send `Accept: application/vnd.BNM.API.v1+json`. The URL is almost certainly fine — this header is the whole problem.

Conversions wrong by a factor of 100

The `unit` field was ignored.

Fix: Divide the rate by `unit` before converting. The yen and dirham are quoted per 100 units.

CORS error in the browser

No Access-Control-Allow-Origin header is returned.

Fix: Call it from a server or serverless function and forward the result to your front end.

Rates look stale at the weekend

Quotations are published on business days only.

Fix: Read `rate.date` and label the figure with it rather than implying the rate is live.

Bank Negara Malaysia API — frequently asked questions

Does the Bank Negara Malaysia API need a key?

No key and no registration. It does require a custom Accept header, `application/vnd.BNM.API.v1+json`, on every endpoint, and that is the usual reason people see a 404.

Why is the yen rate so small?

Because it is quoted per 100 yen, as the `unit` field states. Divide the published rate by `unit` to get the per-unit figure. The Australian dollar has a unit of 1, the dirham 100.

Which of the three rates should I use?

The middle rate for indicative conversion. Buying and selling rates are the bank's two-way prices and include a spread, so they only apply if you are modelling an actual transaction.

What else does the API cover?

Base lending and financing rates, interbank and Islamic interbank rates, kijang emas gold prices and several other series, all on the same host and all requiring the same Accept header.

Tools that pair with this API

Bank Negara Malaysia is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.