Adding to the solution of @Martin by providing some R code (if one does not have access to a Bloomberg terminal), then you can get quarterly earnings from the alphavantage API. One way of doing this (Apple is used as an example):
av_api_key(YOUR API KEY HERE)
temp <- GET("https://www.alphavantage.co/query?
function=EARNINGS&symbol=AAPL&apikey=YOUR API KEY HERE")
AAPL_earnings <- content(temp)
AAPL_earnings <- t(as.data.frame(AAPL_earnings$quarterlyEarnings))
Which will produce a dataframe on the form:
The "httr" package is used to scrape the webpage in the GET function, where "content" scrapes the body of the webpage which is a JSON file of data. More intuitively, you could also go to the website in the GET function $\rightarrow$ right-click $\rightarrow$ "save as", and then save it as a JSON file, which can be loaded into your preferable programming language.
Even though this is an old thread, I'll post it here for people who might have the same problems.