I would love to analyze balance sheets and income statements using R. I have come across package finstr.
There is an example of downloading AAPL stock data using this link accessing the XBRL data.
I would like to ask, how do I actually find out the link to the company I want? For example TSLA. I thought that it would be enough just to change the ticker and the date in the URL, obviously it does not work that way. I have been struggling for days to actually find that out, searching through SEC.
Basically I would like to get to a point, where I would be able to generate a link to any company in R (in case I want to write a loop in order to download financial statements data for al the listed companies).