Brazil Import & Export Trade Data by HS Code & Country Scraper
Pricing
from $10.20 / 1,000 results
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
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
18 days ago
Last modified
Categories
Share
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:
customsUnitisnullhere becauseincludeCustomsUnitwas 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
Table of contents
- What it does
- Quickstart
- Input reference
- Output reference
- Example output record
- Run via API and CLI
- Fetch results
- Billing and limits
- FAQ and troubleshooting
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
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
flows | string[] | no | ["import"] | Trade flows to collect: import, export, or both. |
periodFrom | string | no | 2024-01 | Start month of the period (YYYY-MM). |
periodTo | string | no | 2024-03 | End month of the period (YYYY-MM). |
countries | string[] | no | all | Partner country names (origin for imports, destination for exports), for example China, United States, Argentina. |
hsCodes | string[] | no | all | 8-digit NCM (HS) product codes, for example 85414300. |
monthDetail | boolean | no | true | On returns one record per month; off aggregates the whole period into one record per product/country. |
includeTransportMode | boolean | no | true | Add the shipping mode (maritime, air, road, etc.) to each record. |
includeCustomsUnit | boolean | no | false | Add the customs clearance unit (port/airport). Increases the number of rows substantially. |
maxTradeRecords | integer | no | 10 | Maximum 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.
| Field | Type | Description |
|---|---|---|
flow | string | Trade flow: import or export. |
reportingCountry | string | Reporting country. Always Brazil. |
partnerCountry | string | Trade partner country. |
partnerRole | string | Partner role: origin (imports) or destination (exports). |
hsCode | string | 8-digit NCM / HS product code. |
productDescription | string | Product description. |
transportMode | string | Transport / shipping mode (for example MARITIMA), when included. |
customsUnit | string | Customs clearance unit / port, when includeCustomsUnit is on, else null. |
year | integer | Year of the observation. |
month | integer | Month number, when monthDetail is on. |
period | string | Period (YYYY-MM when monthly, YYYY when aggregated). |
valueFobUsd | number | FOB value in USD. |
valueCifUsd | number | CIF value in USD. |
freightUsd | number | Freight cost in USD. |
insuranceUsd | number | Insurance cost in USD. |
netWeightKg | number | Net weight in kilograms. |
statisticalQuantity | number | Statistical quantity. |
currency | string | Currency of the values. Always USD. |
source | string | Data source. Always brazil-comexstat. |
observedAt | string | ISO 8601 timestamp of when the record was collected. |
error | string | null 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:
# JSONcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"# CSVcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"# Paginate large datasetscurl "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 (
resultevent). 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
errorfield and does not charge for it. Empty runs cost nothing. - Spend cap respected. Set
maxTotalChargeUsdon 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
includeCustomsUnitbreaks 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.
Related scrapers
- UN Comtrade Trade Data Scraper: Global bilateral trade statistics by HS code.
- Paraguay Customs Scraper: Paraguay import and export customs data.
- LATAM Central Banks FX Scraper: FX, policy and inflation rates from LATAM central banks.
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.
