The low-level function to send one or more requests, depending on page
,
to the list endpoint.
Usage
bps_list(model, ..., domain_id = "0000", page = NULL, lang = c("ind", "eng"))
Arguments
- model
The result model, e.g. "publication" to request a list of publications. See the Model section below for more details.
- ...
Name-value pairs that provide query parameters. See
httr2::req_url_query()
for more details.- domain_id
The domain ID of a BPS bureau. Defaults to "0000", which is the domain ID of the central bureau. Use
bps_domain()
to see the list of domain IDs.- page
The page number of the result. Defaults to page one. Set to
Inf
to request all pages.- lang
The result's language. Must be either "ind" for Indonesian or "eng" for English. Defaults to Indonesian.
Model
model
must be one of the following:
"subject";
"subcat";
"var";
"vervar";
"turvar";
"turth";
"th";
"unit";
"news";
"newscategory";
"pressrelease";
"publication";
"statictable";
"subcatcsa";
"subjectcsa";
"tablestatistic";
"indicators";
"infographic";
"glosarium";
"sdgs";
"kbli2009";
"kbli2015";
"kbli2017";
"kbli2020"; or
"kbki2015".
The API actually also accepts "data" for model
, but bpsr puts it in a
separate family of functions due to differences in the response structure.
See bps_get_dataset()
and bps_get_datasets()
for more
details.
Examples
# Get a list of some publications
bps_list("publication", page = c(1, 2, 3), lang = "eng")
#> <bpsr_table>
#> Table: publication
#> Content:
#> List of 2
#> $ table :List of 3
#> ..$ :'data.frame': 10 obs. of 12 variables:
#> .. ..$ pub_id : chr [1:10] "ce3552287e63b72637ae1f13" ...
#> .. ..$ title : chr [1:10] "Export by Transportation Modes, 2021-2022" ...
#> .. ..$ kat_no : chr [1:10] "8202028" ...
#> .. ..$ issn : chr [1:10] "2580-1694" ...
#> .. ..$ pub_no : chr [1:10] "06100.2344" ...
#> .. .. [list output truncated]
#> ..$ :'data.frame': 10 obs. of 12 variables:
#> .. ..$ pub_id : chr [1:10] "c991e6f56165ebb97a06b513" ...
#> .. ..$ title : chr [1:10] "Index of Export Unit Value by SITC Code, June 2023" ...
#> .. ..$ kat_no : chr [1:10] "8202030" ...
#> .. ..$ issn : chr [1:10] "2085-8132" ...
#> .. ..$ pub_no : chr [1:10] "06100.2343" ...
#> .. .. [list output truncated]
#> ..$ :'data.frame': 10 obs. of 12 variables:
#> .. ..$ pub_id : chr [1:10] "8f2ffb811edd9af3673356a7" ...
#> .. ..$ title : chr [1:10] "Indonesia Foreign Trade Statistics Export by ISIC Code, 2021-2022" ...
#> .. ..$ kat_no : chr [1:10] "8202009" ...
#> .. ..$ issn : chr [1:10] "2745-3960" ...
#> .. ..$ pub_no : chr [1:10] "06100.2335" ...
#> .. .. [list output truncated]
#> $ result_info:List of 3
#> ..$ :List of 5
#> .. ..$ page : int 1
#> .. ..$ pages : int 500
#> .. ..$ per_page: int 10
#> .. ..$ count : int 10
#> .. ..$ total : int 4996
#> ..$ :List of 5
#> .. ..$ page : int 2
#> .. ..$ pages : int 500
#> .. ..$ per_page: int 10
#> .. ..$ count : int 10
#> .. ..$ total : int 4996
#> ..$ :List of 5
#> .. ..$ page : int 3
#> .. ..$ pages : int 500
#> .. ..$ per_page: int 10
#> .. ..$ count : int 10
#> .. ..$ total : int 4996