| Title: | Access Japan's 'Statistics Dashboard' API |
|---|---|
| Description: | An unofficial, tidy, rate-conscious interface to the 'Statistics Dashboard' 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. |
| Authors: | Kenji Miyazaki [aut, cre] |
| Maintainer: | Kenji Miyazaki <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-09-16 09:03:12 UTC |
| Source: | https://github.com/kenjimyzk/dashboardapi |
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.
dashboard_api_credit(lang = c("en", "jp"))dashboard_api_credit(lang = c("en", "jp"))
lang |
Credit language, |
A named list containing source (the required source citation),
processed (a template for edited content), credit (the required API
service credit), and official URLs.
dashboard_api_credit("en") dashboard_api_credit("jp")$creditdashboard_api_credit("en") dashboard_api_credit("jp")$credit
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.
dashboard_codes( type = c("cycle", "regional_rank", "seasonal", "provisional", "social_event_level"), lang = c("en", "jp") )dashboard_codes( type = c("cycle", "regional_rank", "seasonal", "provisional", "social_event_level"), lang = c("en", "jp") )
type |
One of |
lang |
Label language, |
A tibble containing code, name, and type.
dashboard_codes("cycle") dashboard_codes("regional_rank", lang = "jp")dashboard_codes("cycle") dashboard_codes("regional_rank", lang = "jp")
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.
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) )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) )
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 |
cycle |
Data cycle: |
regional_rank |
One of |
seasonal |
|
stat_name |
Optional partial match for a statistical survey name. |
value_condition |
Optional strict numeric filter such as |
wide |
If |
lang |
Response language, |
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. |
Named indicator_code vectors create aliases in the indicator column and
in wide output, following the style of WDI::WDI().
A tibble. Long output retains raw codes and labels, an R Date,
numeric value, original value_raw, and annotations.
## 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)## 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
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) )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) )
time, time_from, time_to
|
Optional eight-character API time codes, such
as |
level |
Event importance: |
category |
Optional Statistics Dashboard category code. |
modified_from, modified_to
|
Optional metadata update dates in
|
lang |
Response language, |
timeout |
Request timeout in seconds. |
retries |
Number of retries for transient failures. |
A tibble with one row per event-category association.
## Not run: dashboard_events(category = "0201", level = "high") ## End(Not run)## Not run: dashboard_events(category = "0201", level = "high") ## End(Not run)
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.
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) )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) )
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 |
cycle |
Data cycle: |
regional_rank |
One of |
seasonal |
|
stat_code, stat_name
|
Optional statistical survey code or partial name. |
modified_from, modified_to
|
Optional metadata update dates in
|
lang |
Response language, |
timeout |
Request timeout in seconds. |
retries |
Number of retries for transient failures. |
A tibble with one row per indicator element.
## Not run: dashboard_indicators(query = "Total population", lang = "en") dashboard_indicators( category = "0201", cycle = "year", regional_rank = "prefecture" ) ## End(Not run)## 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
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) )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) )
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, |
time, time_from, time_to
|
Optional eight-character API time codes, such
as |
region_level |
Optional vector of official region-level codes. |
modified_from, modified_to
|
Optional metadata update dates in
|
lang |
Response language, |
timeout |
Request timeout in seconds. |
retries |
Number of retries for transient failures. |
A tibble of regions and their parent regions.
## Not run: dashboard_regions(parent_region_code = "00000") dashboard_regions(query = "Tokyo", lang = "en") ## End(Not run)## Not run: dashboard_regions(parent_region_code = "00000") dashboard_regions(query = "Tokyo", lang = "en") ## End(Not run)
A concise alias for dashboard_indicators() with a required search phrase.
dashboard_search(query, lang = dash_default("lang", "en"), ...)dashboard_search(query, lang = dash_default("lang", "en"), ...)
query |
Partial indicator-name match. |
lang |
Response language, |
... |
Additional filters passed to |
A tibble with one row per matching indicator element.
## Not run: dashboard_search("unemployment rate") dashboard_search(intToUtf8(c(23436, 20840, 22833, 26989, 29575)), lang = "jp") ## End(Not run)## 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
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) )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) )
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
|
lang |
Response language, |
timeout |
Request timeout in seconds. |
retries |
Number of retries for transient failures. |
A tibble of statistical surveys.
## Not run: dashboard_surveys(query = "Population Census", lang = "en") ## End(Not run)## Not run: dashboard_surveys(query = "Population Census", lang = "en") ## End(Not run)
Search and retrieve statistical term metadata
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) )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) )
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
|
lang |
Response language, |
timeout |
Request timeout in seconds. |
retries |
Number of retries for transient failures. |
A tibble of statistical terms and definitions.
## Not run: dashboard_terms(category = "0201", lang = "en") dashboard_terms(query = intToUtf8(c(20154, 21475)), lang = "jp") ## End(Not run)## Not run: dashboard_terms(category = "0201", lang = "en") dashboard_terms(query = intToUtf8(c(20154, 21475)), lang = "jp") ## End(Not run)