Closed beechnut closed 10 years ago
If we a have multiple blockgroups across different tracts, it would make sense to batch the requests as much as possible to keep the rate down.
If I have the following blockgroup IDs:
["25 025 070101 1"
"25 025 070101 2"
"25 025 070102 1"
"25 025 070102 2"
"25 025 070102 3"]
The requests should be:
# Request 1
'for=block+group=1,2&in:state:25+county:025+tract:070101'
# Request 2
'for=block+group=1,2,3&in:state:25+county:025+tract:070102'
and return an single results object that pretends like it was one request.
Unless I am misunderstanding, this is already possible:
@client.where({ fields: 'B00001_001E', level: 'BG', within: 'STATE:02+COUNTY:170+TRACT:000101' })
The above will give you all blockgroups within the supplied tract. If you only want specific blockgroups, you can do the following:
@client.where({ fields: 'B00001_001E', level: 'BG:1,2,3', within: 'STATE:02+COUNTY:170+TRACT:000101' })
Let's say I need to access data about blockgroups, and I know the full FIPS codes of the individual blockgroups. I should be able to request:
I think that the Census API itself should be able to parse blockgroup FIPS, but it doesn't, so we can hack our way through it for now.