Get Table Structure
get_table_metadataInspect a StatFin table's structure before querying: get variable codes, value codes, required fields, and available combinations. Use it to find exact codes for query_table.
Instructions
Get the structure of a table: what variables it has and what values are available.
REQUIRED before querying - shows you:
Variable codes (table-specific and version-stamped, e.g. "alue_23_20260101" for region, "timeperiod_y" for the time variable). Always read these here - never assume or reuse codes from another table.
Value codes (KU091=Helsinki, SSS=Total, 2024=year 2024)
Which variables are required vs optional
Total possible data combinations
Example: a region variable may have 300+ values, a year variable 50+.
After understanding the structure, use query_table with the exact codes from this output.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tableId | Yes | Table ID from search_statistics. Example: "11re.px" | |
| language | No | Language for variable/value names. Default "fi". | fi |
| includeAllValues | No | If true, return ALL value codes (can be 300+ for regions). Default false shows first 20. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Human-readable table title | |
| tableId | Yes | The table ID | |
| variables | Yes | All variables in this table | |
| lastUpdated | Yes | When the data was last updated (ISO format) | |
| queryGuidance | Yes | Tips for constructing an efficient query | |
| totalCombinations | Yes | Total possible data cells (product of all value counts) |