List Census Geography Levels
census_list_geographiesList the geography levels available for a given Census dataset and year, along with the parent geographies each level requires. Use before querying to confirm that the target geography level exists — ACS1 omits many sub-state levels, and not all datasets support tracts or block groups. The geography_level values returned here are the valid inputs to the geography_level parameter in census_query_data and census_compare_geographies.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | Vintage year. Defaults to the latest available year for the dataset. | |
| dataset | Yes | Dataset code (e.g., "acs/acs5", "acs/acs1"). Use census_list_datasets to discover valid values. Case is ignored, and a two-part code can be given by its last part alone — "acs5" is acs/acs5, "pl" is dec/pl. Three-part codes such as acs/acs5/profile must be given in full. The response echoes the resolved code. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | Vintage year queried. | |
| error | No | Present when the call failed. Absent on success. | |
| dataset | No | Dataset queried. | |
| totalLevels | No | Distinct geography levels available for this dataset and year — the count census_query_data and census_compare_geographies give for an unsupported level. Can be lower than the number of geography_levels entries, which repeat a level per parent hierarchy. | |
| geography_levels | No | Geography levels supported by this dataset and year, one entry per parent hierarchy: a level published under several hierarchies (county under state, and under a metro area) appears once for each. |