{"action":"created","issue":{"url":"https://api.github.com/repos/hrecht/censusapi/issues/47","repository_url":"https://api.github.com/repos/hrecht/censusapi","labels_url":"https://api.github.com/repos/hrecht/censusapi/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/hrecht/censusapi/issues/47/comments","events_url":"https://api.github.com/repos/hrecht/censusapi/issues/47/events","html_url":"https://github.com/hrecht/censusapi/issues/47","id":375548261,"node_id":"MDU6SXNzdWUzNzU1NDgyNjE=","number":47,"title":"International Trade: Error in apiParse(req)","user":{"login":"MBlackmanEIA","id":44373802,"node_id":"MDQ6VXNlcjQ0MzczODAy","avatar_url":"https://avatars3.githubusercontent.com/u/44373802?v=4","gravatar_id":"","url":"https://api.github.com/users/MBlackmanEIA","html_url":"https://github.com/MBlackmanEIA","followers_url":"https://api.github.com/users/MBlackmanEIA/followers","following_url":"https://api.github.com/users/MBlackmanEIA/following{/other_user}","gists_url":"https://api.github.com/users/MBlackmanEIA/gists{/gist_id}","starred_url":"https://api.github.com/users/MBlackmanEIA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MBlackmanEIA/subscriptions","organizations_url":"https://api.github.com/users/MBlackmanEIA/orgs","repos_url":"https://api.github.com/users/MBlackmanEIA/repos","events_url":"https://api.github.com/users/MBlackmanEIA/events{/privacy}","received_events_url":"https://api.github.com/users/MBlackmanEIA/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-30T15:24:49Z","updated_at":"2018-11-06T00:46:30Z","closed_at":null,"author_association":"NONE","body":" Just an FYI that I'm not a professional programmer/researcher and this is my first time using R to pull Census data. \r\n\r\nI'm trying to workaround the fact that the Census API isn't designed for pulling full datasets. One of the macro teams at the DOE is interested in collecting and consolidating international trade data by HS and NAICS from the Census. \r\n\r\nLinked is one kind of dataset I was trying to pull from: https://api.census.gov/data/timeseries/intltrade/exports/hs\r\n\r\nI talked briefly to a Census supervisor for macro analysis and read through the API guide. Then, I tried to set up an API call in R using the censusapi pkg. Got the following:\r\n\r\n`Error in apiParse(req) : \r\n  The Census Bureau returned the following error message:\r\n There was an error while running your query.  We've logged the error and we'll correct it ASAP.  Sorry for the inconvenience.`\r\n\r\nWhat I was trying to do was limit the API call to only the export parameters by string and a handful of int type parameters that fall under a certain category like air, shipping, etc. The Census supervisor advised that I merge calls and filter out the summary lines by including the following: SUMMARY_LVL2=HSCYCSDTRP, COMM_LVL=HS10, and SUMMARY_LVL=DET\r\n\r\nI'm not sure if the issue is I'm calling too many variables at once or something else.\r\n\r\nBelow is what I'm doing based off the tutorial:\r\n\r\n```\r\nx<-c(\"censusapi\", \"data.table\")\r\nrequire(x)\r\nlapply(x, require, character.only = TRUE)\r\napis <- listCensusApis()\r\nView(apis)\r\n\r\nexample <- listCensusMetadata(name = \"timeseries/intltrade/exports/hs\", type = \"variables\")\r\nhead(example)\r\n\r\nHS.Mon.Exports <- getCensus(name = \"timeseries/intltrade/exports/hs\",\r\nvars = c(\"AIR_VAL_MO\", \"AIR_VAL_YR\",\t\"AIR_WGT_MO\", \"AIR_WGT_YR\", \"SUMMARY_LVL=DET\",\r\n\"QTY_1_YR_FLAG\",\t\"DIST_NAME\",\t\"YEAR\",\t\"CTY_NAME\",\t\"COMM_LVL=HS10\", \r\n\"E_COMMODITY_SDESC\",\t \"DF\",\t\"MONTH\", \"CTY_CODE\",\t\"LAST_UPDATE\", \"DISTRICT\",\r\n\"E_COMMODITY_LDESC\",\t\"QTY_1_MO_FLAG\",\t\"SUMMARY_LVL2=HSCYCSDTRP\",\t\"E_COMMODITY\",\r\n\"UNIT_QY2\", \"UNIT_QY1\",\t\"QTY_2_MO_FLAG\", \"QTY_2_YR_FLAG\",\r\n\"E_COMMODITY\",\"UNIT_QY1\"), region = \"us:*\") \r\nhead(HS.Mon.Exports)\r\n```\r\n\r\nLet me know if what I'm saying is confusing or unclear. Thank you for your time!\r\n"},"comment":{"url":"https://api.github.com/repos/hrecht/censusapi/issues/comments/436090295","html_url":"https://github.com/hrecht/censusapi/issues/47#issuecomment-436090295","issue_url":"https://api.github.com/repos/hrecht/censusapi/issues/47","id":436090295,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjA5MDI5NQ==","user":{"login":"hrecht","id":9753760,"node_id":"MDQ6VXNlcjk3NTM3NjA=","avatar_url":"https://avatars0.githubusercontent.com/u/9753760?v=4","gravatar_id":"","url":"https://api.github.com/users/hrecht","html_url":"https://github.com/hrecht","followers_url":"https://api.github.com/users/hrecht/followers","following_url":"https://api.github.com/users/hrecht/following{/other_user}","gists_url":"https://api.github.com/users/hrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/hrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrecht/subscriptions","organizations_url":"https://api.github.com/users/hrecht/orgs","repos_url":"https://api.github.com/users/hrecht/repos","events_url":"https://api.github.com/users/hrecht/events{/privacy}","received_events_url":"https://api.github.com/users/hrecht/received_events","type":"User","site_admin":false},"created_at":"2018-11-06T00:46:30Z","updated_at":"2018-11-06T00:46:30Z","author_association":"OWNER","body":"Yep, that will be what Census needs to debug."}}
{"actor":{"display_login":"hrecht"}}