Twinkle HubTwinkle Hub
登入

📌 2026-08-17 新增:⚖️ 台灣法條時光機 — 歷史法條原文 · 修法沿革 · 全文檢索 · 條文關聯圖(935 個 dataset · 35,454+ 筆 row)

查看完整 Changelog →

美國人口普查 變數 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 安裝​步驟。

查看使用者設定​文件