Package {dashboardapi}


Title: Access Japan's Statistics Dashboard API
Version: 0.1.0
Description: An unofficial, tidy, rate-conscious interface to the Statistics Dashboard Web API provided by the Statistics Bureau of Japan. Search indicators, regions, terms, social events, and statistical surveys, then retrieve observations as normalized long or wide data frames. The API requires no registration or API key.
URL: https://github.com/kenjimyzk/dashboardapi
BugReports: https://github.com/kenjimyzk/dashboardapi/issues
License: MIT + file LICENSE
Depends: R (≥ 4.1.0)
Imports: httr2 (≥ 1.1.0), tibble
Suggests: knitr, rmarkdown, testthat (≥ 3.2.0)
VignetteBuilder: knitr
Config/testthat/edition: 3
Encoding: UTF-8
Config/roxygen2/version: 8.0.0
NeedsCompilation: no
Packaged: 2026-07-31 14:37:16 UTC; kenjimyzk
Author: Kenji Miyazaki [aut, cre]
Maintainer: Kenji Miyazaki <kenjimyzk@gmail.com>
Repository: CRAN
Date/Publication: 2026-08-08 11:10:02 UTC

dashboardapi: Japan's Statistics Dashboard data for R

Description

dashboardapi is an unofficial, independently developed client for the Statistics Dashboard Web API provided by the Statistics Bureau of Japan. It is not affiliated with, endorsed by, or maintained by the Statistics Bureau. A typical workflow is:

Details

  1. Find a series with dashboard_search().

  2. Find region codes with dashboard_regions().

  3. Retrieve observations with dashboard_data().

No registration or API key is required. The API documentation asks clients not to create a large volume of access in a short period. When dashboard_data() must split a request into multiple API calls, the package therefore waits at least one second between calls.

Package options

Terms of use

When publishing content retrieved with this package, cite the Statistics Dashboard as the source. When publishing edited content, also identify the editing entity. Services published using the API should show the credit requested by the Statistics Dashboard. Call dashboard_api_credit() for the source citation, edited-content template, API credit, and official links. The package's MIT license applies only to original package code and documentation; it does not relicense government or third-party data, metadata, or official texts. Check any individual rights statement before reusing third-party content.

Author(s)

Maintainer: Kenji Miyazaki kenjimyzk@gmail.com

Authors:

See Also

Statistics Dashboard API


Return Statistics Dashboard attribution and API credit

Description

The Statistics Dashboard asks users of its content to cite the source. When publishing edited content, identify the editing entity as well. Publishers of services using the API must also show a specified credit. The terms can change, so verify the linked official page before publication.

Usage

dashboard_api_credit(lang = c("en", "jp"))

Arguments

lang

Credit language, "en" or "jp".

Value

A named list containing source (the required source citation), processed (a template for edited content), credit (the required API service credit), and official URLs.

Examples

dashboard_api_credit("en")
dashboard_api_credit("jp")$credit

Return commonly used Statistics Dashboard API codes

Description

The API's full category, survey, and region code systems are maintained by the Statistics Bureau. This helper returns the small enumerations used directly by package arguments.

Usage

dashboard_codes(
  type = c("cycle", "regional_rank", "seasonal", "provisional", "social_event_level"),
  lang = c("en", "jp")
)

Arguments

type

One of "cycle", "regional_rank", "seasonal", "provisional", or "social_event_level".

lang

Label language, "en" or "jp".

Value

A tibble containing code, name, and type.

Examples

dashboard_codes("cycle")
dashboard_codes("regional_rank", lang = "jp")

Retrieve Statistics Dashboard observations

Description

dashboard_data() retrieves one or more indicators and returns one indicator-region-time observation per row. The API permits five indicators and 50 regions per request. Longer vectors are split automatically, with at least one second between requests.

Usage

dashboard_data(
  indicator_code,
  region_code = NULL,
  parent_region_code = NULL,
  region_level = NULL,
  time = NULL,
  time_from = NULL,
  time_to = NULL,
  cycle = NULL,
  regional_rank = NULL,
  seasonal = NULL,
  stat_name = NULL,
  value_condition = NULL,
  wide = FALSE,
  lang = dash_default("lang", "en"),
  wait = dash_default("wait", 1),
  timeout = dash_default("timeout", 30),
  retries = dash_default("retries", 3)
)

Arguments

indicator_code

Character vector of 19-digit indicator codes. Names become aliases. Requests are automatically batched in groups of five.

region_code

Optional vector of five-digit Japanese region codes or three-letter ISO country codes. Requests are automatically batched in groups of 50.

parent_region_code

Optional five-digit parent-region code.

region_level

Optional official region-level code.

time, time_from, time_to

Optional API time codes. Use "20240100" for January 2024, "20241Q00" for 2024 Q1, "2024CY00" for calendar year 2024, or "2024FY00" for fiscal year 2024.

cycle

Data cycle: "month", "quarter", "year", or "fiscal_year"; API codes 1–4 are also accepted.

regional_rank

One of "country", "japan", "prefecture", or "municipality"; API codes 1–4 are also accepted.

seasonal

"original" or "seasonally_adjusted"; API codes 1 and 2 are also accepted.

stat_name

Optional partial match for a statistical survey name.

value_condition

Optional strict numeric filter such as ">100" or "<0".

wide

If FALSE (default), return normalized long data. If TRUE, put each indicator or alias in its own column.

lang

Response language, "en" or "jp".

wait

Requested seconds between automatically batched requests. Values below one are treated as one when another request is required.

timeout

Request timeout in seconds.

retries

Number of retries for transient failures.

Details

Named indicator_code vectors create aliases in the indicator column and in wide output, following the style of WDI::WDI().

Value

A tibble. Long output retains raw codes and labels, an R Date, numeric value, original value_raw, and annotations.

Examples

## Not run: 
population <- dashboard_data(
  indicator_code = c(population = "0201010000000010000"),
  region_code = "00000",
  time_from = "2020CY00",
  time_to = "2024CY00",
  cycle = "year",
  regional_rank = "japan",
  seasonal = "original"
)

## End(Not run)

Search and retrieve social-event metadata

Description

Search and retrieve social-event metadata

Usage

dashboard_events(
  time = NULL,
  time_from = NULL,
  time_to = NULL,
  level = NULL,
  category = NULL,
  modified_from = NULL,
  modified_to = NULL,
  lang = dash_default("lang", "en"),
  timeout = dash_default("timeout", 30),
  retries = dash_default("retries", 3)
)

Arguments

time, time_from, time_to

Optional eight-character API time codes, such as "20240100", "20241Q00", "2024CY00", or "2024FY00".

level

Event importance: "low", "medium", or "high"; API codes 1–3 are also accepted.

category

Optional Statistics Dashboard category code.

modified_from, modified_to

Optional metadata update dates in YYYYMMDD format.

lang

Response language, "en" or "jp".

timeout

Request timeout in seconds.

retries

Number of retries for transient failures.

Value

A tibble with one row per event-category association.

Examples

## Not run: 
dashboard_events(category = "0201", level = "high")

## End(Not run)

Search and retrieve indicator metadata

Description

This is the discovery endpoint for Statistics Dashboard series. The result has one row per indicator element: an indicator split by data cycle, regional rank, and original/seasonally adjusted status.

Usage

dashboard_indicators(
  query = NULL,
  indicator_code = NULL,
  category = NULL,
  time = NULL,
  time_from = NULL,
  time_to = NULL,
  cycle = NULL,
  regional_rank = NULL,
  seasonal = NULL,
  stat_code = NULL,
  stat_name = NULL,
  modified_from = NULL,
  modified_to = NULL,
  lang = dash_default("lang", "en"),
  timeout = dash_default("timeout", 30),
  retries = dash_default("retries", 3)
)

Arguments

query

Optional partial match for the indicator name.

indicator_code

Optional vector of 19-digit indicator codes. Up to 50 codes can be sent in one metadata request.

category

Optional Statistics Dashboard category code.

time, time_from, time_to

Optional eight-character API time codes, such as "20240100", "20241Q00", "2024CY00", or "2024FY00".

cycle

Data cycle: "month", "quarter", "year", or "fiscal_year"; API codes 1–4 are also accepted.

regional_rank

One of "country", "japan", "prefecture", or "municipality"; API codes 1–4 are also accepted.

seasonal

"original" or "seasonally_adjusted"; API codes 1 and 2 are also accepted.

stat_code, stat_name

Optional statistical survey code or partial name.

modified_from, modified_to

Optional metadata update dates in YYYYMMDD format.

lang

Response language, "en" or "jp".

timeout

Request timeout in seconds.

retries

Number of retries for transient failures.

Value

A tibble with one row per indicator element.

Examples

## Not run: 
dashboard_indicators(query = "Total population", lang = "en")
dashboard_indicators(
  category = "0201", cycle = "year", regional_rank = "prefecture"
)

## End(Not run)

Search and retrieve region metadata

Description

Search and retrieve region metadata

Usage

dashboard_regions(
  query = NULL,
  region_code = NULL,
  parent_region_code = NULL,
  time = NULL,
  time_from = NULL,
  time_to = NULL,
  region_level = NULL,
  modified_from = NULL,
  modified_to = NULL,
  lang = dash_default("lang", "en"),
  timeout = dash_default("timeout", 30),
  retries = dash_default("retries", 3)
)

Arguments

query

Optional partial match for a region name.

region_code

Optional vector of up to 50 five-digit Japanese region codes or three-letter ISO country codes.

parent_region_code

Optional five-digit parent-region code. For example, "00000" returns Japan's prefectures.

time, time_from, time_to

Optional eight-character API time codes, such as "20240100", "20241Q00", "2024CY00", or "2024FY00".

region_level

Optional vector of official region-level codes.

modified_from, modified_to

Optional metadata update dates in YYYYMMDD format.

lang

Response language, "en" or "jp".

timeout

Request timeout in seconds.

retries

Number of retries for transient failures.

Value

A tibble of regions and their parent regions.

Examples

## Not run: 
dashboard_regions(parent_region_code = "00000")
dashboard_regions(query = "Tokyo", lang = "en")

## End(Not run)

Description

A concise alias for dashboard_indicators() with a required search phrase.

Usage

dashboard_search(query, lang = dash_default("lang", "en"), ...)

Arguments

query

Partial indicator-name match.

lang

Response language, "en" or "jp".

...

Additional filters passed to dashboard_indicators().

Value

A tibble with one row per matching indicator element.

Examples

## Not run: 
dashboard_search("unemployment rate")
dashboard_search(intToUtf8(c(23436, 20840, 22833, 26989, 29575)), lang = "jp")

## End(Not run)

Search and retrieve statistical-survey metadata

Description

Search and retrieve statistical-survey metadata

Usage

dashboard_surveys(
  query = NULL,
  indicator_code = NULL,
  stat_code = NULL,
  modified_from = NULL,
  modified_to = NULL,
  lang = dash_default("lang", "en"),
  timeout = dash_default("timeout", 30),
  retries = dash_default("retries", 3)
)

Arguments

query

Optional partial match for a survey name.

indicator_code

Optional vector of up to 50 indicator codes.

stat_code

Optional statistical survey code.

modified_from, modified_to

Optional metadata update dates in YYYYMMDD format.

lang

Response language, "en" or "jp".

timeout

Request timeout in seconds.

retries

Number of retries for transient failures.

Value

A tibble of statistical surveys.

Examples

## Not run: 
dashboard_surveys(query = "Population Census", lang = "en")

## End(Not run)

Search and retrieve statistical term metadata

Description

Search and retrieve statistical term metadata

Usage

dashboard_terms(
  query = NULL,
  category = NULL,
  indicator_code = NULL,
  stat_code = NULL,
  modified_from = NULL,
  modified_to = NULL,
  lang = dash_default("lang", "en"),
  timeout = dash_default("timeout", 30),
  retries = dash_default("retries", 3)
)

Arguments

query

Optional partial match for a term name.

category, indicator_code, stat_code

Optional metadata filters.

modified_from, modified_to

Optional metadata update dates in YYYYMMDD format.

lang

Response language, "en" or "jp".

timeout

Request timeout in seconds.

retries

Number of retries for transient failures.

Value

A tibble of statistical terms and definitions.

Examples

## Not run: 
dashboard_terms(category = "0201", lang = "en")
dashboard_terms(query = intToUtf8(c(20154, 21475)), lang = "jp")

## End(Not run)