Pedro Camacho
14/abril/2017
This presentation is for the final project on the Developing Data Products part of the Data Science specialization.
This presentation is about the following shiny app https://www.shinyapps.io/admin/#/application/172373.
Steps:
base <- "https://api.intrinio.com/financials/standardized?identifier="
end <- "AAPL&statement=income_statement&fiscal_year=2015&fiscal_period=FY"
username <- "56e432e5f2755204fc7dca8dbea46c35"
password <- "6c2293b7d2772de2693255dffaea1011"
apicall <- paste(base, end, sep = "")
apicall #this is the URL to retrieve the json file
[1] "https://api.intrinio.com/financials/standardized?identifier=AAPL&statement=income_statement&fiscal_year=2015&fiscal_period=FY"
With the URL and using the get function we retrieve the information as follows:
library(httr); library(jsonlite)
call <- GET(apicall, authenticate(username,password, type = "basic"))
unlist <- suppressMessages(unlist(content(call, as = "text"))) #unlisting the file
json <- fromJSON(unlist) #parsing the json
After this we have a information that can be editable using simple R commands, in this case a vector with the information for year 2015. The app does this api call for the selected years and put them together on a table.