Skip to content

PxWebApiData

PX-Web Data by API

v1.9.0 · Feb 2, 2026 · MIT + file LICENSE

Description

Function to read PX-Web data into R via API. The example code reads data from the three national statistical institutes, Statistics Norway, Statistics Sweden and Statistics Finland.

Downloads

CRAN

462

Last 30 days

8431st

1.3K

Last 90 days

9.2K

Last year

Trend: +25.2% (30d vs prior 30d)

r2u CRAN

9

Last 30 days

27

Last 90 days

143

Last year

Trend: -47.1% (30d vs prior 30d)

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 25, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 24, 2026
ERROR r-devel-linux-x86_64-debian-gcc

tests

Running ‘testthat.R’ [2s/2s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(PxWebApiData)
  > 
  > test_check("PxWebApiData")
  Saving _problems/test-api_data-23.R
  [ FAIL 1 | WARN 0 | SKIP 8 | PAS
...[truncated]...
     url <- ensure_json_stat2(url) }`: argument is of length zero
  Backtrace:
      ▆
   1. └─PxWebApiData::get_api_data(query_url_scb) at test-api_data.R:23:3
  
  [ FAIL 1 | WARN 0 | SKIP 8 | PASS 0 ]
  Error:
  ! Test failures.
  Execution halted
OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 4, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 1, 2026
ERROR r-release-windows-x86_64

examples

Running examples in 'PxWebApiData-Ex.R' failed
The error most likely occurred in:

> ### Name: api_data
> ### Title: PX-Web Data by API
> ### Aliases: api_data api_data_1 api_data_2 api_data_12
> 
> ### ** Examples
> 
> 
> obj <- api_data(14162, Regi
...[truncated]...
non-missing arguments to max; returning -Inf
Error in if (nzchar(cand)) strsplit(cand, "\r", fixed = TRUE)[[1]] else NULL : 
  argument is of length zero
Calls: api_data_1 ... api_data -> query_url -> meta_frames -> list_to_df_expand
Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Reverse Dependencies (1)

suggests

Dependency Network

Dependencies Reverse dependencies httr rjstat jsonlite pxweb csdata PxWebApiData

Version History

14 tracked
new 1.9.0 Mar 10, 2026
updated 1.9.0 ← 1.1.1 diff Feb 1, 2026
updated 1.1.1 ← 1.1.0 diff Nov 11, 2025
updated 1.1.0 ← 1.0.0 diff Oct 7, 2025
updated 1.0.0 ← 0.9.0 diff Oct 31, 2024
updated 0.9.0 ← 0.8.0 diff Jan 28, 2024
updated 0.8.0 ← 0.7.0 diff Mar 25, 2023
updated 0.7.0 ← 0.6.0 diff Oct 10, 2021
updated 0.6.0 ← 0.5.0 diff Jul 18, 2021
updated 0.5.0 ← 0.4.0 diff Mar 4, 2021
updated 0.4.0 ← 0.3.0 diff Nov 19, 2020
updated 0.3.0 ← 0.2.0 diff Apr 10, 2019
updated 0.2.0 ← 0.1.0 diff Oct 11, 2018
new 0.1.0 Jun 5, 2018