hrecht / censusapi

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

Handle APIs that don't allow a `for` geography argument #38

Closed hrecht closed 5 years ago

hrecht commented 6 years ago

A few API endpoints do not allow using geography and break if you try to use one, including setting for=us:*.

The error message that these calls return is There was an error while running your query. We've logged the error and we'll correct it ASAP. Sorry for the inconvenience.

Almost all API uses are for endpoints that require geography, so I don't think it should necessarily be removed as a required argument. Perhaps this could be handled internally - if the endpoint name is in this list, don't pass for. Maybe.

I will also raise with the Census team to see if this can be fixed, or at least given a more useful error message.

hrecht commented 5 years ago

region is now an optional argument rather than required, beginning in 0.5.0 development version (https://github.com/hrecht/censusapi/commit/aaaedbc81679dc1aad52f9c12aed0a41b1f5e075)