bfs_get_data
Query statistical data from a BFS table with optional dimension filters. Returns actual data values with dimension labels.
Instructions
Query statistical data from a BFS table with optional filters.
Fetches actual data values from a STAT-TAB table. Always call bfs_get_table_metadata first to understand available variables and values.
Args: params (GetDataInput): - table_id (str): BFS table ID - filters (Optional[list]): Dimension filters to narrow results. Each filter: {"code": "VariableCode", "values": ["val1", "val2"]} Without filters, all data is returned (may be very large). - lang (str): Language for labels - max_rows (int): Safety limit on returned rows (default 500)
Returns:
DataTableResult with dimensions, rows, plus truncated,
rows_total, rows_returned for machine-readable capping.
On error, error and hint are set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| hint | No | ||
| table_id | No | ||
| title | No | ||
| source | No | ||
| updated | No | ||
| language | No | ||
| dimensions | No | ||
| rows_total | No | ||
| rows_returned | No | ||
| truncated | No | ||
| rows | No | ||
| note | No | ||
| cantons_compared | No | ||
| canton_variable | No | ||
| topic | No | ||
| topic_description | No | ||
| canton | No | ||
| canton_filter | No | ||
| region | No | ||
| breakdown | No | ||
| year | No |