Mdic
View or edit on GitHub
This page is synchronized from trase/data/brazil/trade/mdic/readme.md. Last modified on 2025-12-14 23:19 CET by Trase Admin.
Please view or edit the original file there; changes should be reflected here after a midnight build (CET time),
or manually triggering it with a GitHub action (link).
{% docs brazil_mdic_secex_export %}
Base de Dados de Exportação do Brasil - MDIC/SECEX
The Brazil export dataset is published by Brazil's Ministry of Development, Industry, and Trade (MDIC) through its Foreign Trade Secretariat (SECEX). It contains detailed records of Brazil's exports, including product classifications, destinations, values, and volumes.
What the dataset is
The dataset contained trade data aggregated to a monthly level, and different spatial aggregation levels (national, state, municipality, port).
There are two different aggregations of the same underlying data. Both provide net kilograms and FOB dollar value in US$:
Port-level export data
The "port-level" data, called Base de dados detalhada por NCM breaks down exports by the following columns:
- Year and month.
- NCM commodity code
- The Nomenclatura Comum do Mercosul, or Mercosul Common Nomenclature is an eight-digit code given to goods in Brazil for use in international trade. It can be considered equivalent to an HS8 code.
- Statistical unit code.
- Product destination country code.
- State of product origin (as in, the Brazilian state) (*).
- This indicates the state where the exported product was shipped from, not necessarily where it was produced.
- Transport route code (land, maritime, air, etc.).
- Shipment URF code (**).
- A URF (Unidade da Receita Federal, or Federal Revenue Unit) code identifies specific customs units (customs posts, ports, airports, and border checkpoints) where export operations are processed.
Notes from Nanxu, 09-20-2021
Although the file names are the same with files under brazil/trade/mdic/port/originals/, there are column differences between the two groups of files.
- Files under brazil/trade/mdic/port/old/ contain: CO_UF and CO_PORTO
- Files under brazil/trade/mdic/port/originals/ contain: SG_UF_NCM and CO_URF
Municipality-level export data
The "municipality-level" data, called Base de dados detalhada por Município da empresa exportadora/importadora e Posição do Sistema Harmonizado (SH4) breaks down exports by the following columns:
- Year and month.
- HS4 commodity code.
- Country code of destination of the product.
- State of company's tax domicile (as in, the Brazilian state).
- Code of the municipality of tax domicile of the exporting/importing company.
This dataset used to include state of product origin (*) and shipment URF code (**) columns, which can be seen in the port-level dataset above. However, due to privacy concerns these columns were removed in mid-2018 and the data was aggregated. The reasoning was that since the dataset provided export/import data at the municipality level, including the state of origin and customs office made it easier to infer specific exporters/importers, especially in smaller cities with limited trading companies. This posed a risk to business confidentiality as competitors could analyze shipment patterns. The Brazilian government aimed to strengthen data protection in trade statistics. Although the General Data Protection Law (LGPD - Lei Geral de Proteção de Dados) was only enacted in 2020, earlier steps were taken to reduce risks of indirect identification of companies.
How we use the dataset in Trase, for example which SEI-PCS models it is involved in
The dataset is used in all of our SEI-PCS models for Brazil.
How often the dataset is updated, and when the next update is likely to be
The MDIC/SECEX export dataset is updated monthly. The data for a given month is typically released in the first half of the following month.
How to re-fetch the dataset from the original source
The data is downloaded as CSV files from https://www.gov.br/produtividade-e-comercio-exterior/pt-br/assuntos/comercio-exterior/estatisticas/base-de-dados-bruta. There is a bash script to do this:
bash trase/data/brazil/trade/mdic/municipality_port/originals/exp_20xx_and_mun.sh 2023 2024 2025
Alternatively, it can be done manually.
Manual download
The port-level export data is under 1. Base de dados detalhada por NCM: > Exportação.
The file is downloaded locally and called EXP_{year}.csv.
We rename the file, adding the date that it was downloaded and upload it to S3, e.g.:
s3://trase-storage/brazil/trade/mdic/port/originals/EXP_2024_retrieved_21-11-2024.csv
The municipality-level export data is under 2. Base de dados detalhada por Município da empresa exportadora/importadora e Posição do Sistema Harmonizado (SH4) > Exportação.
The file is downloaded locally and called EXP_{year}_MUN.csv.
We rename the file, adding the date that it was downloaded and upload it to S3, e.g.:
s3://trase-storage/brazil/trade/mdic/municipality/originals/EXP_2024_MUN_retrieved_21-11-2024.csv
The script that is used to process/clean the dataset
trase/data/brazil/trade/mdic/municipality_port/brazil_mdic_muncipality_port_201X.py.
When the dataset was last updated, and by whom
- 2022: Nanxu Su
- 2021: Tomas Carvalho and Nanxu Su
- 2020: Tomas Carvalho and Harry Biddle
- 2019: Harry Biddle
- 2018: Nanxu Su
- 1997 to 2017 inclusive: Harry Biddle
A history of changes/notes of the dataset
- April 2021: new methodological notice, also available on S3:
s3://trase-storage/brazil/trade/mdic/Methodological Change April 2021.pdfs3://trase-storage/brazil/trade/mdic/Methodological Change April 2021 - Google Translate English.pdf- Mid-2018: state of origin and customs office are removed from the municipality-level dataset to protect business confidentiality.
Acceptance criteria for sufficient level of quality of the dataset
There are no acceptance criteria defined for this dataset.
{% enddocs %}