Brazil Import & Export Data by NCM (ComexStat) avatar

Brazil Import & Export Data by NCM (ComexStat)

Pricing

from $5.00 / 1,000 trade rows

Go to Apify Store
Brazil Import & Export Data by NCM (ComexStat)

Brazil Import & Export Data by NCM (ComexStat)

Official Brazilian export and import statistics (MDIC/ComexStat) by NCM/HS code, country, state and month: USD FOB/CIF, net kg and quantity.

Pricing

from $5.00 / 1,000 trade rows

Rating

0.0

(0)

Developer

Jon P

Jon P

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

13 days ago

Last modified

Categories

Features

Limited permissions

Share

Brazil Foreign Trade Data (ComexStat) — Exports & Imports by NCM/HS

Official Brazilian export and import statistics from ComexStat (MDIC/Secex), delivered as a clean dataset: one row per product × partner country × month (or any grouping you choose), with USD FOB, USD CIF, freight, insurance, net weight and statistical quantity. Product labels in English, Portuguese or Spanish.

Use it to answer questions like:

  • How much of HS 3004 (medicaments) did Brazil import from Germany each month since 2024, and through which ports?
  • Which countries buy Brazilian coffee (NCM 0901.11.10) and how did volumes change year over year?
  • Which Brazilian states export chapter 85 (electrical machinery), by transport mode?
  • Monthly import prices (USD/kg) for a specific NCM, to benchmark a supplier quote.

No scraping of HTML pages: the Actor calls the public ComexStat API, respects its rate limits, splits large requests automatically and retries transient errors. Data is monthly from 1997 to the latest month published by MDIC (usually the previous month).

Input

FieldWhat it does
flowexport, import or both (default). Each row is tagged with its flow.
ncmCodesNCM codes, 8 digits (30049099 or 3004.90.99).
hsCodesHS chapters (2 digits), headings (4) or subheadings (6). You can mix lengths and combine with NCMs.
countriesPartner countries by name (English, Portuguese or Spanish) or ComexStat code. Empty = all.
statesBrazilian states (UF) by name or code. Empty = all.
periodFrom / periodToYYYY-MM. Default: the last 12 published months.
monthlytrue = one row per month; false = one row per year.
groupByDimensions that define a row: ncm, subHeading, heading, chapter, section, country, economicBlock, state, via (transport mode), urf (customs unit). Default ncm + country.
metricsmetricFOB, metricKG, metricStatistic (needs ncm in groupBy), metricCIF, metricFreight, metricInsurance (imports only).
languageen (default), pt, es — language of product, country and state names.
maxRowsStop after this many rows (cost guard). Default 50,000; 0 = unlimited.

At least one filter (ncmCodes, hsCodes, countries or states) is required: fully unfiltered queries exceed the ComexStat server limits.

Example

{
"flow": "import",
"hsCodes": ["3004"],
"countries": ["Germany", "United States", "India"],
"periodFrom": "2024-01",
"periodTo": "2026-10",
"groupBy": ["ncm", "country", "state"],
"metrics": ["metricFOB", "metricKG", "metricCIF"]
}

Output

One dataset item per row, for example:

{
"flow": "import",
"period": "2026-05",
"year": 2026,
"month": 5,
"ncm": "30049069",
"ncmDescription": "Ot.medicaments c/comp.heterocyc.heteroat.nitr.in doses",
"hs6": "300490",
"hs4": "3004",
"hs2": "30",
"country": "United States",
"state": "Distrito Federal",
"fobUsd": 59919715,
"netKg": 1557,
"cifUsd": 60247465,
"source": "ComexStat/MDIC (Brazil)",
"dataUpdatedAt": "2026-11-06"
}

Fields present depend on groupBy and metrics. Metric fields: fobUsd, netKg, statisticalQty, cifUsd, freightUsd, insuranceUsd. Dimension fields: ncm, ncmDescription, hs6, hs6Description, hs4, hs4Description, hs2, hs2Description, section, country, economicBlock, state, transportMode, customsUnit.

The run's key-value store gets an OUTPUT record with totals per flow, the period actually covered, the number of API calls and why the run stopped (complete, maxRows, budget or timeout).

Export the dataset as JSON, CSV, Excel or XML from the Apify Console or API, or call the Actor from your own code / scheduler to keep a trade dashboard fresh every month.

Pricing

Pay per event: a small fee per run plus a fee per dataset row. Set maxRows or the run's maximum cost to cap spending; the Actor stops cleanly when either limit is reached and still saves everything collected so far.

Limits and notes

  • Data: MDIC/Secex ComexStat, the official Brazilian foreign trade statistics (same source as the ComexStat website). Rows carry dataUpdatedAt with MDIC's publication date. Attribution: MDIC/Secex — ComexStat.
  • Company names (importers/exporters) are not part of ComexStat and are not provided.
  • Municipality-level data (SH4 only) and the 1989–1996 historical series are not included in this version. Ask in the Issues tab if you need them.
  • The ComexStat API accepts only a few data queries per minute. The Actor waits out the limit and paces itself automatically: in tests, 12 months of two NCMs, exports and imports (4 API queries, about 1,700 rows), took 1–2 minutes.
  • Very large requests (a whole HS chapter, monthly, with state and transport mode) are split automatically into many API queries and can take tens of minutes.
  • The Actor stops about 20 seconds before the run's timeout, keeps every row already collected and reports stoppedBy: "timeout" in OUTPUT. Raise the timeout in the run options for very large requests.

Changelog

  • 0.2 — stops cleanly before the run's timeout instead of timing out (keeps the rows collected); the example input in the Console now covers one closed year (2025), so a first run takes seconds.
  • 0.1 — first release: general exports/imports query, name resolution for countries and states, automatic splitting, pay-per-event (Apify's default start and dataset-row events), output schema, patient handling of the API rate limit.

Em português

Estatísticas oficiais de exportação e importação do Brasil (ComexStat/MDIC) por NCM ou SH, país, UF, via de transporte e mês, com valor US$ FOB/CIF, frete, seguro, peso líquido e quantidade estatística. Informe os NCMs (ou capítulos/posições do SH), países e período; receba uma tabela limpa em JSON, CSV ou Excel, com descrições em português, inglês ou espanhol. Consultas grandes são divididas automaticamente; o Actor respeita o limite de requisições da API do MDIC.