US Census decennial data query
us_query_decennial
TW-specificMIT
**關鍵字 / 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).Input schema
{
"properties": {
"year": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"title": "Year"
},
"variables": {
"items": {
"type": "string"
},
"title": "Variables",
"type": "array"
},
"for_geo": {
"title": "For Geo",
"type": "string"
},
"in_geo": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "In Geo"
},
"dataset": {
"default": "pl",
"title": "Dataset",
"type": "string"
}
},
"required": [
"year",
"variables",
"for_geo"
],
"title": "us_query_decennialArguments",
"type": "object"
}How to call
Once your Twinkle Hub MCP client is configured, your agent will see us_query_decennial. Just ask it to call — example:
# Ask Claude / any MCP client: 請用 us_query_decennial 處理 "…"。 # It will call: us_query_decennial(input="…")
Haven't set up a client yet?
Claude Desktop in 3 minutes — download the .mcpb and double-click, or see docs for other clients.
See user docs