Skip to contents

The low-level function to send a request to the view endpoint.

Usage

bps_view(model, id, ..., lang = c("ind", "eng"))

Arguments

model

The result model, e.g. "publication" to view the details of a particular publication. See the Model section below for more details.

id

An ID, e.g. a publication ID.

...

Name-value pairs that provide query parameters. See httr2::req_url_query() for more details.

lang

The result's language. Must be either "ind" for Indonesian or "eng" for English. Defaults to Indonesian.

Value

A list with the bpsr_file class.

Model

model must be one of the following:

  • "glosarium";

  • "news";

  • "pressrelease";

  • "publication";

  • "statictable";

  • "tablestatistic";

  • "kbli2009";

  • "kbli2015";

  • "kbli2017";

  • "kbli2020"; or

  • "kbki2015".

See also

Examples

# Get information and the download URL of a spreadsheet dataset on annual
# inflation
bps_view("statictable", "915", domain = "0000", lang = "eng")
#> <bpsr_file>
#> List of 8
#>  $ table_id: int 915
#>  $ sub_id  : int 3
#>  $ title   : chr "Composite Inflation Rate of Year on Year of 90 Cities <sup>1</sup> (2018=100)"
#>  $ table   : chr "&lt;html xmlns:o=&quot;urn:schemas-microsoft-com:office:office&quot;\r\nxmlns:x=&quot;urn:schemas-microsoft-com"| __truncated__
#>  $ cr_date : chr "2014-09-26 00:00:00"
#>  $ up_date : chr "2023-09-01 15:38:27"
#>  $ excel   : chr "https://www.bps.go.id/statictable/downloadapi.html?data=eXcbdViw6ife5DPzPiDelrtdmjB3Pe1OMSonz4DmhF529NC9%2BfyzH"| __truncated__
#>  $ size    : chr "0.04 MB"