dot-get_sgs_series: Download SGS series from Brazilian Central Bank

.get_sgs_seriesR Documentation

Download SGS series from Brazilian Central Bank

Description

Internal helper function to download time series data from BCB SGS API. Uses httr2 for robust HTTP requests with automatic fallback strategy.

Usage

.get_sgs_series(series_id, start_date = NULL, end_date = NULL)

Arguments

series_id

Numeric. SGS series ID.

start_date

Start date (YYYY, YYYY-MM, or YYYY-MM-DD format).

end_date

End date (YYYY, YYYY-MM, YYYY-MM-DD format, or NULL for current date).

Value

A data.frame with columns 'date' (Date) and 'value' (numeric).

Examples


# Example: download SELIC series (ID 432)
df <- brfinance:::.get_sgs_series(432, "2020", "2021")

head(df)
tail(df)


brfinance documentation built on Feb. 19, 2026, 9:06 a.m.