hrecht / censusapi

R package to retrieve U.S. Census data and metadata via API
https://www.hrecht.com/censusapi/
169 stars 30 forks source link

1990 & 2000 decennial API endpoint update #69

Closed CharlieRDN closed 2 years ago

CharlieRDN commented 3 years ago

Hello. I have found censusapi to run faster than tidycensus. However, I am worried about the new 1990 & 2000 decennial API endpoint update. tidycensus appears to be working on the new 1990 and 2000 endpoints: https://github.com/walkerke/tidycensus/issues/293 When will censusapi also be updated to the new API endpoints?

I tried:

getCensus(name = "sf1", vintage = 2000, vars = "P001001", region = paste0("tract:*"), regionin = paste0("state:",01,"+county:",001))

which I believe had worked previously. (I tried a basic test case but perhaps the error is mine).

I received this error message:

Error in apiParse(req) : The Census Bureau returned the following error message: There was an error while running your query. We've logged the error and we'll correct it ASAP. Sorry for the inconvenience. Your api call was: https://api.census.gov/data/2000/sf1?key=[:)]&get=P001001&for=tract%3A%2A&in=state%3A1%2Bcounty%3A1

This could be an issue on the Census Bureaus end. However I believe the new 200 sf1 endpoint is "https://api.census.gov/data/2000/dec/sf1...." whereas this queried: https://api.census.gov/data/2000/sf1..."

I am using version 0.7.0 of censusapi. Thanks for your help.

hrecht commented 3 years ago

This package uses whatever endpoint name you give it. So type name="dec/sf1" instead of "sf1" to use that endpoint. The package does not need to be updated when the Census Bureau makes changes because endpoint urls are not baked in.

The Census Bureau deprecated the 1990 and 2000 Decennial endpoints this month, they have not announced when replacements will be active.

CharlieRDN commented 3 years ago

Thank you for clarifying. Sorry for my misinterpretation.