Skip to contents

Obtain currency exchange rates from the Interbank Foreign Exchange Market in Kuala Lumpur in relation to Ringgit.

Usage

get_exchange_rate(currency = NULL, session = "1130", quote = "rm")

Source

https://apikijangportal.bnm.gov.my/

Arguments

currency

3-characters currency code based on ISO4217 standard

session

Character string "0900", "1130", "1200" or "1700". A snapshot of the exchange rate daily at 0900, 1130, 1200 and 1700 intervals

quote

Base currency (Ringgit ("rm") or foreign currency ("fx")) as the denominator for the exchange rate

Examples

get_exchange_rate()
#> # A tibble: 7 x 3
#>   currency_code  unit rate$date  $buying_rate $selling_rate $middle_rate
#>   <chr>         <int> <chr>             <dbl>         <dbl> <lgl>       
#> 1 USD               1 2021-12-31         4.16          4.18 NA          
#> 2 SGD               1 2021-12-31         3.06          3.11 NA          
#> 3 JPY             100 2021-12-31         3.60          3.65 NA          
#> 4 GBP               1 2021-12-31         5.60          5.65 NA          
#> 5 EUR               1 2021-12-31         4.70          4.74 NA          
#> 6 CAD               1 2021-12-31         3.25          3.29 NA          
#> 7 AUD               1 2021-12-31         3.00          3.04 NA