Skip to contents

Swiss Stats Explorer

The Swiss Stats Explorer (https://stats.swiss/) is the newer data API of the BFS, based on the SDMX standard.

bfs_sse_datasets()
List the datasets of the Swiss Stats Explorer
bfs_sse_dimensions()
Get the dimensions of a Swiss Stats Explorer dataset
bfs_sse_data()
Get data from the Swiss Stats Explorer

Swiss Stats Explorer (deprecated)

Deprecated since BFS 0.8.0, and kept unchanged for the code using them. Use the functions above, see the article “Moving to the new Swiss Stats Explorer functions”.

bfs_get_sse_metadata() deprecated
Get the codelists of a Swiss Stats Explorer dataset (deprecated)
bfs_get_sse_data() deprecated
Get data from the Swiss Stats Explorer (deprecated)

Data catalog and PXWeb datasets

Search the BFS data catalog, then download a dataset from the PXWeb API with its BFS number.

bfs_get_catalog_data()
Search the BFS data catalog
bfs_get_metadata()
Get the variables of a BFS dataset
bfs_get_data()
Get a BFS dataset
bfs_get_data_comments()
Get the comments of a BFS dataset

Tables and files

Search the BFS tables catalog and download any BFS file (Excel, CSV, PX, …) from the DAM API.

bfs_get_catalog_tables()
Search the BFS tables catalog
bfs_get_asset_metadata()
Get the metadata of a BFS file
bfs_download_asset()
Download a BFS file

Geodata and base maps

Geodata of the Swiss geo-portal (STAC API) and the cartographic base maps of the BFS ThemaKart project.

bfs_get_catalog_geodata()
Get the geodata catalog of the Swiss Confederation
bfs_download_geodata()
Download geodata from the Swiss geo-portal
bfs_get_base_maps()
Get the Swiss base maps
bfs_clear_cache()
Clear the BFS cache

Swiss official commune register

The register of the Swiss communes, districts and cantons on 1 January 2023, included in the package.

register_bzn
Swiss official commune register: districts
register_dic
Swiss official commune register: dictionary
register_gde
Swiss official commune register: communes
register_gde_other
Swiss official commune register: areas without a commune
register_kt
Swiss official commune register: cantons
register_kt_seeanteile
Swiss official commune register: cantonal shares of lakes

Deprecated

bfs_get_catalog()
Get the BFS data or tables catalog (deprecated)