Brazil Import & Export Trade Data by HS Code & Country Scraper avatar

Brazil Import & Export Trade Data by HS Code & Country Scraper

Pricing

from $10.20 / 1,000 results

Go to Apify Store
Brazil Import & Export Trade Data by HS Code & Country Scraper

Brazil Import & Export Trade Data by HS Code & Country Scraper

Scrape Brazil import and export trade statistics by HS code (NCM), partner country and transport mode, with FOB and CIF value, freight, insurance, weight and quantity, by month. Export to JSON, CSV or Excel.

Pricing

from $10.20 / 1,000 results

Rating

0.0

(0)

Developer

Scrapers Lat

Scrapers Lat

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

18 days ago

Last modified

Share

Brazil Import & Export Trade Data by HS Code & Country Scraper

Brazil Import & Export Trade Data by HS Code & Country Scraper

Here is one real result, with every field the actor returns:

{
"flow": "import",
"reportingCountry": "Brazil",
"partnerCountry": "China",
"partnerRole": "origin",
"hsCode": "85414300",
"productDescription": "Photovoltaic cells mounted on modules or panels",
"transportMode": "MARITIMA",
"customsUnit": null,
"year": 2024,
"month": 1,
"period": "2024-01",
"valueFobUsd": 278930046,
"valueCifUsd": 290643339,
"freightUsd": 11583650,
"insuranceUsd": 129643,
"netWeightKg": 96920376,
"statisticalQuantity": 17636296,
"currency": "USD",
"source": "brazil-comexstat",
"observedAt": "2026-08-01T16:23:11.611Z"
}

Note: customsUnit is null here because includeCustomsUnit was off for this run; turn it on to populate the clearing port/airport. All shown values are real.

The most complete Brazil trade data scraper available. It returns official Brazilian import and export statistics by 8-digit NCM (HS) product code and partner country, with FOB and CIF values, freight, insurance, weight and quantity, broken down by month or aggregated, and filterable by flow, period, country and product.

📥 Input · 📤 Output · 💰 Pricing · ▶️ Examples

Apify Coverage Output Billing

Table of contents

What it does

The actor queries Brazil's official foreign-trade statistics (Comex Stat), applies the flow, period, country and product filters you pass as input, and writes one normalized trade record per product/country (and per month, when monthDetail is on) to the run's dataset. Each record includes the trade flow and partner, the 8-digit NCM/HS code with description, FOB and CIF values in USD, freight and insurance, net weight in kilograms and statistical quantity. Optionally add the transport mode and the customs clearance unit (port/airport). Missing source values are returned as null.

Partner-country names you pass are resolved to the numeric codes the source expects, so you can filter by China, United States, Argentina and so on directly.

Quickstart

Open the actor, paste this into the input, and press Run. It returns Brazilian imports of photovoltaic modules from China, month by month, for early 2024.

{
"flows": ["import"],
"periodFrom": "2024-01",
"periodTo": "2024-02",
"countries": ["China"],
"hsCodes": ["85414300"],
"monthDetail": true,
"includeTransportMode": true,
"maxTradeRecords": 10
}

Leave countries and hsCodes empty for all partners and all products. Set monthDetail off to aggregate the whole period into one record per product/country.

Input reference

FieldTypeRequiredDefaultDescription
flowsstring[]no["import"]Trade flows to collect: import, export, or both.
periodFromstringno2024-01Start month of the period (YYYY-MM).
periodTostringno2024-03End month of the period (YYYY-MM).
countriesstring[]noallPartner country names (origin for imports, destination for exports), for example China, United States, Argentina.
hsCodesstring[]noall8-digit NCM (HS) product codes, for example 85414300.
monthDetailbooleannotrueOn returns one record per month; off aggregates the whole period into one record per product/country.
includeTransportModebooleannotrueAdd the shipping mode (maritime, air, road, etc.) to each record.
includeCustomsUnitbooleannofalseAdd the customs clearance unit (port/airport). Increases the number of rows substantially.
maxTradeRecordsintegerno10Maximum trade records to collect across the whole run.

Filters combine with logical AND.

Output reference

One dataset item per trade record. Types: string, integer, number, or null when the source value is absent.

FieldTypeDescription
flowstringTrade flow: import or export.
reportingCountrystringReporting country. Always Brazil.
partnerCountrystringTrade partner country.
partnerRolestringPartner role: origin (imports) or destination (exports).
hsCodestring8-digit NCM / HS product code.
productDescriptionstringProduct description.
transportModestringTransport / shipping mode (for example MARITIMA), when included.
customsUnitstringCustoms clearance unit / port, when includeCustomsUnit is on, else null.
yearintegerYear of the observation.
monthintegerMonth number, when monthDetail is on.
periodstringPeriod (YYYY-MM when monthly, YYYY when aggregated).
valueFobUsdnumberFOB value in USD.
valueCifUsdnumberCIF value in USD.
freightUsdnumberFreight cost in USD.
insuranceUsdnumberInsurance cost in USD.
netWeightKgnumberNet weight in kilograms.
statisticalQuantitynumberStatistical quantity.
currencystringCurrency of the values. Always USD.
sourcestringData source. Always brazil-comexstat.
observedAtstringISO 8601 timestamp of when the record was collected.
errorstringnull on success. On a failed run, a single item with a populated error field is written instead.

Example output record

Real record from a live run (input {"flows":["import"],"periodFrom":"2024-01","periodTo":"2024-02","countries":["China"],"monthDetail":true,"includeTransportMode":true}):

{
"flow": "import",
"reportingCountry": "Brazil",
"partnerCountry": "China",
"partnerRole": "origin",
"hsCode": "85414300",
"productDescription": "Photovoltaic cells mounted on modules or panels",
"transportMode": "MARITIMA",
"customsUnit": null,
"year": 2024,
"month": 1,
"period": "2024-01",
"valueFobUsd": 278930046,
"valueCifUsd": 290643339,
"freightUsd": 11583650,
"insuranceUsd": 129643,
"netWeightKg": 96920376,
"statisticalQuantity": 17636296,
"currency": "USD",
"source": "brazil-comexstat",
"observedAt": "2026-08-01T16:23:11.611Z"
}

Run via API and CLI

Start a run and wait for it to finish, then read the dataset. Replace <TOKEN> with your Apify API token.

Run synchronously and get dataset items in one call:

curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~latam-customs-manifests-scraper/run-sync-get-dataset-items?token=<TOKEN>" \
-H "Content-Type: application/json" \
-d '{"flows":["import"],"periodFrom":"2024-01","periodTo":"2024-03","countries":["China"],"hsCodes":["85414300"],"maxTradeRecords":100}'

Start a run asynchronously:

curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~latam-customs-manifests-scraper/runs?token=<TOKEN>" \
-H "Content-Type: application/json" \
-d '{"flows":["export"],"periodFrom":"2024-01","periodTo":"2024-06","monthDetail":false,"maxTradeRecords":500}'

Apify CLI:

apify call scrapers_lat/latam-customs-manifests-scraper \
--input '{"flows":["import","export"],"periodFrom":"2024-01","periodTo":"2024-02","maxTradeRecords":10}'

Fetch results

Every run writes to a dataset. Fetch items as JSON, CSV, or Excel by changing format:

# JSON
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"
# CSV
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"
# Paginate large datasets
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&offset=1000&limit=1000"

<DATASET_ID> is returned as defaultDatasetId in the run object. Use offset and limit to page through large result sets. clean=true drops empty and internal fields.

Billing and limits

  • Pay per result. You are charged per trade record returned (result event). See the pricing tab for the current per-result price.
  • No charge on failure. If a run errors, the actor writes a single item with a populated error field and does not charge for it. Empty runs cost nothing.
  • Spend cap respected. Set maxTotalChargeUsd on the run; once reached, the actor stops emitting and charging further billable results.
  • Free Apify plans are capped at 10 records per run. Upgrade for higher maxTradeRecords.
  • Row-count note. Turning on includeCustomsUnit breaks each product/country into many port-level rows and increases the record count substantially.

FAQ and troubleshooting

A run returned 0 records. Why? The flow/period/country/product combination matched no published trade. Widen the period, clear the HS or country filter, and confirm the NCM code is 8 digits. Zero-result runs are not charged.

What is the difference between monthly and aggregated output? With monthDetail on you get one record per month; with it off the whole period is summed into a single record per product/country.

FOB vs CIF, which should I use? valueFobUsd is the value at the border of the exporting country; valueCifUsd adds freight and insurance. Both are provided per record.

How do I filter by product? Pass one or more 8-digit NCM (HS) codes in hsCodes, for example 85414300 for photovoltaic modules.

Why is customsUnit null? It is only populated when includeCustomsUnit is on. Non-requested fields are returned as null, never invented.

Is this an official government tool? No. This actor is independent and has no affiliation with the Brazilian government. It reads only data published on the official Comex Stat foreign-trade portal. Use it in accordance with the portal's terms.

More scrapers at scrapers.lat

Built and maintained by scrapers.lat, where we publish scrapers for US and Latin American public platforms: company registries, government data, finance, e-commerce and more. Browse the catalog or request a custom scraper at scrapers.lat.


Independent tool, not affiliated with the Brazilian government. Accesses only publicly published Comex Stat foreign-trade data. Use in accordance with the portal's terms.