sociome
sociome copied to clipboard
Issue with loading the ADI variables at the ZCTA-level
The current sociome code breaks down the calls into county-level calls to reduce the Census API load. This worked for all geo-levels in the past; however, it seems that Census does not recognizing county number in ZCTA searches anymore (i.e., zcta level information can only be retrieved for the entire state?)
This API call works: https://api.census.gov/data/2019/acs/acs5?get=NAME,B01001_001E&for=zip%20code%20tabulation%20area:&in=state:01&in=county:
This API call doesn't work anymore (note the county info): https://api.census.gov/data/2019/acs/acs5?get=NAME,B01001_001E&for=zip%20code%20tabulation%20area:*&in=state:01&in=county:001
Hence, sociome package throughs the census API error (unknown/unsupported geography) when running the get_adi function on ZCTA level.
Here is an example (assuming you have Census API key installed): dtx <- get_adi( geography = 'zip code tabulation area', state = 'MD', county = NULL, year = 2017, zcta = NULL, dataset = 'acs5', raw_data_only = TRUE, show_call = TRUE )
Which results in the following output:
Preliminary tidycensus call beginning... Getting data from the 2013-2017 5-year ACS Using FIPS code '24' for state 'MD' Census API call: https://api.census.gov/data/2017/acs/acs5?get=B11005_001E%2CB11005_001M%2CNAME&for=county%3A%2A&in=state%3A24
1 call(s) to tidycensus beginning. Getting data from the 2013-2017 5-year ACS Census API call: https://api.census.gov/data/2017/acs/acs5?get=B11005_001E%2CB11005_001M%2CB15003_001E%2CB15003_001M%2CB15003_002E%2CB15003_002M%2CB15003_003E%2CB15003_003M%2CB15003_004E%2CB15003_004M%2CB15003_005E%2CB15003_005M%2CB15003_006E%2CB15003_006M%2CB15003_007E%2CB15003_007M%2CB15003_008E%2CB15003_008M%2CB15003_009E%2CB15003_009M%2CB15003_010E%2CB15003_010M%2CB15003_011E%2CB15003_011M%2CB15003_012E%2CB15003_012M%2CB15003_017E%2CB15003_017M%2CB15003_018E%2CB15003_018M%2CB15003_019E%2CB15003_019M%2CB15003_020E%2CB15003_020M%2CB15003_021E%2CB15003_021M%2CB15003_022E%2CB15003_022M%2CB15003_023E%2CB15003_023M%2CB15003_024E%2CB15003_024M%2CB15003_025E%2CB15003_025M%2CB17010_001E%2CB17010_001M%2CB17010_002E%2CB17010_002M%2CNAME&for=zip%20code%20tabulation%20area%3A%2A&in=state%3A24%2Bcounty%3A001 Error: Your API call has errors. The API message returned is error: unknown/unsupported geography heirarchy.
The get_adi function should probably treat the ZCAT calls differently (i.e., doesn't split them into chucks of API pulls using county numbers)?
I am running into the same issue when specifying zcta, were you able to resolve this?
running into the same issue
Check it now with sociome 0.2.0.
remotes::install_github("NikKrieger/sociome")