CenterOnBudget / getcensus

Load American Community Survey data from the U.S. Census Bureau API into Stata
https://centeronbudget.github.io/getcensus/
MIT License
14 stars 3 forks source link

Requests for block group data for 2012 and earlier should throw error #70

Open mgustina opened 1 month ago

mgustina commented 1 month ago

Bug description

****I am wrong! Although block group is described as being the smallest geography in overview pages for the years I'm interested in, it is not listed in the available geographies for any ACS year prior to 2013. Here is an example: https://api.census.gov/data/2011/acs/acs5/geography.html.

Sorry to have stolen your time! I think the API simply will not work before 2013 for block groups!****

When I try to pull block group data for years 2012 and earlier using the same specifications as 2013 forward, an error term is thrown. I've checked the Census Data API urls for these years and there are no changes to variable names or availability of 5 year estimates. Here is the code I used successfully: getcensus B19013_001 B25077_001, year(2013-2021) sample(5) geography(bg) countyfips(005) statefips(53) key(e113a09adfc0b4de317f087c5a81cea15b1c165f) And unsuccessfully: getcensus B19013_001 B25077_001, year(2012) sample(5) geography(bg) countyfips(005) statefips(53) key(e113a09adfc0b4de317f087c5a81cea15b1c165f)

I am using Stata 18.

Finally, thank you for making this. In general, it is wildly helpful to me.

Operating system

Windows

getcensus version

c-zippel commented 1 month ago

@mgustina Thanks for filing this issue, and glad you've found getcensus useful.

Concur that block group data for years before 2013 isn't available through the API. Looks like it's only available in the Summary File: https://www.census.gov/programs-surveys/acs/news/data-releases/2012/release.html

Not a waste of my time at all -- now I know getcensus should throw an error when users request block group data before 2013. Will plan to include that in the next release. Changing the name of this issue to reflect that.