Open
Description
Line 352 in e3df949
Description
I'm encountering an error when trying to fetch block group level demographics data using the state_county_blockgroup
function. The API returns "unknown/unsupported geography hierarchy" when I make calls with certain tract and block group codes.
Steps to Reproduce
- Set up Census client with a valid API key
- Attempt to fetch block group level data using code similar to:
from census import Census
# Initialize client
census = Census(api_key, year=2011)
# Error occurs when trying to fetch data for:
# state_fips=48, county_fips=339, blockgroup=1, tract=694201
data = census.acs5.state_county_blockgroup(
fields=['B01001_001E'], # Population estimate
state_fips='48',
county_fips='339',
blockgroup='1',
tract='694201'
)
Error Message
Error fetching data for GEOID 483396942011: error: unknown/unsupported geography hierarchy
What I've Tried
- Ensured all FIPS codes are properly formatted as strings
- Verified that the tract and block group values match the expected format
Possible Issues
I suspect the issue might be related to:
- The tract code format (694201) - possibly needs leading zeros?
- The year 2011 possibly having different geography hierarchy requirements
- The combination of these specific geography codes may not exist or may require a different format
Additional Context
I'm trying to fetch demographics data for multiple block groups in a pandas dataframe, and this error occurs for each record.
Any help or guidance would be greatly appreciated!
Metadata
Metadata
Assignees
Labels
No labels