Skip to contents

This function allows you to obtain daily interbank money market rates and volumes of transactions according to tenure. (2015 - present) from the BNM API.

Usage

get_interest_rate(
  product = "money_market_operations",
  date = NULL,
  year = NULL,
  month = NULL
)

Source

https://api.bnm.gov.my/

Arguments

product

One of "money_market_operations", "interbank" or "overall"

date

Character string of date with format as defined by RFC 3339, section 5.6 (YYYY-MM-DD). If specified, return values for the specified date.

year

Year and month as integers. If date, year and month left blank, return today's values.

month

Year and month as integers. If date, year and month left blank, return today's values.

Examples

if (FALSE) get_interest_rate()
get_interest_rate(date = "2018-01-01")
#> # A tibble: 1 x 4
#>   date       overnight `1_week` `1_month`
#>   <chr>          <dbl>    <dbl>     <dbl>
#> 1 2018-01-01      2.91     3.02      3.08
get_interest_rate(year = 2016, month = 2)
#> # A tibble: 29 x 7
#>    date       overnight `1_week` `1_month` `3_month` `6_month` `1_year`
#>    <chr>          <dbl>    <dbl>     <dbl> <lgl>     <lgl>     <lgl>   
#>  1 2016-02-01      3.07     3.14      NA   NA        NA        NA      
#>  2 2016-02-02      3.1      3.15       3.2 NA        NA        NA      
#>  3 2016-02-03      3.23    NA         NA   NA        NA        NA      
#>  4 2016-02-04      3.13     3.14      NA   NA        NA        NA      
#>  5 2016-02-05      3.06    NA         NA   NA        NA        NA      
#>  6 2016-02-06      3.06    NA         NA   NA        NA        NA      
#>  7 2016-02-07      3.06    NA         NA   NA        NA        NA      
#>  8 2016-02-08      3.06    NA         NA   NA        NA        NA      
#>  9 2016-02-09      3.06    NA         NA   NA        NA        NA      
#> 10 2016-02-10      3.09     3.14      NA   NA        NA        NA      
#> # ... with 19 more rows
get_interest_rate(product = "overall", year = 2016, month = 2)
#> # A tibble: 28 x 7
#>    date       overnight `1_week` `1_month` `3_month` `6_month` `1_year`
#>    <chr>          <dbl>    <dbl>     <dbl> <lgl>     <lgl>     <lgl>   
#>  1 2016-02-01      3.07     3.14      3.5  NA        NA        NA      
#>  2 2016-02-02      3.1      3.16      3.2  NA        NA        NA      
#>  3 2016-02-03      3.22     3.24      3.36 NA        NA        NA      
#>  4 2016-02-04      3.13     3.14     NA    NA        NA        NA      
#>  5 2016-02-05      3.06     3.22     NA    NA        NA        NA      
#>  6 2016-02-06      3.06     3.22     NA    NA        NA        NA      
#>  7 2016-02-07      3.06     3.22     NA    NA        NA        NA      
#>  8 2016-02-08      3.06     3.22     NA    NA        NA        NA      
#>  9 2016-02-10      3.09     3.14     NA    NA        NA        NA      
#> 10 2016-02-11      3.05     3.16     NA    NA        NA        NA      
#> # ... with 18 more rows