Download any file of the BFS (Excel, CSV, PX, PDF, zip, ...) from the DAM
API (https://dam-api.bfs.admin.ch/hub/swagger-ui/index.html) with its
asset number or its BFS number. Use it for the tables of
bfs_get_catalog_tables(), or for datasets too large for
bfs_get_data().
Usage
bfs_download_asset(
number_asset = NULL,
number_bfs = NULL,
destfile,
quiet = TRUE,
mode = "wb",
handle = curl::new_handle()
)Arguments
- number_asset
The asset number of the file, e.g.
"24025646". It is thenumber_assetcolumn ofbfs_get_catalog_tables()andbfs_get_catalog_data(), and the number at the end of the "assetdetail" URLs of the BFS website.- number_bfs
The BFS number of the file, e.g.
"px-x-1502040100_131". Use eithernumber_assetornumber_bfs.- destfile
Path of the downloaded file.
- quiet
If
FALSE, show the download progress.- mode, handle
Passed to
curl::curl_download().
