Skip to contents

Retrieve time series data from the BdF Webstat API.

Usage

bdf_data(
  ...,
  key = NULL,
  start_date = NULL,
  end_date = NULL,
  api_key = bdf_key()
)

Arguments

...

(any)
Extra arguments appended to the API request. Combined with the default arguments with modifyList().

key

(NULL | character(1))
The series key to query. Default NULL.

start_date

(NULL | character(1) | Date(1))
Start date of the data. Default NULL.

end_date

(NULL | character(1) | Date(1))
End date of the data. Default NULL.

api_key

(character(1))
API key to use for the request. Defaults to the value returned by bdf_key(), which reads from the BANQUEDEFRANCE_KEY environment variable.

Value

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

See also

Examples

if (FALSE) { # \dontrun{
bdf_data(key = "CONJ2.M.R24.T.SM.0RG24.EFTPM100.10")
# inflation rate
bdf_data(key = "ICP.M.FR.N.000000.4.ANR")
# or with a date filter
bdf_data(key = "ICP.M.FR.N.000000.4.ANR", start_date = "2025-01-01", end_date = "2025-06-30")
# advanced filter with where clause
bdf_data(key = "ICP.M.FR.N.000000.4.ANR", where = "time_period_start >= date'2025-01-01'")
} # }