Get Census Variable Metadata
census_get_variableFetch full metadata for one or more Census variable codes — label, concept group, predicate type, universe, and margin-of-error sibling references. Use to confirm a variable code before building a query, or to look up what a known code means. On ACS datasets it returns estimate_code and moe_code sibling references so you can request both without a separate search; other dataset families publish no margins of error and carry neither field. It also resolves predicate codes such as NAICS2017 or SEX, confirming a filter dimension exists in a dataset before a query uses it — for the values a dimension accepts rather than the dimension itself, call census_list_predicate_values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | Vintage year (default: latest available for the dataset). | |
| dataset | No | Dataset the variables belong to (default: "acs/acs5"). Use census_list_datasets to discover valid values. | |
| variables | Yes | One or more variable codes to look up (e.g., ["B19013_001E", "B19013_001M"]). Variable codes are case-sensitive. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | Vintage year queried. | |
| error | No | Present when the call failed. Absent on success. | |
| dataset | No | Dataset queried. | |
| variables | No | Variable metadata in the same order as the input array. |