Twinkle HubTwinkle Hub
Sign in

📌 2026-08-17 added: ⚖️ Taiwan statute time machine — historical article text · revision history · full-text search · citation graph (935 datasets · 35,454+ rows)

View full changelog →

US Census variable metadata

us_get_variable_metadata

TW-specificMIT

**關鍵字 / 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.

Input 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"
}

How to call

Once your Twinkle Hub MCP client is configured, your agent will see us_get_variable_metadata. Just ask it to call — example:

# Ask Claude / any MCP client:
請用 us_get_variable_metadata 處理 "…"。

# It will call:
us_get_variable_metadata(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