Skip to contents

Mentioned in Awesome Official Statistics

PxWebApiData on CRAN pkgdown website GitHub Repository

PX-Web data by API: The R package PxWebApiData supports both PxWebApi v1 and PxWebApi v2.

The example code reads data from three national statistical institutes: Statistics Norway, Statistics Sweden, and Statistics Finland.


PxWebApi v1

PxWebApi v1 is supported through the long-established ApiData() interface.

πŸ“Œ Function reference:

πŸ“Œ Vignette:


PxWebApi v2

PxWebApi v2 is supported through a set of new functions.

πŸ“Œ Function references:

  • get_api_data() – retrieve data from a pre-made URL
  • query_url() – generate a data URL from specifications
  • api_data() – specify and retrieve data in one step (closely related to ApiData() for PxWebApi v1)
  • meta_frames() – metadata structured as data frames
  • meta_data() – metadata downloaded without further processing
  • meta_code_list() – metadata for code lists

πŸ“Œ Vignette:


Official version on CRAN: https://cran.r-project.org/package=PxWebApiData