I am running some code in R to retrieve macroeconomic data from different sources. I have been able to retrieve data from FRED using their R package API ('fredr') and also from Nasdaq using their R package API ('Quandl'). However, if I try to access EIA via XML or their R package API ('eia') I get the following error:
Request failed [404]. Retrying in 1.1 seconds...
Request failed [404]. Retrying in 3 seconds...
Error: Page not found
Has anyone experienced API issues such as this? In regards to the EIA package in R, the only solution I found was here on GitHub. However, I cannot load R packages from GitHub (company policy). Still, even if I did it wouldn't explain why the XML package didn't work. Somebody else also had issues with an API to the EIA website. The question was never resolved.
I tried both the EIA package (e.g. eia::eia_parent_cats(742)). I also tried the XML package e.g.
my.url = paste("http://api.eia.gov/series?series_id=", "PET.MCREXUS1.M","&api_key=",
eia_api_key, "&out=xml", sep="")
doc = XML::xmlParse(file=my.url, isURL=TRUE))