Query Slovenia's SiStat (SURS PX-Web API) open data directly from DuckDB with SQL.
Installing and Loading
INSTALL sistat FROM community;
LOAD sistat;
Example
SELECT title, table_id, updated
FROM SISTAT_Tables(language := 'en')
WHERE LOWER(title) LIKE '%demographics%'
ORDER BY updated DESC
LIMIT 5;
SELECT variable_code, variable_text, position, value_codes, value_texts
FROM SISTAT_DataStructure('05C1002S', language := 'en')
ORDER BY position;
SELECT * FROM SISTAT_Read('05C1002S', language := 'en') LIMIT 10;
About sistat
The sistat extension integrates the Statistical Office of the Republic of Slovenia (SURS) SiStat PX-Web API into DuckDB. Query 1000+ official Slovenian datasets with SQL — no external Python or ETL required.
Features:
- SISTAT_Tables(language) — List all available datasets (title, table_id, updated).
- SISTAT_DataStructure(table_id, language) — Inspect dimensions, variables, and value codes before reading.
- SISTAT_Read(table_id, language) — Read datasets into DuckDB; use SQL
WHEREandLIMITas needed.
All functions accept an optional language argument (e.g. 'en', 'sl'). Table IDs can be passed with or without the .px suffix. Data is fetched live from the official API. For reproducible results, materialize a snapshot into a local table.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| SISTAT_DataStructure | table | NULL | NULL | |
| SISTAT_Read | table | NULL | NULL | |
| SISTAT_Tables | table | NULL | NULL |
Overloaded Functions
| function_name | function_type | description | comment | examples | |—————|—————|————-|———|———-|
Added Types
| type_name | type_size | logical_type | type_category | internal | |———–|———-:|————–|—————|———-|
Added Settings
| name | description | input_type | scope | aliases | |——|————-|————|——-|———|