library(httr2) # Read VOO's file (one GET, no key), naming your own project fund <- request("https://tickerinside.com/api/v1/fund/voo.json") |> req_user_agent("MyProject/1.0 (+https://example.com)") |> req_perform() |> resp_body_json() # The date of the issuer's file the weights come from writeLines(paste("VOO holdings_as_of", fund$holdings_as_of)) # holdings maps each ticker to its weight in percent: sort it, largest first weights <- sort(unlist(fund$holdings), decreasing = TRUE) writeLines(paste(length(weights), "holdings, largest first")) writeLines(paste(names(weights), weights)) # The line to print under any figure you quote writeLines(fund$cite_as)