美國人口普查 變數 metadata (label / concept / group)
us_get_variable_metadata
台灣專屬MIT
**關鍵字 / Keywords**: 美國人口普查 變數 metadata 欄位 定義 label concept universe group ACS census variable variables B01001 estimate margin of error
Scope: US Census Bureau · api.census.gov variable metadata.
Look up one variable's human-meaningful metadata — the label
(e.g. "Estimate!!Total:"), concept (e.g. "Sex by Age"), group
(e.g. "B01001"), universe (e.g. "Total population"), predicate type
(int / float / string), and attribute variables (margin of error,
annotations).
Endpoint (falls back to variables.json sheet if single-var 404s):
https://api.census.gov/data/{year}/{dataset}/variables/{variable}.json
Args:
year: vintage year (e.g. 2022, "2020").
dataset: dataset path — "acs/acs5", "acs/acs1", "dec/pl",
"dec/dhc", "pep/population", "ecnbasic", ...
variable: variable code. Naming convention:
- "B" prefix (e.g. "B01001_001E") = ACS detailed tables
- "S" prefix = ACS subject tables
- "DP" prefix = ACS data profiles
- "P"/"H" prefix (e.g. "P1_001N") = decennial
- Suffix "_E" = estimate, "_M" = margin of error,
"_EA" / "_MA" = estimate/margin annotation flag,
"_N" = number (decennial)
Returns dict with `name`, `label`, `concept`, `group`,
`predicate_type`, `attributes`, `universe`, and `raw` (the full
upstream entry). No API key required. License: US Public Domain.輸入 schema
{
"properties": {
"year": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"title": "Year"
},
"dataset": {
"title": "Dataset",
"type": "string"
},
"variable": {
"title": "Variable",
"type": "string"
}
},
"required": [
"year",
"dataset",
"variable"
],
"title": "us_get_variable_metadataArguments",
"type": "object"
}呼叫方式
配置好 Twinkle Hub 的 MCP client 後,agent 會看到 us_get_variable_metadata。直接讓它呼叫即可,例如:
# Ask Claude / any MCP client: 請用 us_get_variable_metadata 處理 "…"。 # It will call: us_get_variable_metadata(input="…")
尚未設定 Client?
Claude Desktop 約 3 分鐘即可完成設定 — 下載 .mcpb 檔案並雙擊即可,或參閱文件中的各 Client 安裝步驟。
查看使用者設定文件