jtleider / censusdata

Download data from Census API
MIT License
139 stars 29 forks source link

Queries for all us census tracts timing out #43

Closed criscres closed 2 years ago

criscres commented 2 years ago

Hi, I am trying to run queries for acs5 2015 for all census tracts in all US states. I had already run this in the past (a few months ago) for 2016, so my code was set up and I was hoping to just rerun the whole scrip once. However, just trying to run my same code for 2016 again yields the following error:

Unexpected response (URL: https://api.census.gov/data/2015/acs/acs5?get=NAME,B23025_003E,B23025_005E,B15003_001E,B15003_002E,B15003_003E,B15003_004E,B15003_005E,B15003_006E,B15003_007E,B15003_008E,B15003_009E,B15003_010E,B15003_011E,B15003_012E,B15003_013E,B15003_014E,B15003_015E,B15003_016E&for=block+group:*&in=state:08+county:*): Sorry, the system is currently undergoing maintenance or is busy. Please try again later. My code: I basically write a loop to go through a list of states and use a query very similar to the Example 1 in https://jtleider.github.io/censusdata/example1.html.

For instance, using your Example 1 for all states, the code below makes the error pop up.

for i in range(len(state_lst)):
      cookbg = censusdata.download('acs5', 2015,
                               censusdata.censusgeo([('state', state_lst[i]), ('county', '*'), ('block group', '*')]),
                               ['B23025_003E', 'B23025_005E', 'B15003_001E', 'B15003_002E', 'B15003_003E',
                                'B15003_004E', 'B15003_005E', 'B15003_006E', 'B15003_007E', 'B15003_008E',
                                'B15003_009E', 'B15003_010E', 'B15003_011E', 'B15003_012E', 'B15003_013E',
                                'B15003_014E', 'B15003_015E', 'B15003_016E'])

I basically have 20 or 30 of queries like this one and none work with the whole list of states, although they worked perfectly fine some months ago...

I can run it state by state and, for some of my queries, multiple states in a loop work, but I just wanted to do a loop for all states as i had done in the past. Is there a scheduled maintenance that will soon be complete? I have been having this error for the past 3 days.

Thanks!

jtleider commented 2 years ago

This error is coming from the Census Bureau, not the package. I would encourage you to reach out to them with any questions. Thank you.