get_statistics
Fetch official Statistics Norway (SSB) figures as compact CSV, using defaults for recent trends or custom selections for breakdowns.
Instructions
Fetch numbers from an SSB table as a compact CSV table. With no selection, sensible defaults apply: totals where the table allows it and the last 12 periods, good for 'recent trend' questions. For breakdowns, pass selection mapping variable codes (from get_table_info) to value-code lists; expressions allowed: ['from(2020M01)'], ['top(24)'], ['*'] (all). If the table is closed, its successor is used or suggested in hints. Example: table_id='14700' (CPI) with no selection returns the last 12 months. Example: table_id='07459', selection={'Region': ['0301'], 'Tid': ['top(5)']} returns Oslo population for the last 5 years.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | en | |
| table_id | Yes | SSB table ID, e.g. '14700' | |
| selection | No | variableCode -> value codes or expressions from(...) / top(n) / * |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||