I would like to download data from the following url 'https://ghoapi.azureedge.net/api/HWF_0006'.
I have tried this:
library(RCurl)
content <- getURL ('https://ghoapi.azureedge.net/api/HWF_0006')
And this is the error message that i got:
> content <- getURL ('https://ghoapi.azureedge.net/api/HWF_0006')
Error in function (type, msg, asError = TRUE) :
Failed to connect to ghoapi.azureedge.net port 443: Timed out
Any ideas on how to solve this?
Thank you very much,
N.
As far as I can tell, it looks like you're trying to read a JSON file. You can easily do that with jsonlite
package:
library(jsonlite)
df <- fromJSON('https://ghoapi.azureedge.net/api/HWF_0006')
And parse it/unnest it as you please.
> df <- fromJSON('ghoapi.azureedge.net/api/HWF_0006') Error in open.connection(con, "rb") : Failed to connect to ghoapi.azureedge.net port 443: Timed out
Same here.. "failed to connect". I guess it has nothing to do with the code?
That's interesting, no problem for me on
jsonlite
V1.6 andcurl
V4.3Ok, so it works when doing this:library(jsonlite) con <- url("ghoapi.azureedge.net/api/HWF_0006", "rb") df <- fromJSON(con)