The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Package {realestatebr}


Type: Package
Title: Import Brazilian Real Estate Data into R
Version: 1.2.0
Description: Provides access to Brazilian real estate market data from multiple official sources: the Central Bank of Brazil (BCB) https://www.bcb.gov.br/, the Brazilian Association of Real Estate Developers (ABRAINC) https://abrainc.org.br/, the Brazilian Association of Real Estate Credit and Savings Entities (ABECIP) https://www.abecip.org.br/, the Getulio Vargas Foundation (FGV) https://portalibre.fgv.br/, and the Bank for International Settlements (BIS) https://www.bis.org/, as well as Brazil's Federal Revenue Service https://www.gov.br/receitafederal/pt-br/, the Brazilian Institute of Geography and Statistics (IBGE) https://www.ibge.gov.br/, and the Ministry of Cities https://www.gov.br/cidades/pt-br/.
License: MIT + file LICENSE
URL: https://github.com/viniciusoike/realestatebr, https://viniciusoike.github.io/realestatebr/
BugReports: https://github.com/viniciusoike/realestatebr/issues
Encoding: UTF-8
Language: en-US
LazyData: true
Depends: R (≥ 4.1.0)
RoxygenNote: 7.3.3
Imports: cli, dplyr, GetBCBData, httr, janitor, jsonlite, lubridate, purrr, readr, readxl, rlang, rvest, stringr, tibble, tidyr, tidyxl, xml2, yaml, zoo
Suggests: callr, DBI, dbplyr, duckdb, ggplot2, kableExtra, knitr, pkgdown, RcppRoll, rmarkdown, scales, stringi, targets, tarchetypes, testthat, trendseries, withr
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2026-10-01 10:51:23 UTC; viniciusreginatto
Author: Vinicius Oike ORCID iD [aut, cre, cph]
Maintainer: Vinicius Oike <viniciusoike@gmail.com>
Repository: CRAN
Date/Publication: 2026-10-01 15:40:13 UTC

realestatebr: Import Brazilian Real Estate Data into R

Description

Provides access to Brazilian real estate market data from multiple official sources: the Central Bank of Brazil (BCB) https://www.bcb.gov.br/, the Brazilian Association of Real Estate Developers (ABRAINC) https://abrainc.org.br/, the Brazilian Association of Real Estate Credit and Savings Entities (ABECIP) https://www.abecip.org.br/, the Getulio Vargas Foundation (FGV) https://portalibre.fgv.br/, and the Bank for International Settlements (BIS) https://www.bis.org/, as well as Brazil's Federal Revenue Service https://www.gov.br/receitafederal/pt-br/, the Brazilian Institute of Geography and Statistics (IBGE) https://www.ibge.gov.br/, and the Ministry of Cities https://www.gov.br/cidades/pt-br/.

Author(s)

Maintainer: Vinicius Oike viniciusoike@gmail.com (ORCID) [copyright holder]

See Also

Useful links:


Character mappings for consistent encoding

Description

Maps ASCII-key identifiers to their UTF-8 Portuguese equivalents. Keys are kept as plain ASCII for easy programmatic lookup; values are UTF-8 strings as supported by Encoding: UTF-8 in DESCRIPTION.

Usage

.ENCODING_MAP

Format

An object of class list of length 13.


ABECIP Housing Credit Indicators

Description

Housing credit data from Brazilian housing finance system (SFH) including SBPE flows, financed units, and home equity loans.

Retrieve this dataset with get_dataset() using the name "abecip".

abecip <- get_dataset("abecip")
abecip_units <- get_dataset("abecip", table = "units")

Details

Column names translated from Portuguese to English following standard patterns.

Table "sbpe" (SBPE Monetary Flows)

Monetary flows from SBPE (Sistema Brasileiro de Poupança e Empréstimo). This is the default table. Coverage: January 1982-present.

date

Reference month.

sbpe_inflow

Deposits into SBPE savings accounts during the month (R$ million; historical values in the currency of the period).

sbpe_outflow

Withdrawals from SBPE savings accounts during the month (R$ million).

sbpe_netflow

Net savings flow: inflow minus outflow (R$ million).

sbpe_netflow_pct

Net flow as a share of the SBPE savings stock.

sbpe_yield

Interest credited to SBPE savings accounts (R$ million).

sbpe_stock

End-of-month SBPE savings stock (R$ million).

rural_inflow

Deposits into rural savings accounts during the month (R$ million).

rural_outflow

Withdrawals from rural savings accounts during the month (R$ million).

rural_netflow

Net rural savings flow: inflow minus outflow (R$ million).

rural_netflow_pct

Net rural flow as a share of the rural savings stock.

rural_yield

Interest credited to rural savings accounts (R$ million).

rural_stock

End-of-month rural savings stock (R$ million).

total_stock

Combined SBPE and rural savings stock (R$ million).

total_netflow

Combined SBPE and rural net savings flow (R$ million).

Table "units" (Financed Units)

Number of units financed by SBPE, split by construction and acquisition. Coverage: January 2002-present.

date

Reference month.

units_construction

Number of units financed for construction.

units_acquisition

Number of units financed for acquisition.

units_total

Total number of financed units.

currency_construction

Value of construction financing (R$ million).

currency_acquisition

Value of acquisition financing (R$ million).

currency_total

Total value of financing (R$ million).

Table "cgi" (Home Equity Loans (CGI))

Summary data on home equity loans including default rates and average terms. Coverage: January 2017-present.

year

Reference year.

date

Reference month.

new_contracts

Number of new home equity loan contracts signed in the month.

stock_contracts

Number of outstanding contracts at the end of the month.

loan

Value of new loans granted in the month (R$).

outstanding_balance

Outstanding loan balance at the end of the month (R$).

average_term

Average contract term (months).

default_rate

Share of loans in default (percent).

Source

ABECIP - Associação Brasileira das Entidades de Crédito Imobiliário

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abrainc, bcb_realestate, bcb_series, cno, fgv_ibre, mcmv, paic, pim_pf_construction, rppi, rppi_bis, secovi, sinapi


Clean a Single SBPE-Format Table

Description

Clean a Single SBPE-Format Table

Usage

abecip_clean_sbpe_table(df)

Arguments

df

Raw data frame from Excel import

Value

Cleaned tibble


ABRAINC-FIPE Primary Market Indicators

Description

Primary real estate market indicators from a panel of large developers, covering launches, sales, and business conditions.

Retrieve this dataset with get_dataset() using the name "abrainc".

abrainc <- get_dataset("abrainc")
abrainc_radar <- get_dataset("abrainc", table = "radar")

Details

Social Housing (MCMV) refers to Minha Casa Minha Vida and Casa Verde Amarela programs.

Table "indicator" (Market Indicators)

Broad numbers of launches, sales, supply in the primary market. This is the default table.

date

Reference month.

year

Reference year.

category

Indicator group (e.g. new_units, sold, delivered).

variable

Market segment: total, market_rate, or social_housing (MCMV and related programs).

value

Number of units.

variable_label

Human-readable label for variable.

Table "radar" (Business Radar)

0-10 standardized index for general business conditions.

date

Reference month.

year

Reference year.

category

Radar dimension (e.g. macro, credit, demand).

variable

Indicator within the dimension (e.g. confidence, activity, interest).

source

Source of the underlying series (e.g. FGV, BCB).

value

Standardized 0-10 score.

avg_category

Average score of the category over the full sample.

avg_year_category

Average score of the category in the year.

avg_year_variable

Average score of the variable in the year.

ma3

3-month moving average of value.

ma6

6-month moving average of value.

variable_label

Human-readable label for variable.

Table "leading" (Leading Indicator)

Building permits in São Paulo as real estate leading indicator.

date

Reference month.

year

Reference year.

variable

Series identifier: leading_index, leading_index_12m, or alvaras_total (building permits).

zone

São Paulo city zone (Total, Centro, Zona Norte, and others).

value

Series value; index points, percent change, or permit counts depending on variable.

variable_label

Human-readable label for variable.

Source

ABRAINC/FIPE

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, bcb_realestate, bcb_series, cno, fgv_ibre, mcmv, paic, pim_pf_construction, rppi, rppi_bis, secovi, sinapi


Apply Table Filtering to Loaded Dataset

Description

Apply Table Filtering to Loaded Dataset

Usage

apply_table_filtering(data, name, table)

Attach Standard Metadata to Dataset

Description

Attaches standardized metadata attributes to a dataset. Consolidates metadata attachment logic used across all dataset functions.

Usage

attach_dataset_metadata(
  data,
  source = c("web", "github", "bundled"),
  category = NULL,
  extra_info = list()
)

Arguments

data

Data frame or tibble. The dataset to attach metadata to.

source

Character. Data source: "web" (fresh from the original source), "github" (the package's GitHub release), or "bundled" (static file shipped with the package in inst/extdata).

category

Character or NULL. Dataset category/table name.

extra_info

List. Additional metadata to include in download_info.

Value

The data with metadata attributes attached.


Real Estate Players listed on B3

Description

List of main Brazilian real estate players listed on B3.

Usage

b3_real_estate

Format

b3_real_estate

A tibble with 38 rows and 3 columns:

symbol

Stock ticker.

name

Full company name.

name_short

A shorter version of the company name.

Source

B3


Brazilian Central Bank Series Metadata

Description

A table with metadata for BCB economic series. Use with get_dataset("bcb_series"). The hierarchy column controls which series are returned by default: pass table = "core" for the most relevant real estate series, or a broader level for more macroeconomic context (see get_dataset).

Usage

bcb_metadata

Format

bcb_metadata

A data frame with 140 rows and 11 columns:

code_bcb

Numeric code identifying the series.

bcb_category

Category of the series.

name_simplified

Simplified name of the series.

name_pt

Full name of the series in Portuguese.

name

Full name of the series in English.

unit

Unit of the series.

frequency

Frequency of the series.

first_value

Date of the first available observation.

last_value

Date of the last available observation.

source

Source of the series.

hierarchy

Integer relevance tier: 1 = core real estate credit series; 2 = primary (key macro series such as SELIC, IPCA, INCC); 3 = secondary (broader macro context); 4 = tertiary (less relevant or discontinued series).

Source

Brazilian Central Bank (BCB)


BCB Real Estate Market Data

Description

Detailed real estate credit and market series from the Brazilian Central Bank.

Retrieve this dataset with get_dataset() using the name "bcb_realestate".

bcb_realestate <- get_dataset("bcb_realestate")
bcb_realestate_accounting <- get_dataset("bcb_realestate", table = "accounting")

Details

Complex multi-level series structure; v1-v5 columns contain series components.

Columns

All tables share the structure below; the table argument filters which series are returned.

date

End-of-month reference date (last day of the month).

category

Top-level series grouping (e.g. credito, contabil, direcionamento, fontes, imoveis).

type

Series subtype within the category (e.g. estoque, contratacao, financiamento).

v1

Series identifier component 1; meaning varies by series (e.g. carteira, borrower type, region).

v2

Series identifier component 2 (e.g. br, pf, pj).

v3

Series identifier component 3 (e.g. credit line such as sfh, fgts, home-equity).

v4

Series identifier component 4 (often a state abbreviation or credit line).

v5

Series identifier component 5 (often a state abbreviation or br).

series_info

Full underscore-separated series identifier; together with date it uniquely identifies an observation.

value

Series value; unit varies by series (R$, units, or percent).

year

Reference year.

month

Reference month (1-12).

abbrev_state

Two-letter state abbreviation, or BR for the national aggregate.

Source

Banco Central do Brasil

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, abrainc, bcb_series, cno, fgv_ibre, mcmv, paic, pim_pf_construction, rppi, rppi_bis, secovi, sinapi


BCB Economic Series

Description

General economic and real estate related time series from Brazilian Central Bank.

Retrieve this dataset with get_dataset() using the name "bcb_series".

bcb_series <- get_dataset("bcb_series")
bcb_series_primary <- get_dataset("bcb_series", table = "primary")

Details

Metadata available in both Portuguese and English.

Columns

All tables share the structure below; the table argument filters which series are returned.

date

Reference date (frequency varies by series).

code_bcb

Numeric code of the series in the BCB SGS system.

name_simplified

Short series identifier; see the bundled bcb_metadata table for full names and units.

value

Series value.

Source

Banco Central do Brasil - SGS

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, abrainc, bcb_realestate, cno, fgv_ibre, mcmv, paic, pim_pf_construction, rppi, rppi_bis, secovi, sinapi


Look Up the First Observation Date of a Series

Description

Reads first_value from bcb_metadata so each series is requested from its own start rather than a shared floor.

Usage

bcb_series_first_date(code)

Arguments

code

Numeric. BCB series code.

Value

A Date.


Clean SBPE Data from Abecip Excel File

Description

Clean SBPE Data from Abecip Excel File

Usage

clean_abecip_sbpe(temp_path)

Arguments

temp_path

Path to the downloaded Excel file

Value

A tibble with processed SBPE data


Clean Units Data from Abecip Excel File

Description

Clean Units Data from Abecip Excel File

Usage

clean_abecip_units(temp_path)

Arguments

temp_path

Path to the downloaded Excel file

Value

A tibble with processed units data


Process BIS Detailed CSV Data

Description

Reads the flat CSV, parses compound columns, then splits by frequency with appropriate date parsing for each.

Usage

clean_bis_detailed(csv_path, quiet)

Arguments

csv_path

Path to the extracted CSV file

quiet

Logical controlling messages

Value

Named list with elements: monthly, quarterly, annual, halfyearly


Clean BIS Selected CSV Data

Description

Reads the column-oriented CSV from the BIS SPP dataset, pivots date columns to long format, and standardises column names.

Usage

clean_bis_selected(csv_path, quiet)

Arguments

csv_path

Path to the extracted CSV file

quiet

Logical controlling messages

Value

Processed BIS selected data tibble


Clear the In-Session Dataset Memo

Description

Drops every dataset memoised during the current R session. Useful when iterating during development or to force re-fetch without restarting R.

Usage

clear_session_cache()

Value

NULL, invisibly.

Examples


clear_session_cache()


Debug-Level Messaging

Description

Displays informational messages only when debug mode is enabled. This function is a wrapper around cli::cli_inform() that respects the debug mode setting.

Usage

cli_debug(message, ...)

Arguments

message

Character string. The message to display.

...

Additional arguments passed to cli::cli_inform().

Details

This function should be used for detailed processing messages that are useful for development and debugging but would be too verbose for end-users. Messages are only shown when debug mode is enabled via is_debug_mode().

See Also

is_debug_mode()


User-Level Messaging

Description

Displays concise informational messages for end-users. This function shows a simplified, clean message unless the user has requested verbose output via the quiet parameter.

Usage

cli_user(message, quiet = FALSE, ...)

Arguments

message

Character string. The message to display.

quiet

Logical. If TRUE, suppresses the message.

...

Additional arguments passed to cli::cli_inform().

Details

This function should be used for essential status messages that provide value to end-users, such as final results or major milestones. The message is shown unless explicitly suppressed by quiet=TRUE.


National Registry of Construction Works

Description

Registration, area, economic activity, and responsibility records for Brazilian construction works.

Retrieve this dataset with query_dataset() using the name "cno".

cno <- query_dataset("cno")
cno$constructions

Details

Column names are normalized to English, while source labels and anomalous values are retained without analytical cleaning.

Table "constructions" (Constructions)

One row per CNO registration.

cno

Twelve-digit CNO registration identifier. Stored as character to preserve leading zeroes.

country_code

Three-digit country code published by Receita Federal.

country_name

Country name published by Receita Federal.

start_date

Declared start date of the construction work. Historical sentinel values are retained.

responsibility_start_date

Start date of the current responsibility period.

registration_date

Date on which the work was registered in CNO.

linked_cno

Linked CNO registration when supplied by Receita Federal.

postal_code

Postal code for works in Brazil. Stored as character.

responsible_tax_id

Fourteen-digit identifier of the responsible legal person. Receita Federal suppresses CPF values.

responsible_role_code

Four-digit code for the responsible party's role.

construction_name

Name assigned to the construction, not the responsible party's name.

municipality_tom_code

Four-digit Receita Federal TOM municipality code, not an IBGE municipality code.

municipality_name

Municipality name published by Receita Federal.

street_type

Street type.

street_name

Street name.

street_number

Street number or other source value such as S/N.

neighborhood

Neighborhood name.

state

State field as published. Usually a two-letter UF abbreviation; source anomalies are retained.

postal_box

Postal box for works outside Brazil.

address_complement

Additional address information.

measurement_unit

Unit used to measure the work.

total_area

Total measurement reported for the work, expressed in measurement_unit. Source outliers are retained.

status_code

Two-digit CNO status code.

status_date

Date associated with the current status.

responsible_legal_name

Legal name of the responsible legal person when published.

plus_code

Location code published by Receita Federal. Invalid and sentinel source values are retained.

Table "areas" (Construction Areas)

Area records classified by category, destination, structure, and area type.

cno

CNO registration identifier joining to constructions.cno.

construction_category

Category reported for the construction area.

destination

Intended use reported for the work area.

structure_type

Construction structure type.

area_type

Principal or complementary area.

complementary_area_type

Complementary-area classification, when applicable.

area

Reported area in square metres. Source duplicates and outliers are retained.

Table "cnaes" (Economic Activities)

CNAE economic activities associated with each construction work.

cno

CNO registration identifier joining to constructions.cno.

cnae

Seven-digit CNAE activity code. Stored as character.

registration_date

Date on which the activity was registered.

Table "responsibilities" (Responsibility Periods)

Responsible-party roles and their periods for each construction work.

cno

CNO registration identifier joining to constructions.cno.

start_date

Start date of the responsibility period.

end_date

End date of the responsibility period, when applicable.

registration_date

Date on which the responsibility was registered.

responsible_role_code

Four-digit code for the responsible party's role.

responsible_tax_id

Fourteen-digit identifier of the responsible legal person. Receita Federal suppresses CPF values.

Source

Receita Federal do Brasil - Cadastro Nacional de Obras

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, abrainc, bcb_realestate, bcb_series, fgv_ibre, mcmv, paic, pim_pf_construction, rppi, rppi_bis, secovi, sinapi


Brazilian city identifier table

Description

A table with official IBGE identifiers for all Brazilian cities.

Usage

dim_city

Format

An object of class tbl_df (inherits from tbl, data.frame) with 5570 rows and 9 columns.

Details

A tibble with 5,570 rows and 9 columns:

code_muni

7-digit IBGE code identifying the city.

name_muni

Name of the city.

code_state

2-digit IBGE code identifying the state.

abbrev_state

Two-letter state abbreviation (e.g. "SP").

name_state

Name of the state.

code_region

1-digit IBGE code identifying the region.

name_region

Name of the region.

year

Reference year of the IBGE territorial division (2020).

name_simplified

Simplified version of the city name for easier subsetting.

Source

IBGE (Brazilian Institute of Geography and Statistics)


Download Abecip Excel File

Description

Scrapes the given page to find the download link, then downloads the Excel file using the shared download_excel() helper.

Usage

download_abecip_file(
  url_page,
  xpath,
  file_prefix,
  quiet = FALSE,
  max_retries = 3L
)

Arguments

url_page

URL of the Abecip page containing the download link

xpath

XPath to locate the download link

file_prefix

Prefix used in retry-attempt messages

quiet

Logical controlling messages

max_retries

Maximum number of retry attempts

Value

Path to the downloaded temporary file


Download SBPE Excel File from Abecip

Description

Download SBPE Excel File from Abecip

Usage

download_abecip_sbpe(quiet = FALSE, max_retries = 3L)

Arguments

quiet

Logical controlling progress messages

max_retries

Maximum number of retry attempts

Value

Path to the downloaded temporary file


Download Units Excel File from Abecip

Description

Download Units Excel File from Abecip

Usage

download_abecip_units(quiet = FALSE, max_retries = 3L)

Arguments

quiet

Logical controlling progress messages

max_retries

Maximum number of retry attempts

Value

Path to the downloaded temporary file


Download raw BCB real estate data from the API

Description

Download raw BCB real estate data from the API

Usage

download_bcb_realestate(quiet = FALSE, max_retries = 3L)

Arguments

quiet

Logical controlling messages

max_retries

Maximum number of retry attempts

Value

Raw tibble from BCB API endpoint


Download BCB Series Data

Description

Downloads BCB series data with per-series retry logic. Uses purrr::possibly() to collect failures without aborting, then reports any failed series after the full map completes.

Usage

download_bcb_series(codes_bcb, quiet, max_retries)

Arguments

codes_bcb

Vector of BCB series codes.

quiet

Logical controlling messages.

max_retries

Maximum number of retry attempts per series.

Value

A long-format tibble with columns date, value, and code_bcb.


Download BIS RPPI Detailed ZIP

Description

Download BIS RPPI Detailed ZIP

Usage

download_bis_detailed(quiet, max_retries)

Arguments

quiet

Logical controlling messages

max_retries

Maximum number of retry attempts

Value

Path to extracted CSV file


Download BIS RPPI Selected ZIP

Description

Download BIS RPPI Selected ZIP

Usage

download_bis_selected(quiet, max_retries)

Arguments

quiet

Logical controlling messages

max_retries

Maximum number of retry attempts

Value

Path to extracted CSV file


Download CSV File

Description

Downloads a CSV file to a temporary location with retry logic.

Usage

download_csv(
  url,
  min_size = 100,
  ssl_verify = TRUE,
  max_retries = 3,
  quiet = FALSE
)

Arguments

url

Character. URL of the CSV file.

min_size

Integer. Minimum file size in bytes. Default 100.

ssl_verify

Logical. Whether to verify SSL certificates.

max_retries

Integer. Number of retry attempts.

quiet

Logical. Suppress progress messages.

Value

Character. Path to downloaded CSV file.


Download and Validate Excel File

Description

Downloads an Excel file with validation of expected sheets and file size.

Usage

download_excel(
  url,
  expected_sheets = NULL,
  min_size = 1000,
  ssl_verify = TRUE,
  max_retries = 3,
  quiet = FALSE
)

Arguments

url

Character. URL of the Excel file.

expected_sheets

Character vector. Sheet names that must be present. If NULL, no sheet validation is performed.

min_size

Integer. Minimum file size in bytes. Default 1000.

ssl_verify

Logical. Whether to verify SSL certificates.

max_retries

Integer. Number of retry attempts.

quiet

Logical. Suppress progress messages.

Value

Character. Path to downloaded and validated Excel file.


Download raw SECOVI-SP indicator tables

Description

Pages are requested one at a time with a short pause between them, and each page is retried on its own. Indicators whose page cannot be read are dropped with a warning; an error is raised only when no page can be read.

Usage

download_secovi(table, quiet, max_retries, delay = 0.5)

Arguments

table

Data table to import

quiet

Logical controlling messages

max_retries

Maximum number of retry attempts

delay

Seconds to wait between page requests

Value

Named list of scraped data tables


Download with Retry Logic

Description

Executes a download function with automatic retry on failure. Uses exponential backoff between retry attempts.

Usage

download_with_retry(fn, max_retries = 3, quiet = FALSE, desc = "Download")

Arguments

fn

Function to execute (should return data on success)

max_retries

Maximum number of retry attempts

quiet

If TRUE, suppresses retry warnings

desc

Description of what's being downloaded (for error messages)

Value

Result from fn() if successful


Download and Extract File from ZIP Archive

Description

Downloads a ZIP archive, extracts a file matching file_pattern, validates its size, and returns the path to the extracted file.

Usage

download_zip(
  url,
  file_pattern = "\\.csv$",
  min_size = 1000,
  ssl_verify = TRUE,
  max_retries = 3,
  quiet = FALSE
)

Arguments

url

Character. URL of the ZIP archive.

file_pattern

Character. Regex pattern to match the target file inside the archive. Default "\\.csv$".

min_size

Integer. Minimum extracted file size in bytes. Default 1000.

ssl_verify

Logical. Whether to verify SSL certificates.

max_retries

Integer. Number of retry attempts.

quiet

Logical. Suppress progress messages.

Value

Character. Path to the extracted file.


Character Encoding Utilities

Description

Internal utilities for consistent handling of Portuguese characters. The package uses UTF-8 encoding (declared in DESCRIPTION) throughout.


Fallback to GitHub Release on Download Failure

Description

Attempts to load a dataset from the package's GitHub release when a primary web download has failed. Returns NULL on miss so callers can decide whether to abort or degrade gracefully.

Usage

fallback_to_github_cache(dataset_name, quiet = FALSE)

Arguments

dataset_name

Character. Asset stem used in the GitHub release (e.g., "bcb_realestate", "secovi_sp").

quiet

Logical. If TRUE, suppresses messages.

Value

A tibble if the GitHub release asset is available, otherwise NULL.


Fetch a Cache Asset from GitHub Releases

Description

Downloads a single asset from the package's cache-latest release into a tempfile, reads it, and returns the deserialised object. Tries .rds first, then .csv.gz. Returns NULL on miss (either format missing, the release does not exist, or network failure).

Usage

fetch_github_release_asset(cached_name, quiet = FALSE)

Arguments

cached_name

Character. Asset stem, e.g. "abecip_sbpe".

quiet

Logical. Suppress network and parse warnings. Progress messages are debug-level (see is_debug_mode()).

Value

The deserialised dataset, or NULL.


Fetch a Single Series from the BCB SGS API

Description

Wraps GetBCBData::gbcbd_get_series(), which splits long spans into windows the API accepts. SGS rejects requests covering more than ten years of a daily series, so the split is what makes full history reachable.

Usage

fetch_sgs_series(code, first_date)

Arguments

code

Numeric. BCB series code.

first_date

Date. First period to request.

Details

A window that returns no data yields a row with no reference date, which happens for discontinued series whose last window falls after the final observation. Those rows are dropped.

Value

A tibble with columns date, value, and code_bcb.


FGV IBRE Real Estate Indicators

Description

Real estate market indicators from Fundação Getulio Vargas IBRE.

Retrieve this dataset with get_dataset() using the name "fgv_ibre".

fgv_ibre <- get_dataset("fgv_ibre")

Details

Technical economic terms; standard translations applied.

Columns

date

Reference month.

name_simplified

Short series identifier (e.g. incc_brasil_di, ivar_brazil, ic_cst).

value

Series value.

name_series

Full series name in Portuguese.

code_series

FGV series code.

unit

Unit of the series (index, percent, or indicator).

source

FGV survey of origin (e.g. FGV-INCC, FGV-SONDA).

Source

FGV IBRE

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, abrainc, bcb_realestate, bcb_series, cno, mcmv, paic, pim_pf_construction, rppi, rppi_bis, secovi, sinapi


Get Credit Indicators from Abecip

Description

Get Credit Indicators from Abecip

Usage

get_abecip_indicators(table = "sbpe", quiet = FALSE, max_retries = 3L)

Arguments

table

Character. One of 'sbpe' (default), 'units', or 'cgi'.

quiet

Logical. If TRUE, suppresses progress messages and warnings. If FALSE (default), provides detailed progress reporting.

max_retries

Integer. Maximum number of retry attempts for failed downloads. Defaults to 3.

Details

Downloads housing credit data from Abecip including SBPE monetary flows, financed units, and home-equity loan data.

Value

Either a named list (when table is 'all') or a tibble (for specific tables). The return includes metadata attributes:

download_info

List with download statistics

source

Data source used

download_time

Timestamp of download

Source

Brazilian Association of Real Estate Credit and Savings (ABECIP)


Import Indicators from the Abrainc-Fipe Report

Description

Import Indicators from the Abrainc-Fipe Report

Usage

get_abrainc_indicators(table = "indicator", quiet = FALSE, max_retries = 3L)

Arguments

table

Character. One of 'indicator' (default), 'radar', 'leading', or 'all'.

quiet

Logical. If TRUE, suppresses progress messages and warnings. If FALSE (default), provides detailed progress reporting.

max_retries

Integer. Maximum number of retry attempts for failed downloads. Defaults to 3.

Details

Downloads data from the Abrainc-Fipe Indicators report including information on new launches, sales, delivered units, and market indicators.

Value

Either a named list (when table is 'all') or a tibble (for specific tables). The return includes metadata attributes:

download_info

List with download statistics

source

Data source used

download_time

Timestamp of download

Source

Abrainc-Fipe Indicators (FIPE)


Get Available Tables from Dataset Info

Description

Get Available Tables from Dataset Info

Usage

get_available_tables(dataset_info)

Import Real Estate data from the Brazilian Central Bank

Description

Imports real estate data from BCB including credit sources, applications, financed units, and real estate indices.

Usage

get_bcb_realestate(table = "all", quiet = FALSE, max_retries = 3L)

Arguments

table

Character. One of 'accounting', 'application', 'indices', 'sources', 'units', or 'all' (default).

quiet

Logical. If TRUE, suppresses progress messages.

max_retries

Integer. Maximum retry attempts. Defaults to 3.

Value

Tibble with BCB real estate data. Includes metadata attributes: source, download_time.

Source

Brazilian Central Bank (BCB) Open Data Portal


Download macroeconomic time-series from BCB

Description

Download macroeconomic time-series from BCB

Usage

get_bcb_series(table = "core", quiet = FALSE, max_retries = 3L)

Arguments

table

Character. Hierarchy level to return:

"core"

Core real estate credit series (default, ~40 series).

"primary"

Core plus key macro series such as inflation rate (~59 series).

"secondary"

Primary plus broader macro context such as GDP, unemployment (~109 series).

"tertiary"

All series including less relevant and discontinued ones (~141 series).

"full"

Equivalent to "tertiary". Returns all available series.

quiet

Logical. If TRUE, suppresses progress messages.

max_retries

Integer. Maximum retry attempts for failed API calls. Defaults to 3.

Details

Downloads macroeconomic time series from BCB. Series are organized by relevance to the Brazilian real estate market using a four-level hierarchy. The default ("core") returns the 40 most directly relevant series covering real estate credit concession, interest rates, and delinquency. Use broader levels to include macroeconomic context series.

Each series is downloaded in full, from its first published observation to the present. Filter the returned date column to restrict the window.

Value

A 4-column tibble with columns date, code_bcb, name_simplified, and value. Series metadata is available in bcb_metadata.

Source

Brazilian Central Bank (BCB) Time Series Management System (SGS)


Get Cached Asset Stem for Dataset

Description

Maps a dataset name (and optional table) to the asset stem used in GitHub releases — i.e. the file name without extension.

Usage

get_cached_name(name, dataset_info, table = NULL)

Get Dataset

Description

Unified interface for accessing all realestatebr datasets. Resolves data from the package's GitHub release assets when possible (fast, pre-processed, updated weekly by CI) and falls back to a fresh download from the original source. Repeated calls within one R session are served from an in-memory memo to avoid redundant network traffic.

Usage

get_dataset(
  name,
  table = NULL,
  source = "auto",
  date_start = NULL,
  date_end = NULL,
  quiet = FALSE,
  ...
)

Arguments

name

Character. Dataset name (see list_datasets for options). Each dataset has its own help topic documenting tables and columns: abecip, abrainc, bcb_realestate, bcb_series, fgv_ibre, paic, pim_pf_construction, rppi, rppi_bis, secovi, and sinapi.

table

Character. Specific table within a multi-table dataset. See get_dataset_info for available tables per dataset.

source

Character. Data source preference:

"auto"

Use the in-session memo if available, otherwise GitHub releases, otherwise fresh download (default).

"github"

Pre-processed asset from the package's GitHub release.

"fresh"

Fresh download from the original source.

Use clear_session_cache to drop the in-session memo.

date_start

Date. Optional first date to retain for time-series datasets. Retained for compatibility; filtering is applied after the dataset is loaded.

date_end

Date. Optional last date to retain for time-series datasets. Retained for compatibility; filtering is applied after the dataset is loaded.

quiet

Logical. If TRUE, suppresses informational messages. Errors and warnings are still shown.

...

Additional arguments passed to the internal function when a fresh download is required. Retained for compatibility with the 1.0.1 interface.

Details

To restrict a time series to a date window, use date_start and date_end or filter the returned date column with dplyr::filter().

Value

A tibble or named list, depending on the dataset. Use get_dataset_info to inspect the expected structure.

See Also

query_dataset() for large relational datasets, list_datasets for available datasets, get_dataset_info for dataset details, clear_session_cache to drop the in-session memo. For table and column documentation of each dataset, see the dataset help topics: abecip, abrainc, bcb_realestate, bcb_series, fgv_ibre, paic, pim_pf_construction, rppi, rppi_bis, secovi, and sinapi.

Examples


abecip_data <- get_dataset("abecip")

sbpe_data <- get_dataset("abecip", table = "sbpe")

bcb_data <- get_dataset("bcb_series", quiet = TRUE)

bcb_recent <- get_dataset(
  "bcb_series",
  date_start = as.Date("2020-01-01")
)


Get Dataset from Specific Source

Description

Get Dataset from Specific Source

Usage

get_dataset_from_source(name, dataset_info, source, table, quiet, ...)

Value

A list with elements data and tier.


Get Dataset Information

Description

Returns detailed metadata for a single dataset, including available tables and source information.

Usage

get_dataset_info(name)

Arguments

name

Character. Dataset identifier (see list_datasets for options).

Value

A named list with the following elements:

metadata

Title, description, geography, frequency, and coverage.

categories

Available tables/subtables and their descriptions.

source_info

Source organization and URL.

technical_info

Access mode, cache or query-manifest metadata, and translation notes.

Examples

info <- get_dataset_info("abecip")
str(info)


Get Dataset with Fallback Strategy

Description

Auto strategy: in-session memo -> GitHub release -> fresh download.

Usage

get_dataset_with_fallback(name, dataset_info, table, quiet, ...)

Value

A list with elements data and tier, where tier names the source that served the data.


Get FGV IBRE Confidence Indicators

Description

Loads construction confidence indicators from FGV IBRE including confidence indices, expectation indicators, and INCC price indices. FGV data is not available via API; this function fetches the pre-processed dataset from the package's GitHub release.

Usage

get_fgv_ibre(table = "indicators", quiet = FALSE)

Arguments

table

Character. Which dataset to return: "indicators" (default) or "all".

quiet

Logical. If TRUE, suppresses progress messages.

Value

Tibble with FGV IBRE indicators. Includes metadata attributes: source, download_time.


Get Data from GitHub Release Cache

Description

Downloads the appropriate asset into a tempfile and returns the deserialised object, applying table filtering where applicable.

Usage

get_from_github_cache(name, dataset_info, table, quiet = FALSE)

Get Data from Internal Function

Description

Calls dataset-specific internal functions for a fresh download from the original source. Their step-by-step progress messages are suppressed unless debug mode is on, since get_dataset() reports the source itself.

Usage

get_from_internal_function(name, dataset_info, table, quiet = FALSE, ...)

Get PAIC Construction Industry Data

Description

Downloads annual Pesquisa Anual da Indústria da Construção (PAIC) data from IBGE for the new series starting in reference year 2024. The result covers construction enterprises, employment, revenue, costs, and output. Do not join this series with the 2007-2023 tables or report growth rates across the 2023-2024 break (see IBGE Nota técnica 01/2026).

Usage

get_paic(table = "activity", quiet = FALSE, max_retries = 3L)

Arguments

table

Character. One of 'activity' (default), 'size', 'state', or 'all'.

quiet

Logical. If TRUE, suppresses progress messages.

max_retries

Integer. Maximum retry attempts. Defaults to 3.

Value

Either a named list (when table is 'all') or a tibble (for specific tables).

Source

IBGE Pesquisa Anual da Indústria da Construção (PAIC), SIDRA tables 10463, 10441, and 10442


Get PIM-PF Construction-input Production Index

Description

Downloads and links the monthly IBGE physical-production index for inputs typically used in construction. The historical series from SIDRA table 2294 is rescaled to the 2022-reference series in table 8886 using the ratio of their 2012 annual means.

Usage

get_pim_pf_construction(quiet = FALSE, max_retries = 3L)

Arguments

quiet

Logical. If TRUE, suppresses progress messages.

max_retries

Integer. Maximum retry attempts. Defaults to 3.

Value

A tibble containing one linked monthly index from January 1991.

Source

IBGE Pesquisa Industrial Mensal - Produção Física (PIM-PF), SIDRA tables 2294 and 8886


Get Stacked RPPI Data

Description

Get Stacked RPPI Data

Usage

get_rppi(table = "sale", quiet = FALSE, max_retries = 3L)

Arguments

table

Character. "sale", "rent", or "all"

quiet

Logical. If TRUE, suppresses messages

max_retries

Integer. Maximum retry attempts

Details

Stacks multiple Brazilian residential property price indices into a single tibble with consistent columns for easy comparison. Handles different RPPI sources (IGMI-R, IVG-R, FipeZap, IVAR, IQAIW) and standardizes their formats.

Sale stack: IGMI-R, IVG-R, FipeZap. Rent stack: IVAR, IQAIW, FipeZap. Use get_dataset("rppi", table) for individual indices (IQA, IQAIW, Secovi-SP, etc.).

Value

Tibble with columns: date, name_muni, index, chg, acum12m, source (plus transaction_type if table="all")


Get Residential Property Price Indices from BIS

Description

Downloads Residential Property Price Indices from BIS with support for selected series and detailed monthly/quarterly/annual/halfyearly datasets.

Usage

get_rppi_bis(table = "selected", quiet = FALSE, max_retries = 3L)

Arguments

table

Character. Dataset table: "selected", "detailed_monthly", "detailed_quarterly", "detailed_annual", or "detailed_halfyearly".

quiet

Logical. If TRUE, suppresses progress messages.

max_retries

Integer. Maximum retry attempts. Defaults to 3.

Value

Tibble with BIS RPPI data. Includes metadata attributes: source, download_time.

Source

Bank for International Settlements (BIS) Residential Property Prices


Get FipeZap RPPI

Description

Get FipeZap RPPI

Usage

get_rppi_fipezap(city = "all", quiet = FALSE, max_retries = 3L)

Arguments

city

City name or "all" (default). Filtering by city doesn't save processing time.

quiet

Logical. If TRUE, suppresses warnings

max_retries

Integer. Maximum retry attempts

Details

The FipeZap Index is a monthly median stratified index across ~20 Brazilian cities, based on online listings from Zap Imoveis. Includes residential and commercial markets, both sale and rent, stratified by number of rooms. The overall city index is a weighted sum of median prices by room/region. Residential index includes only apartments, studios, and flats. National index: name_muni == 'Brazil' (after standardization).

Value

Tibble with columns: date, name_muni, market, rent_sale, variable, rooms, value


Get the IGMI Sales Index

Description

Get the IGMI Sales Index

Usage

get_rppi_igmi(quiet = FALSE, max_retries = 3L)

Arguments

quiet

Logical. If TRUE, suppresses warnings

max_retries

Integer. Maximum retry attempts for downloads

Details

The IGMI-R (Residential Real Estate Index) is a hedonic sales index based on bank appraisal reports, available for Brazil + 10 capital cities. Hedonic indices account for both composition bias and quality differentials across the housing stock. Maintained by ABECIP in partnership with FGV.

Value

Tibble with columns: date, name_muni, index, chg, acum12m


Get QuintoAndar Rental Index (IQA)

Description

Get QuintoAndar Rental Index (IQA)

Usage

get_rppi_iqa(quiet = FALSE, max_retries = 3L)

Arguments

quiet

Logical. If TRUE, suppresses warnings

max_retries

Integer. Maximum retry attempts for downloads

Details

The IQA (QuintoAndar Rental Index) is a median stratified index for Rio de Janeiro and Sao Paulo, based on new rent contracts managed by QuintoAndar. Includes only apartments, studios, and flats. Note: IQA provides raw prices (not index numbers), so rent_price is the median rent per square meter.

Value

Tibble with columns: date, name_muni, rent_price, chg, acum12m


Get QuintoAndar ImovelWeb Rental Index (IQAIW)

Description

Get QuintoAndar ImovelWeb Rental Index (IQAIW)

Usage

get_rppi_iqaiw(quiet = FALSE, max_retries = 3L)

Arguments

quiet

Logical. If TRUE, suppresses warnings

max_retries

Integer. Maximum retry attempts for downloads

Details

The IQAIW (Indice QuintoAndar ImovelWeb) is a rental index for major Brazilian cities. The index is based on both new rental contracts (managed by QuintoAndar) and online listings from QuintoAndar's listings (including ImovelWeb). The IQAIW was developed in 2023 and replaced the former IQA index. Given the change in methodology and data sources, the IQAIW is not directly comparable to the IQA index. Formally, the index is a hedonic double imputed index, controlling for quality changes using a flexible GAM specification with location variables. In this sense, the IQAIW is more theoretically sound than median stratified indices like FipeZap or the former IQA. The mixture of listings and contracts, however, lacks theoretical support and seems to be mainly driven by branding purposes. The ImovelWeb brand was purchased by QuintoAndar in 2021-22 and the IQAIW symbolizes the merging of both brands. In other words, the original IQA could've been improved simply by adopting a hedonic methodology, without the need to mix data sources.

Value

Tibble with columns: date, name_muni, index, chg, acum12m, price_m2


Get IVAR Rent Index

Description

Get IVAR Rent Index

Usage

get_rppi_ivar(quiet = FALSE, max_retries = 3L)

Arguments

quiet

Logical. If TRUE, suppresses warnings

max_retries

Integer. Maximum retry attempts (not used for this data source)

Details

The IVAR (Residential Rent Variation Index) is a repeat-rent index from IBRE/FGV, comparing the same housing unit over time. Based on rental contracts from brokers. Available for 4 major cities (Sao Paulo, Rio, Porto Alegre, Belo Horizonte); the national index is a weighted average. More theoretically sound than IGP-M for rent contracts as it measures only rent prices.

Value

Tibble with columns: date, name_muni, index, chg, acum12m, name_simplified, abbrev_state

Note

IVAR's underlying source (FGV) is not accessible via web scraping; when the static fgv_data object is unavailable, this function falls back to the package's GitHub release.


Get the IVGR Sales Index

Description

Get the IVGR Sales Index

Usage

get_rppi_ivgr(quiet = FALSE, max_retries = 3L)

Arguments

quiet

Logical. If TRUE, suppresses warnings

max_retries

Integer. Maximum retry attempts for downloads

Details

The IVG-R (Residential Real Estate Collateral Value Index) is a monthly median sales index based on bank appraisals, calculated by the Brazilian Central Bank (BCB series 21340). The index estimates long-run trends in home prices using the Hodrick-Prescott filter (lambda=3600) applied to major metropolitan regions. Note: Median indices suffer from composition bias and cannot account for quality changes across the housing stock.

Value

Tibble with columns: date, name_geo, index, chg, acum12m

References

Banco Central do Brasil (2018) "Indice de Valores de Garantia de Imoveis Residenciais Financiados (IVG-R). Seminario de Metodologia do IBGE."


Get Secovi-SP Rent Index

Description

Get Secovi-SP Rent Index

Usage

get_rppi_secovi_sp(quiet = FALSE, max_retries = 3L)

Arguments

quiet

Logical. If TRUE, suppresses warnings

max_retries

Integer. Maximum retry attempts

Details

Secovi-SP rent price index for Sao Paulo. Wrapper around get_secovi() that extracts and formats rent price data as RPPI.

Value

Tibble with columns: date, name_muni, index, chg, acum12m


Import data from Secovi-SP

Description

Import data from Secovi-SP

Usage

get_secovi(table = "all", quiet = FALSE, max_retries = 3L)

Arguments

table

Character. One of 'condo', 'rent', 'launch', 'sale' or 'all' (default).

quiet

Logical. If TRUE, suppresses progress messages and warnings. If FALSE (default), provides detailed progress reporting.

max_retries

Integer. Maximum number of retry attempts for failed web scraping operations. Defaults to 3.

Details

Scrapes real estate data from SECOVI-SP including condominium fees, rental market data, launches, and sales information.

Value

A tibble with SECOVI-SP real estate data. The return includes metadata attributes:

download_info

List with download statistics

source

Data source used

download_time

Timestamp of download


Get SINAPI Construction Costs and Indices

Description

Downloads monthly SINAPI costs, indices, and percentage changes from IBGE for Brazil, the five geographic regions, and all states. The result includes series both with and without payroll-tax relief.

Usage

get_sinapi(quiet = FALSE, max_retries = 3L)

Arguments

quiet

Logical. If TRUE, suppresses progress messages.

max_retries

Integer. Maximum retry attempts. Defaults to 3.

Value

A tibble with monthly construction costs, indices, and percentage changes by geography and payroll-relief treatment.

Source

IBGE Sistema Nacional de Pesquisa de Custos e Índices da Construção Civil (SINAPI), SIDRA tables 2296 and 6586


Harmonize FipeZap Data for Stacking

Description

Harmonize FipeZap Data for Stacking

Usage

harmonize_fipezap_for_stacking(dat, transaction_type = NULL)

Arguments

dat

FipeZap data tibble

transaction_type

"sale" or "rent" to filter for stacking

Value

Harmonized tibble with standard RPPI columns


Check if Debug Mode is Enabled

Description

Checks whether debug mode is enabled for detailed package messaging. Debug mode can be enabled via environment variable or package option.

Usage

is_debug_mode()

Details

Debug mode can be enabled in two ways (checked in order of precedence):

  1. Environment variable: REALESTATEBR_DEBUG=TRUE

  2. Package option: options(realestatebr.debug = TRUE)

When debug mode is enabled, all detailed processing messages are shown, including file-by-file progress, type detection, and intermediate steps. This is useful for development and troubleshooting.

Value

Logical. TRUE if debug mode is enabled, FALSE otherwise.


List Available Datasets

Description

Returns a tibble describing all datasets available in the realestatebr package. Optionally filter by category, source organization, or geographic coverage.

Usage

list_datasets(category = NULL, source = NULL, geography = NULL)

Arguments

category

Optional character. Keyword matched against the dataset description (e.g., "indicators", "prices", "credit").

source

Optional character. Filter by data source organization (e.g., "BCB", "FIPE", "ABRAINC").

geography

Optional character. Filter by geographic coverage (e.g., "Brazil", "São Paulo").

Value

A tibble with one row per dataset and the following columns:

name

Dataset identifier used with get_dataset() or query_dataset(), according to access_mode.

title

English dataset name.

title_pt

Portuguese dataset name.

description

Brief description.

source

Data source organization.

geography

Geographic coverage.

frequency

Update frequency.

coverage

Time period covered.

access_mode

Either "materialized" or "query".

available_tables

Comma-separated table names for multi-table datasets.

See Also

get_dataset() and query_dataset() for retrieving data, get_dataset_info() for detailed metadata on a single dataset.

Examples

list_datasets()

list_datasets(source = "BCB")


Load and Process CGI Data from Bundled Excel File

Description

Load and Process CGI Data from Bundled Excel File

Usage

load_abecip_cgi(path)

Arguments

path

Path to abecip_cgi.xlsx

Value

A tibble with processed CGI data


Load Dataset Registry from YAML

Description

Internal function to load the dataset registry from the inst/extdata/datasets.yaml file.

Usage

load_dataset_registry()

Value

A list containing the parsed YAML registry


FGTS/MCMV Housing Finance and Subsidized Projects

Description

Published financing observations, official financing summaries, and subsidized housing project records.

Retrieve this dataset with query_dataset() using the name "mcmv".

mcmv <- query_dataset("mcmv")
mcmv$financing

Details

Source categories, missing observations, duplicates, and anomalies are retained. See the working article and data dictionary.

Table "financing" (Financing)

One published financing observation, usually one housing unit. The source has no unique key.

reference_date

Reference date reported inside the source; not retrieval or publication date.

code_muni_6

Six-digit IBGE municipality identifier without its check digit.

name_muni

Municipality name as published, including whitespace and capitalization.

state

Source state abbreviation.

region

Source Brazilian region label; capitalization is preserved.

contract_date

Financing contract signature date.

units_financed

Number of financed housing units reported in this observation.

amount_financed

Financing amount, in nominal BRL.

subsidy_fgts_discount

FGTS discount subsidy, in nominal BRL.

subsidy_ogu_discount

Federal budget (OGU) discount subsidy, in nominal BRL.

subsidy_fgts_interest

FGTS interest-equilibrium subsidy, in nominal BRL.

subsidy_ogu_interest

OGU interest-equilibrium subsidy, in nominal BRL.

purchase_price

Property purchase value, in nominal BRL.

household_income

Reported household income, in nominal BRL; no frequency inferred.

financing_program

Source financing program label, including programs outside MCMV/CVA.

interest_rate

Source interest rate in percentage units; periodicity is not inferred.

property_type

Source property-type label, preserving capitalization variants.

fgts_account_holder

Source FGTS account-holder code, retained as character; not a Boolean.

amortization_system

Source amortization-system label.

birth_date

Reported borrower birth date; unpublished in July analytical layout.

income_band

Source income-band label or code; no undocumented code crosswalk is applied.

project_name

Source development name; unpublished in July financing layout.

sex

Source sex code; unpublished in March analytical layout.

Table "financing_summary" (Financing Summary)

Official totals by municipality, year, month, and income band.

reference_date

Reference date reported inside the source; not retrieval or publication date.

code_muni_6

Six-digit IBGE municipality identifier without its check digit.

name_muni

Municipality name as published, including whitespace and capitalization.

state

Source state abbreviation.

region

Source Brazilian region label; capitalization is preserved.

contract_year

Source financing year; missing years are retained.

contract_month

Source financing month; absent in annual summaries.

units_financed

Number of financed housing units reported in this observation.

amount_financed

Financing amount, in nominal BRL.

subsidy_total

Official total subsidy in nominal BRL; July reconciles to all four analytical subsidy components.

income_band

Source income-band label or code; no undocumented code crosswalk is applied.

Table "subsidized_projects" (Subsidized Projects)

One published subsidized-project record. Duplicate rows and missing operation codes are retained.

reference_date

Reference date reported inside the source; not retrieval or publication date.

code_muni_6

Six-digit IBGE municipality identifier without its check digit.

name_muni

Municipality name as published, including whitespace and capitalization.

state

Source state abbreviation.

region

Source Brazilian region label; capitalization is preserved.

contract_date

Project contract signature date.

operation_code

Source operation identifier; missing and repeated values are retained. Not a primary key.

project_name

Source development name.

financial_agent

Source financial-agent name.

modality

Source housing modality label.

project_status

Source project-status label.

units_contracted

Reported contracted housing units, including repeated source records.

units_delivered

Reported delivered housing units.

units_outstanding

Reported active outstanding housing units.

units_cancelled

Reported cancelled housing units; missing counts are not zero.

amount_contracted

Total project contract amount, in nominal BRL.

amount_disbursed

Disbursed project amount, in nominal BRL.

responsible_entity_cnpj

Source CNPJ of construction company or social entity, stored as character.

responsible_entity_name

Source name of construction company or social entity.

address

Source project address.

postal_code

Source postal code (CEP), stored as character.

Source

Ministério das Cidades - Secretaria Nacional de Habitação

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, abrainc, bcb_realestate, bcb_series, cno, fgv_ibre, paic, pim_pf_construction, rppi, rppi_bis, secovi, sinapi


Build Memo Key for Dataset + Table

Description

Build Memo Key for Dataset + Table

Usage

memo_key(name, table)

PAIC Construction Industry Data

Description

Annual construction-industry activity, employment, revenue, costs, and output for the new series starting in 2024.

Retrieve this dataset with get_dataset() using the name "paic".

paic <- get_dataset("paic")
paic_size <- get_dataset("paic", table = "size")

Details

New 2024-onward series per IBGE Nota técnica 01/2026; the 2024 series break reflects the new Cadastro Básico de Seleção. Values publish in original units, including thousand reais. Table 10463 covers all firms at national level only; table 10442 covers firms with five or more workers by headquarters or work location. The work-location basis of variables 13808, 631, 673, 1245, and 1241 follows the PAIC 2024 publication (v. 34, June 2026), which collects the regional block by Unidade da Federação de atuação da empresa. In table 10441, SIDRA marks unpublished state cells in the total and 1-4 bands with a dash; these rows are dropped rather than read as zeros.

Table "activity" (Activity by Size Band)

General construction-enterprise data by firm-size band and CNAE activity from SIDRA table 10463 (Brazil only, all firms). The hierarchy stacks totals, divisions, groups, and classes in one tibble; filter by activity_level to avoid double-counting. Detail differs by size band: 1-4 workers reaches divisions only, 5-29 adds groups, and 30+ reaches classes. No category covers all sizes for a single division; the only all-firm row is Total das empresas, so a national division total is the sum of the three size bands. This is the default table. Coverage: 2024-present.

year

Reference year.

source_table

SIDRA table supplying the observation (10463).

geography_type

Geographic level (brazil for this table).

geography_code

IBGE code for the geographic unit.

geography_name

Geographic unit name in Portuguese.

size_band

Firm-size band: total, 1_4, 5_29, or 30_plus.

activity_level

CNAE level: total, division, group, or class.

activity_code

CNAE 2.0 code parsed from the category (e.g. 41, 41.1, 41.10); missing for totals.

activity_name

Canonical CNAE activity name from the package lookup.

division_code

Parent CNAE division code.

group_code

Parent CNAE group code (for groups and classes).

variable_id

SIDRA variable ID.

variable

English series identifier (e.g. firms, employment, wages, construction_output).

variable_name_pt

Original IBGE variable label in Portuguese.

unit

Original IBGE unit, including thousand reais (Mil Reais) where specified.

value

Observed value in the original unit; NA when the cell is not applicable, not available, or suppressed.

value_raw

Original SIDRA cell text.

value_status

Cell status: observed, zero (SIDRA -), not_applicable (..), not_available (...), suppressed (X), or missing.

Table "size" (Size Bands by Geography)

General construction-enterprise data by firm-size band from SIDRA table 10441 (Brazil, regions, and states, all firms). State rows cover firms with five or more workers only, because SIDRA does not publish state figures for the total and 1-4 bands. Keeps the 16 level variables; the 16 share variables (percentual do total geral) are dropped because users can derive them. Coverage: 2024-present.

year

Reference year.

source_table

SIDRA table supplying the observation (10441).

geography_type

Geographic level: brazil, region, or state.

geography_code

IBGE code for the geographic unit; interpret together with geography_type.

geography_name

Geographic unit name in Portuguese.

size_band

Firm-size band: total, 1_4, or 5_plus (states: 5_plus only).

variable_id

SIDRA variable ID.

variable

English series identifier (e.g. firms, employment, wages, construction_output).

variable_name_pt

Original IBGE variable label in Portuguese.

unit

Original IBGE unit, including thousand reais (Mil Reais) where specified.

value

Observed value in the original unit; NA when the cell is not applicable, not available, or suppressed.

value_raw

Original SIDRA cell text.

value_status

Cell status: observed, zero (SIDRA -), not_applicable (..), not_available (...), suppressed (X), or missing.

Table "state" (Large Firms by State)

Employment, wages, costs, and output for construction firms with five or more workers from SIDRA table 10442 (Brazil, regions, and states). The geography_basis column records whether the variable follows headquarters (13807, origem-sede) or work location (all other variables, local de atuação). Coverage: 2024-present.

year

Reference year.

source_table

SIDRA table supplying the observation (10442).

geography_type

Geographic level: brazil, region, or state.

geography_code

IBGE code for the geographic unit; interpret together with geography_type.

geography_name

Geographic unit name in Portuguese.

geography_basis

Geographic meaning: headquarters (variable 13807) or work_location (all other variables).

variable_id

SIDRA variable ID.

variable

English series identifier (e.g. employment, wages, construction_output). construction_and_development_costs (1245) includes development costs and differs from construction_costs in the other tables.

variable_name_pt

Original IBGE variable label in Portuguese.

unit

Original IBGE unit, including thousand reais (Mil Reais) where specified.

value

Observed value in the original unit; NA when the cell is not applicable, not available, or suppressed.

value_raw

Original SIDRA cell text.

value_status

Cell status: observed, zero (SIDRA -), not_applicable (..), not_available (...), suppressed (X), or missing.

Source

IBGE - Pesquisa Anual da Indústria da Construção

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, abrainc, bcb_realestate, bcb_series, cno, fgv_ibre, mcmv, pim_pf_construction, rppi, rppi_bis, secovi, sinapi


PIM-PF Construction-input Production Index

Description

Linked monthly physical-production index for inputs typically used in construction.

Retrieve this dataset with get_dataset() using the name "pim_pf_construction".

pim_pf_construction <- get_dataset("pim_pf_construction")

Details

The 1991-2011 series from SIDRA table 2294 is linked to table 8886 using their full 2012 overlap.

Columns

date

First day of the reference month.

variable

Series identifier: construction_inputs_production_index.

reference_period

Reference period of the linked index: 2022 average = 100.

source_table

SIDRA table supplying the observation: 2294 before 2012 and 8886 from 2012 onward.

value

Linked physical-production index. Values before 2012 are rescaled by the ratio of the two source series' 2012 annual means.

Source

IBGE - Pesquisa Industrial Mensal - Produção Física

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, abrainc, bcb_realestate, bcb_series, cno, fgv_ibre, mcmv, paic, rppi, rppi_bis, secovi, sinapi


Query a Large Dataset Lazily

Description

Opens a large dataset as one or more lazy DuckDB tables. No observations enter R memory until the query is explicitly collected with dplyr::collect(). Related tables returned in the same catalog share one database connection and can be joined with standard dplyr verbs.

Usage

query_dataset(name, table = NULL, version = "latest", quiet = FALSE)

Arguments

name

Character. Dataset identifier. See list_datasets() for datasets whose access_mode is "query".

table

Character or NULL. Return one table when supplied. When NULL, return a named catalog containing every related table.

version

Character. Immutable dataset version, or "latest" to use the version referenced by the latest manifest.

quiet

Logical. If TRUE, suppress informational messages.

Value

If table is supplied, a closable lazy dbplyr table. Otherwise, a realestatebr_query_dataset catalog containing named lazy tables. Close either result explicitly with close() when it is no longer needed.

See Also

get_dataset() for datasets returned directly in memory.

Examples


cno <- query_dataset("cno")
on.exit(close(cno))

constructions_sp <- cno$constructions |>
  dplyr::filter(.data$state == "SP")

result <- constructions_sp |>
  dplyr::inner_join(cno$areas, by = "cno") |>
  dplyr::collect()


Convert Registry to Tibble

Description

Internal function to convert the nested YAML registry structure to a flat tibble suitable for display and filtering.

Usage

registry_to_tibble(registry)

Arguments

registry

List containing the parsed YAML registry

Value

A tibble with dataset information


Resolve BCB Hierarchy Level to Series Codes

Description

Maps a hierarchy level name to a vector of BCB series codes. The levels are cumulative: "primary" includes all "core" series, "secondary" includes all "primary" series, and so on.

Usage

resolve_bcb_hierarchy(table)

Arguments

table

Character. One of "core", "primary", "secondary", "tertiary", "full", or "all".

Value

Integer vector of BCB series codes.


Brazilian Residential Property Price Indices

Description

Brazilian residential property price indices from every major publisher.

Retrieve this dataset with get_dataset() using the name "rppi".

rppi <- get_dataset("rppi")
rppi_ivgr <- get_dataset("rppi", table = "ivgr")

Details

Index methodologies vary by source; base periods normalized where possible.

Table "fipezap" (FIPE-ZAP Index)

FIPE-ZAP residential property price index. This is the default table. Coverage: Major cities.

date

Reference month.

name_muni

City name or aggregate (e.g. Índice Fipezap).

market

Market segment: residential or commercial.

rent_sale

Transaction type: sale or rent.

variable

Measure: index, chg, acum12m, price_m2, or yield.

rooms

Number of bedrooms (total, 1, 2, 3, or 4).

value

Value of the measure.

Table "ivgr" (IVGR - Índice de Valores Gerais Residenciais)

General residential values index. Coverage: National.

date

Reference month.

name_geo

Geographic area (Brazil).

index

Price index level.

chg

Month-on-month change of the index.

acum12m

Accumulated 12-month change of the index.

Table "igmi" (IGMI - Índice Geral do Mercado Imobiliário)

General real estate market index. Coverage: São Paulo.

date

Reference month.

name_muni

City name or national aggregate.

index

Price index level.

chg

Month-on-month change of the index.

acum12m

Accumulated 12-month change of the index.

Table "iqa" (IQA - Índice QuintoAndar)

QuintoAndar rent price index. Coverage: Major cities.

date

Reference month.

name_muni

City name.

index

Rent index level.

chg

Month-on-month change of the index.

acum12m

Accumulated 12-month change of the index.

Table "iqaiw" (IQAIW - Índice QuintoAndar ImovelWeb)

QuintoAndar ImovelWeb hedonic rent price index. Coverage: Major cities (6 cities).

date

Reference month.

name_muni

City name.

rooms

Number of bedrooms (total, 1, 2, 3, or 4).

index

Rent index level.

chg

Month-on-month change of the index.

acum12m

Accumulated 12-month change of the index.

Table "ivar" (IVAR - Índice de Valores de Aluguéis Residenciais)

Residential rent values index. Coverage: National.

date

Reference month.

name_muni

City name or national aggregate.

index

Rent index level.

chg

Month-on-month change of the index.

acum12m

Accumulated 12-month change of the index.

Table "secovi_sp" (SECOVI-SP Index)

São Paulo real estate syndicate index. Coverage: São Paulo.

date

Reference month.

name_muni

City name (São Paulo).

index

Rent index level.

chg

Month-on-month change of the index.

acum12m

Accumulated 12-month change of the index.

Table "sale" (Stacked Sale Indices)

Harmonized combination of all sale-related indices with source column.

source

Index source: IVG-R, IGMI-R, or FipeZap.

date

Reference month.

name_muni

City name or aggregate (e.g. Brazil).

index

Price index level (each source has its own base period).

chg

Month-on-month change of the index.

acum12m

Accumulated 12-month change of the index.

Table "rent" (Stacked Rent Indices)

Harmonized combination of all rent-related indices with source column.

source

Index source: IVAR, IQAIW, or FipeZap.

date

Reference month.

name_muni

City name or aggregate (e.g. Brazil).

index

Rent index level (each source has its own base period).

chg

Month-on-month change of the index.

acum12m

Accumulated 12-month change of the index.

Table "all" (All Indices Combined)

Complete stacked dataset with transaction_type indicator.

source

Index source (e.g. IVG-R, IGMI-R, IVAR, IQAIW, FipeZap).

date

Reference month.

name_muni

City name or aggregate (e.g. Brazil).

index

Index level (each source has its own base period).

chg

Month-on-month change of the index.

acum12m

Accumulated 12-month change of the index.

transaction_type

Transaction type: sale or rent.

Source

Multiple (FIPE/ZAP, IVGR, IGMI, IQA, IQAIW, IVAR, SECOVI-SP)

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, abrainc, bcb_realestate, bcb_series, cno, fgv_ibre, mcmv, paic, pim_pf_construction, rppi_bis, secovi, sinapi


BIS Residential Property Price Indices

Description

International residential property price indices from Bank for International Settlements.

Retrieve this dataset with get_dataset() using the name "rppi_bis".

rppi_bis <- get_dataset("rppi_bis")
rppi_bis_detailed_monthly <- get_dataset("rppi_bis", table = "detailed_monthly")

Details

International data; minimal translation needed.

Table "selected" (Selected Series)

Core RPPI series for major countries. This is the default table.

date

Reference quarter (first day of the quarter).

ref_area_code

Country or area code (aggregates use BIS codes such as 4T).

ref_area_name

Country or area name.

unit

Measure: index (2010 = 100) or yoy_chg (year-on-year change, percent).

unit_name

Full description of the unit of measure.

is_nominal

1 for nominal series, 0 for CPI-deflated (real) series.

series_code

BIS series identifier.

value

Series value.

Table "detailed_monthly" (Detailed Monthly)

Monthly detailed RPPI data.

date

Reference period.

year

Reference year.

series_code

BIS series identifier.

ref_area_code

Country or area code.

ref_area_name

Country or area name.

re_type_code

Property type code.

re_type_name

Property type (e.g. all types, new or existing dwellings).

re_vintage_code

Property vintage code.

re_vintage_name

Property vintage (new versus existing).

compiling_org_code

Compiling organisation code.

compiling_org_name

Compiling organisation.

priced_unit_code

Priced unit code.

priced_unit_name

Priced unit (e.g. dwelling, square metre).

seas_adjust_code

Seasonal adjustment code.

seas_adjust_name

Seasonal adjustment description.

availability_code

Series availability code.

availability_name

Series availability description.

unit_code

Unit of measure code.

unit_name

Unit of measure description.

unit_mult_code

Unit multiplier code.

unit_mult_name

Unit multiplier description.

value

Series value.

Frequency-specific period columns (month, quarter, or semester) and a few metadata columns vary slightly across the detailed tables.

Table "detailed_quarterly" (Detailed Quarterly)

Quarterly detailed RPPI data.

date

Reference period.

year

Reference year.

series_code

BIS series identifier.

ref_area_code

Country or area code.

ref_area_name

Country or area name.

re_type_code

Property type code.

re_type_name

Property type (e.g. all types, new or existing dwellings).

re_vintage_code

Property vintage code.

re_vintage_name

Property vintage (new versus existing).

compiling_org_code

Compiling organisation code.

compiling_org_name

Compiling organisation.

priced_unit_code

Priced unit code.

priced_unit_name

Priced unit (e.g. dwelling, square metre).

seas_adjust_code

Seasonal adjustment code.

seas_adjust_name

Seasonal adjustment description.

availability_code

Series availability code.

availability_name

Series availability description.

unit_code

Unit of measure code.

unit_name

Unit of measure description.

unit_mult_code

Unit multiplier code.

unit_mult_name

Unit multiplier description.

value

Series value.

Table "detailed_annual" (Detailed Annual)

Annual detailed RPPI data.

date

Reference period.

year

Reference year.

series_code

BIS series identifier.

ref_area_code

Country or area code.

ref_area_name

Country or area name.

re_type_code

Property type code.

re_type_name

Property type (e.g. all types, new or existing dwellings).

re_vintage_code

Property vintage code.

re_vintage_name

Property vintage (new versus existing).

compiling_org_code

Compiling organisation code.

compiling_org_name

Compiling organisation.

priced_unit_code

Priced unit code.

priced_unit_name

Priced unit (e.g. dwelling, square metre).

seas_adjust_code

Seasonal adjustment code.

seas_adjust_name

Seasonal adjustment description.

availability_code

Series availability code.

availability_name

Series availability description.

unit_code

Unit of measure code.

unit_name

Unit of measure description.

unit_mult_code

Unit multiplier code.

unit_mult_name

Unit multiplier description.

value

Series value.

Table "detailed_halfyearly" (Detailed Half-yearly)

Half-yearly detailed RPPI data.

date

Reference period.

year

Reference year.

series_code

BIS series identifier.

ref_area_code

Country or area code.

ref_area_name

Country or area name.

re_type_code

Property type code.

re_type_name

Property type (e.g. all types, new or existing dwellings).

re_vintage_code

Property vintage code.

re_vintage_name

Property vintage (new versus existing).

compiling_org_code

Compiling organisation code.

compiling_org_name

Compiling organisation.

priced_unit_code

Priced unit code.

priced_unit_name

Priced unit (e.g. dwelling, square metre).

seas_adjust_code

Seasonal adjustment code.

seas_adjust_name

Seasonal adjustment description.

availability_code

Series availability code.

availability_name

Series availability description.

unit_code

Unit of measure code.

unit_name

Unit of measure description.

unit_mult_code

Unit multiplier code.

unit_mult_name

Unit multiplier description.

value

Series value.

Source

Bank for International Settlements

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, abrainc, bcb_realestate, bcb_series, cno, fgv_ibre, mcmv, paic, pim_pf_construction, rppi, secovi, sinapi


RPPI Helper Functions

Description

Internal helper functions to reduce code duplication in RPPI functions. These are not exported and only used internally.


SECOVI-SP Real Estate Market Data

Description

São Paulo real estate market indicators including condominium fees, rentals, launches, and sales.

Retrieve this dataset with get_dataset() using the name "secovi".

secovi <- get_dataset("secovi")
secovi_condo <- get_dataset("secovi", table = "condo")

Details

Regional classifications are specific to the São Paulo metropolitan area. SECOVI no longer publishes indicators 25 (launches_rmsp) and 118 (sales_rmsp), so they are not returned.

Columns

All tables share the structure below; the table argument filters which series are returned.

date

Reference month.

category

Market segment: condo, rent, launch, or sale.

variable

Indicator within the category (e.g. icon, default_condominio, acao_locaticia).

name

Breakdown dimension of the indicator (region, property type, or total).

value

Indicator value; unit varies by variable.

Source

SECOVI-SP - Sindicato da Habitação

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, abrainc, bcb_realestate, bcb_series, cno, fgv_ibre, mcmv, paic, pim_pf_construction, rppi, rppi_bis, sinapi


Show Dataset Import Message

Description

Reports the dataset, the table served, and the source that answered, in a single message. Datasets resolved to their default table also list the other tables available.

Usage

show_import_message(name, table_info, tier)

Arguments

tier

Character. One of "memo", "github", or "fresh".


SINAPI Construction Costs and Indices

Description

Monthly construction costs, cost indices, and percentage changes, with and without payroll-tax relief.

Retrieve this dataset with get_dataset() using the name "sinapi".

sinapi <- get_dataset("sinapi")

Details

Payroll-relief series come from SIDRA table 2296 and series without payroll relief from table 6586. The R$/m² level starts in September 2012 with relief and January 2017 without relief; earlier coverage applies only to index variables.

Columns

date

First day of the reference month.

geography_type

Geographic level: brazil, region, or state.

geography_code

IBGE code for the geographic unit; interpret together with geography_type.

geography_name

Geographic unit name in Portuguese.

payroll_relief

Whether the series includes payroll-tax relief (desoneração da folha de pagamento).

variable

Series identifier: cost, materials_cost, labor_cost, cost_index, materials_index, labor_index, monthly_change, year_to_date_change, or twelve_month_change.

variable_label

Original IBGE variable label in Portuguese.

unit

Original IBGE unit: Reais for costs, Número-índice for indices, and a percent sign for changes.

value

Observed value. Missing, unavailable, and suppressed observations are omitted.

Source

IBGE - Sistema Nacional de Pesquisa de Custos e Índices da Construção Civil

See Also

get_dataset(), query_dataset(), list_datasets(), get_dataset_info()

Other datasets: abecip, abrainc, bcb_realestate, bcb_series, cno, fgv_ibre, mcmv, paic, pim_pf_construction, rppi, rppi_bis, secovi


Standardize RPPI Structure

Description

Standardize RPPI Structure

Usage

standardize_rppi_structure(dat)

Arguments

dat

Input tibble from any RPPI source

Value

Standardized tibble with consistent columns


Check if Internal Function Supports table="all"

Description

Check if Internal Function Supports table="all"

Usage

supports_table_all(func_name)

Test function to verify encoding patterns work correctly

Description

Test function to verify encoding patterns work correctly

Usage

test_encoding_patterns()

Validate Abecip Data

Description

Validate Abecip Data

Usage

validate_abecip_data(data, type)

Arguments

data

Data frame to validate

type

Type of data ("sbpe" or "units")

Value

NULL (validates or errors)


Validate and Resolve Table Parameter

Description

Validate and Resolve Table Parameter

Usage

validate_and_resolve_table(name, dataset_info, table = NULL)

Generic Data Validation

Description

Validates basic dataset requirements. Consolidates validation logic used across all dataset functions.

Usage

validate_dataset(
  data,
  dataset_name,
  required_cols = "date",
  min_rows = 1,
  check_dates = TRUE,
  max_future_days = 90
)

Arguments

data

Data frame or tibble. The dataset to validate.

dataset_name

Character. Name of dataset for error messages.

required_cols

Character vector. Required column names. Default is "date".

min_rows

Integer. Minimum expected number of rows. Default 1.

check_dates

Logical. Whether to validate date column. Default TRUE.

max_future_days

Integer. Maximum days in future allowed for dates. Default 90.

Value

Invisible TRUE if all validations pass. Errors or warns otherwise.


Generic Parameter Validation for Dataset Functions

Description

Validates common parameters used across all dataset functions.

Usage

validate_dataset_params(
  table,
  valid_tables,
  quiet,
  max_retries,
  allow_all = TRUE
)

Arguments

table

Character. The table parameter to validate.

valid_tables

Character vector. Valid table names for the dataset.

quiet

Logical. Whether to suppress messages.

max_retries

Numeric. Maximum number of retry attempts.

allow_all

Logical. Whether "all" is a valid table value. Default TRUE.

Value

Invisible TRUE if all validations pass. Errors otherwise.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.