boj_data: Fetch Bank of Japan (BoJ) data

View source: R/boj.R

boj_dataR Documentation

Fetch Bank of Japan (BoJ) data

Description

Retrieve time series data from the Bank of Japan Statistics API.

Usage

boj_data(db, code, start_date = NULL, end_date = NULL, lang = "en")

Arguments

db

(character(1))
The database code to query (e.g., "FM08" for foreign exchange rates). See the API manual for available databases.

code

(character())
One or more series codes to query (e.g., "FXERD01" for USD/JPY spot rate). Maximum 250 codes per request. All codes must have the same frequency. Use boj_metadata() to find available codes.

start_date

(NULL | character(1) | integer(1))
Start date of the data. Format depends on frequency: "YYYYMM" for daily, weekly, and monthly data, "YYYYQQ" for quarterly (where QQ is 01-04), and "YYYY" for annual. If NULL, all available data is returned. Default NULL.

end_date

(NULL | character(1) | integer(1))
End date of the data, in the same format as start_date. If NULL, data up to the latest available date is returned. Default NULL.

lang

(character(1))
Language for series names, either "en" or "jp". Default "en".

Value

A data.table::data.table() with the requested data.

Source

https://www.stat-search.boj.or.jp/index_en.html

See Also

Other data: banxico_data(), bbk_data(), bbk_series(), bcb_data(), bcb_expectations(), bcb_fx_rates(), bcb_inflation(), bcb_selic(), bcb_top5(), bde_data(), bde_latest(), bdf_codelist(), bdf_data(), bdf_dataset(), bdp_data(), bis_data(), boc_data(), boe_data(), boi_data(), cnb_czeonia(), cnb_data(), cnb_fx_other_rates(), cnb_fx_rates(), cnb_pribor(), ecb_data(), nbp_fx_rates(), nbp_gold(), nob_data(), onb_data(), snb_data(), srb_cross_rates(), srb_data()

Examples



# fetch USD/JPY exchange rate
boj_data("FM08", "FXERD01", start_date = "202401")

# fetch multiple exchange rates
boj_data("FM08", c("FXERD01", "FXERD02"), start_date = "202401")



bbk documentation built on Aug. 28, 2026, 5:07 p.m.