COMEX (Comércio Exterior - Foreign Trade) dataset provides Brazil’s official international trade statistics extracted from Siscomex, the Integrated System of Foreign Trade maintained by the Brazilian government.
This dataset captures:
COMEX is the primary official source for Brazil’s international trade statistics, widely used for trade policy analysis, business intelligence, academic research, and economic monitoring.
COMEX data comes from: - Official records from Siscomex (Brazil’s foreign trade system) - Mandatory declarations by exporters and importers - Updated monthly with current month data - Historical data from 1989 onwards
Important note on nomenclature: From 1989 to 1996, Brazil used a different system of product nomenclature (NBLC - Nomenclatura Brasileira de Mercadorias). All conversions to the current nomenclature system are available and the package handles this transparently.
For more information, visit the Brazilian Ministry of Productivity, Employment and Foreign Trade.
Export data disaggregated at the municipality level.
Import data disaggregated at the municipality level.
Export data organized by producer/exporter and product.
Import data organized by importer/distributor and product.
Selects which trade dataset to download.
Controls whether to download the original data or the processed/cleaned version.
TRUE: Returns raw data exactly as published by
SiscomexFALSE: Returns treated data with standardized
formatting, English variable names, and cleaned valuesSpecifies which year(s) to download. Available from 1989 onwards.
time_period = 2020 # single year
time_period = c(2018, 2020) # specific years
time_period = 2015:2020 # range of yearsNote: Monthly data means each year can be quite large. Consider downloading specific years or ranges to manage file size.
# download treated exports data by municipality from 2020 to 2021
data <- load_br_trade(
dataset = "export_mun",
raw_data = FALSE,
time_period = 2020:2021,
language = "eng"
)
# download treated imports data by municipality from 2020 to 2021
data <- load_br_trade(
dataset = "import_mun",
raw_data = FALSE,
time_period = 2020:2021,
language = "eng"
)raw_data = TRUE): Original
Siscomex format, potentially with inconsistencies and naming conventions
from different time periodsraw_data = FALSE):
Standardized with English variable names, consistent units (USD for
values), and cleaned formattingWhen using data spanning 1989-1996 to 1997 onwards, be aware: - Product categories may differ between nomenclature systems - Conversions are available but not always 1:1 - Compare very old with recent data with caution