Hi all,
I have been recently started using data imported by API which is usually in the JSON format.
For basic JSON this method has been working well
ULR <- paste("https://api.coingecko.com/api/v3/coins/ethereum/market_chart?vs_currency=usd&days=max",sep="")
RawData <- GET(ULR)
Data<-fromJSON(rawToChar(RawData$content))
I'm now trying to extract more complex API without success
With the same method
ULR<-"https://protocol-api.aave.com/data/users/liquidations-all/"
RawData <- GET(ULR)
Data<-fromJSON(rawToChar(RawData$content))
str(Data)
This Data is an unreadable large character but there is the text in there. Read the tibble package but it returns an empty table
FlatData <- flatten(as_tibble(Data))
Also found this alternative method but doesn't manage to do the last operation
library(httr)
library(dplyr)
jsonResponse <-GET("https://protocol-api.aave.com/data/users/liquidations-all/")
jsonResponseParsed <- content(jsonResponse, as="parsed")
modJson<-jsonResponseParsed$raw_data
What am I missing? Is it possible to read multi level JSON with R?
Thanks for your help