Get All Values for a Variable
get_variable_valuesFetch all values for a StatFin variable when metadata shows only the first 20. Use search to filter and locate specific region codes, years, or categories.
Instructions
Get the complete list of values for a variable when metadata only shows first 20.
Useful for:
Finding specific region codes (KU091=Helsinki, MK01=Uusimaa region)
Getting all available years (1972-2024)
Finding specific category codes
Common region codes:
SSS = Whole country (Finland)
MK01-MK19 = Regions (maakunta)
KU091 = Helsinki, KU049 = Espoo, KU837 = Tampere
Use search parameter to filter: search="Helsinki" returns only matching values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | No | Filter values containing this text. Example: "Helsinki" returns only Helsinki-related codes. | |
| tableId | Yes | Table ID. Example: "11re.px" | |
| language | No | Language for value names. Default "fi". | fi |
| variable | Yes | Exact variable code from get_table_metadata (table-specific and version-stamped, e.g. "alue_23_20260101", "timeperiod_y"). The region variable usually starts with "alue"; the time variable is often "timeperiod_y". Do not guess. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | Yes | Total number of values for this variable | |
| values | Yes | All values for this variable (filtered if search was used) | |
| variable | Yes | The variable code that was queried | |
| commonCodes | No | Common code patterns for region variables (wholeCountry, regions, municipalities) |