The following code works for me
My_Data <- GET(url = "https://api.census.gov/data/timeseries/intltrade/exports/hs?get=CTY_CODE,CTY_NAME,ALL_VAL_MO&key=my_autho_key&YEAR=2017&MONTH=04")
I was wondering if there is anyway to acquire the above data by using the query = list in the GET() function. Any help or guidance would be appreciated.
Thanks, M
DavoWW
April 10, 2020, 7:30am
2
HI @mustafghan ,
You can do this:
library(httr)
GET("http://google.com/", path = "search", query = list(q = "green eggs and ham"))
So, I assume that you could do something like this:
GET("https://api.census.gov/data/timeseries/intltrade/exports/hs?get=CTY_CODE,CTY_NAME,ALL_VAL_MO",
query = list(key = "my_autho_key",
YEAR = "2017",
MONTH = "04"))
But, of course, I can't test it.
HTH
I had tried something similar which didn't work. But thanks.
system
Closed
May 1, 2020, 9:03pm
4
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.