關鍵字 / Keywords: 美國 十年 人口普查 2020 2010 2000 PL DHC redistricting census decennial dec pl dhc sf1 population race hispanic housing units state county block
Scope: US Census Bureau · Decennial Census.
Query the every-10-years constitutionally-mandated Census (used for
congressional apportionment, federal funding formulas, and as the
universe for every subsequent ACS estimate). Response matrix is
converted to rows: [{col: val}, ...].
Endpoint: https://api.census.gov/data/{year}/dec/{dataset}?get={vars}&for={for_geo}&in={in_geo}
Args:
year: 2020, 2010, 2000, 1990.
variables: decennial variable codes. Common:
- "P1_001N" — total population (2020 PL / DHC)
- "P2_002N" — Hispanic / Latino population (2020 PL)
- "H1_001N" — total housing units (2020 PL)
- "P0010001" — total population (2010 SF1)
for_geo: same syntax as us_query_acs.
in_geo: parent scope for hierarchical queries.
dataset: decennial sub-dataset:
- "pl" — PL 94-171 (redistricting · earliest release)
- "dhc" — DHC (Demographic & Housing Characteristics,
2020 full detail)
- "sf1" — Summary File 1 (2010 / 2000 · legacy)
- "dp" — Demographic Profile (2020)
- "ddhca" — Detailed DHC-A
Default "pl" (available for 2020, 2010, 2000).
Returns dict with columns, rows, total_rows, raw_matrix.
Same gate / key logic as us_query_acs. License: US Public Domain
(17 USC §105).