Skip to content

ChinAPIs

Access Chinese Data via Public APIs and Curated Datasets

v0.1.1 · Feb 12, 2026 · MIT + file LICENSE

Description

Provides functions to access data from public RESTful APIs including 'Nager.Date', 'World Bank API', and 'REST Countries API', retrieving real-time or historical data related to China, such as holidays, economic indicators, and international demographic and geopolitical indicators. Additionally, the package includes one of the largest curated collections of open datasets focused on China and Hong Kong, covering topics such as air quality, demographics, input-output tables, epidemiology, political structure, names, and social indicators. The package supports reproducible research and teaching by integrating reliable international APIs and structured datasets from public, academic, and government sources. For more information on the APIs, see: 'Nager.Date' <https://date.nager.at/Api>, 'World Bank API' <https://datahelpdesk.worldbank.org/knowledgebase/articles/889392>, and 'REST Countries API' <https://restcountries.com/>.

Downloads

CRAN

270

Last 30 days

15234th

721

Last 90 days

2.2K

Last year

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

r2u CRAN

8

Last 30 days

25

Last 90 days

103

Last year

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

CRAN Check Status

9 ERROR
4 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang ERROR
r-devel-linux-x86_64-debian-gcc ERROR
r-devel-linux-x86_64-fedora-clang ERROR
r-devel-linux-x86_64-fedora-gcc ERROR
r-devel-windows-x86_64 ERROR
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 ERROR
r-patched-linux-x86_64 ERROR
r-release-linux-x86_64 ERROR
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 ERROR
Check details (18 non-OK)
ERROR r-devel-linux-x86_64-debian-clang

examples

Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ###   API
> ### Aliases: get_country_info_cn
> 
> ### ** Examples
> 
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
ERROR r-devel-linux-x86_64-debian-clang

tests

Running ‘testthat.R’ [25s/38s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(ChinAPIs)
  > 
  > test_check("ChinAPIs")
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  Nager.Date API returned status: 400
  Nager.Date API returned status: 400
  Saving _problems/test-get_country_info_cn-12.R
  Datasets available in the 'ChinAPIs' package:
  Datasets available in the 'ChinAPIs' package:
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (5): 'test-get_china_child_mortality.R:12:3',
    'test-get_china_child_mortality.R:30:3',
    'test-get_china_child_mortality.R:40:3',
    'test-get_china_child_mortality.R:50:3',
    'test-get_china_child_mortality.R:58:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
  Error in `data_list[1, ]`: incorrect number of dimensions
  Backtrace:
      ▆
   1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
  
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-devel-linux-x86_64-debian-gcc

examples

Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ###   API
> ### Aliases: get_country_info_cn
> 
> ### ** Examples
> 
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
ERROR r-devel-linux-x86_64-debian-gcc

tests

Running ‘testthat.R’ [15s/19s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(ChinAPIs)
  > 
  > test_check("ChinAPIs")
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  Nager.Date API returned status: 400
  Nager.Date API returned status: 400
  Saving _problems/test-get_country_info_cn-12.R
  Datasets available in the 'ChinAPIs' package:
  Datasets available in the 'ChinAPIs' package:
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (5): 'test-get_china_child_mortality.R:12:3',
    'test-get_china_child_mortality.R:30:3',
    'test-get_china_child_mortality.R:40:3',
    'test-get_china_child_mortality.R:50:3',
    'test-get_china_child_mortality.R:58:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
  Error in `data_list[1, ]`: incorrect number of dimensions
  Backtrace:
      ▆
   1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
  
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-devel-linux-x86_64-fedora-clang

examples

Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:

> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ###   API
> ### Aliases: get_country_info_cn
> 
> ### ** Examples
> 
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
ERROR r-devel-linux-x86_64-fedora-clang

tests

Running ‘testthat.R’ [40s/97s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(ChinAPIs)
  > 
  > test_check("ChinAPIs")
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  Nager.Date API returned status: 400
  Nager.Date API returned status: 400
  Saving _problems/test-get_country_info_cn-12.R
  Datasets available in the 'ChinAPIs' package:
  Datasets available in the 'ChinAPIs' package:
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (5): 'test-get_china_child_mortality.R:12:3',
    'test-get_china_child_mortality.R:30:3',
    'test-get_china_child_mortality.R:40:3',
    'test-get_china_child_mortality.R:50:3',
    'test-get_china_child_mortality.R:58:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
  Error in `data_list[1, ]`: incorrect number of dimensions
  Backtrace:
      ▆
   1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
  
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-devel-linux-x86_64-fedora-gcc

examples

Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:

> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ###   API
> ### Aliases: get_country_info_cn
> 
> ### ** Examples
> 
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
ERROR r-devel-linux-x86_64-fedora-gcc

tests

Running ‘testthat.R’ [37s/48s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(ChinAPIs)
  > 
  > test_check("ChinAPIs")
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  Nager.Date API returned status: 400
  Nager.Date API returned status: 400
  Saving _problems/test-get_country_info_cn-12.R
  Datasets available in the 'ChinAPIs' package:
  Datasets available in the 'ChinAPIs' package:
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (5): 'test-get_china_child_mortality.R:12:3',
    'test-get_china_child_mortality.R:30:3',
    'test-get_china_child_mortality.R:40:3',
    'test-get_china_child_mortality.R:50:3',
    'test-get_china_child_mortality.R:58:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
  Error in `data_list[1, ]`: incorrect number of dimensions
  Backtrace:
      ▆
   1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
  
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-devel-windows-x86_64

examples

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

> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ###   API
> ### Aliases: get_country_info_cn
> 
> ### ** Examples
> 
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
ERROR r-devel-windows-x86_64

tests

Running 'testthat.R' [35s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(ChinAPIs)
  > 
  > test_check("ChinAPIs")
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  Nager.Date API returned status: 400
  Nager.Date API returned status: 400
  Saving _problems/test-get_country_info_cn-12.R
  Datasets available in the 'ChinAPIs' package:
  Datasets available in the 'ChinAPIs' package:
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (5): 'test-get_china_child_mortality.R:12:3',
    'test-get_china_child_mortality.R:30:3',
    'test-get_china_child_mortality.R:40:3',
    'test-get_china_child_mortality.R:50:3',
    'test-get_china_child_mortality.R:58:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
  Error in `data_list[1, ]`: incorrect number of dimensions
  Backtrace:
      ▆
   1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
  
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-oldrel-windows-x86_64

examples

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

> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ###   API
> ### Aliases: get_country_info_cn
> 
> ### ** Examples
> 
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
ERROR r-oldrel-windows-x86_64

tests

Running 'testthat.R' [39s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(ChinAPIs)
  > 
  > test_check("ChinAPIs")
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  Nager.Date API returned status: 400
  Nager.Date API returned status: 400
  Saving _problems/test-get_country_info_cn-12.R
  Datasets available in the 'ChinAPIs' package:
  Datasets available in the 'ChinAPIs' package:
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (5): 'test-get_china_child_mortality.R:12:3',
    'test-get_china_child_mortality.R:30:3',
    'test-get_china_child_mortality.R:40:3',
    'test-get_china_child_mortality.R:50:3',
    'test-get_china_child_mortality.R:58:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
  Error in `data_list[1, ]`: incorrect number of dimensions
  Backtrace:
      ▆
   1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
  
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-patched-linux-x86_64

examples

Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ###   API
> ### Aliases: get_country_info_cn
> 
> ### ** Examples
> 
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
ERROR r-patched-linux-x86_64

tests

Running ‘testthat.R’ [23s/38s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(ChinAPIs)
  > 
  > test_check("ChinAPIs")
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  Nager.Date API returned status: 400
  Nager.Date API returned status: 400
  Saving _problems/test-get_country_info_cn-12.R
  Datasets available in the 'ChinAPIs' package:
  Datasets available in the 'ChinAPIs' package:
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (5): 'test-get_china_child_mortality.R:12:3',
    'test-get_china_child_mortality.R:30:3',
    'test-get_china_child_mortality.R:40:3',
    'test-get_china_child_mortality.R:50:3',
    'test-get_china_child_mortality.R:58:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
  Error in `data_list[1, ]`: incorrect number of dimensions
  Backtrace:
      ▆
   1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
  
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-release-linux-x86_64

examples

Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ###   API
> ### Aliases: get_country_info_cn
> 
> ### ** Examples
> 
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
ERROR r-release-linux-x86_64

tests

Running ‘testthat.R’ [24s/40s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(ChinAPIs)
  > 
  > test_check("ChinAPIs")
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  Nager.Date API returned status: 400
  Nager.Date API returned status: 400
  Saving _problems/test-get_country_info_cn-12.R
  Datasets available in the 'ChinAPIs' package:
  Datasets available in the 'ChinAPIs' package:
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (5): 'test-get_china_child_mortality.R:12:3',
    'test-get_china_child_mortality.R:30:3',
    'test-get_china_child_mortality.R:40:3',
    'test-get_china_child_mortality.R:50:3',
    'test-get_china_child_mortality.R:58:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
  Error in `data_list[1, ]`: incorrect number of dimensions
  Backtrace:
      ▆
   1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
  
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-release-windows-x86_64

examples

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

> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ###   API
> ### Aliases: get_country_info_cn
> 
> ### ** Examples
> 
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
ERROR r-release-windows-x86_64

tests

Running 'testthat.R' [29s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(ChinAPIs)
  > 
  > test_check("ChinAPIs")
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  `year` must be a single numeric value.
  Nager.Date API returned status: 400
  Nager.Date API returned status: 400
  Saving _problems/test-get_country_info_cn-12.R
  Datasets available in the 'ChinAPIs' package:
  Datasets available in the 'ChinAPIs' package:
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (5): 'test-get_china_child_mortality.R:12:3',
    'test-get_china_child_mortality.R:30:3',
    'test-get_china_child_mortality.R:40:3',
    'test-get_china_child_mortality.R:50:3',
    'test-get_china_child_mortality.R:58:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_country_info_cn.R:12:1'): (code run outside of `test_that()`) ──
  Error in `data_list[1, ]`: incorrect number of dimensions
  Backtrace:
      ▆
   1. └─ChinAPIs::get_country_info_cn() at test-get_country_info_cn.R:12:1
  
  [ FAIL 1 | WARN 0 | SKIP 5 | PASS 4120 ]
  Error:
  ! Test failures.
  Execution halted

Check History

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

examples

Running examples in ‘ChinAPIs-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: get_country_info_cn
> ### Title: Get Key Country Information About China from the REST Countries
> ###   API
> ### Aliases: get_country_info_cn
> 
> ### ** Examples
> 
> get_country_info_cn()
Error in data_list[1, ] : incorrect number of dimensions
Calls: get_country_info_cn
Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Dependency Network

Dependencies Reverse dependencies httr jsonlite dplyr scales tibble ChinAPIs

Version History

3 tracked
new 0.1.1 Mar 10, 2026
updated 0.1.1 ← 0.1.0 diff Feb 11, 2026
new 0.1.0 Aug 25, 2025