I'm working with financial data and i want to scrape data from this site web.
CodePudding user response:
I see a POST API request called for historic data with the params as below:
'ticker'= 'BRVMAG', 'datedeb'= '2022-02-01', 'datefin'= '2022-03-29','xperiod'= '0'
I tested with removing headers and cookies and it seems they are not needed.
library(httr2)
library(magrittr)
r <- request("https://www.sikafinance.com/api/general/GetHistos") %>%
req_body_json(list('ticker'= 'BRVMAG', 'datedeb'= '2022-02-01', 'datefin'= '2022-03-29','xperiod'= '0')) %>%
req_perform() %>%
resp_body_json(simplifyVector = T)