This function will use the json api to retrieve dividends from Yahoo finance.
Arguments
- ticker
a single ticker symbol
- first_date
The first date of query (Date or character as YYYY-MM-DD)
- last_date
The last date of query (Date or character as YYYY-MM-DD)
Examples
yf_get_dividends(ticker = "PETR4.SA")
#> ℹ Be aware that YF does not provide a consistent dividend database. Use this function with caution.
#> # A tibble: 4 × 3
#> ref_date ticker dividend
#> <date> <chr> <dbl>
#> 1 2023-04-28 PETR4.SA 2.93
#> 2 2023-06-13 PETR4.SA 1.89
#> 3 2023-08-22 PETR4.SA 1.15
#> 4 2023-11-22 PETR4.SA 1.36