garofalodeveloperThiago Garofalo

Import intelligence: from the list of who imported to the decision of whom to call

Period: November 2026 · Role: thesis, data source research, architecture, code, validation and publishing · Status: in production since 2026-11-09 (automatic layer for every NCM; deep layer validated on one NCM); the open-data part published as an open-source tool

One-sentence summary: trade-data platforms tell you who imported, from whom and how much, and stop at the spreadsheet download; on top of them and of official data I built the layer that says whom to call today, with which product, at what price and why, with the landed cost and the domestic price ceiling computed for every one of the 8,782 tariff codes (NCM) Brazil imports.

1. Context and problem

My family’s group has an importer of mining supplies and a domestic manufacturer of couplings, hoses and fittings. Both compete with imported goods. The first commercial question is always the same: who buys this abroad, and for how much?

There is a paid answer. Trade intelligence platforms cross bills of lading and show, per NCM code, the likely importers and exporters with FOB value and weight. It is a good snapshot, but generic: it serves any industry and stops at the download. On the subscription in use, each query shows up to 1,000 rows, and downloads are capped per month.

The starting point was a question from the business owner himself: can we build something like it, and more differentiated?

2. The thesis

Importer names are not available as open data in Brazil: the import declaration is confidential. Rebuilding the list would mean buying manifest data at a cost higher than the subscription. So the thesis was different: use the paid platform only as the source of names and build everything else on official data.

The differentiation is in the decision layer, which no platform delivers ready for a specific manufacturer or distributor:

The platform answers The system answers
Who imported Who among them can buy from someone else (excluding captive imports, a subsidiary buying from its parent)
How much When to call: who is late to restock, who stopped, who just started, who is growing
From which country What importing really costs, and the domestic price ceiling that beats the import
A spreadsheet A sales mission with the reason, measured by Precision@K

One sentence guided the design: the platform ends at the download; the system ends at the order.

3. Three-layer architecture

flowchart TB
  subgraph A["Automatic layer: every NCM, official data only"]
    CS[Comex Stat national data<br/>market, price, freight, mode, country] --> R[Landed cost and<br/>ceiling per NCM]
    TEC[Common External Tariff<br/>and Gecex 272/2021 annexes] --> R
    TIPI[IPI table] --> R
    PTAX[PTAX exchange rate] --> R
    R --> RK[Opportunity ranking<br/>with a score]
  end
  subgraph P["Deep layer: selected NCMs"]
    L[Monthly lists from the<br/>paid platform] --> C[Tax ID matched in the<br/>open company registry]
    C --> M[Captive, role, signals,<br/>reference price, ceiling<br/>and margin per importer]
  end
  subgraph G["Action and measurement"]
    MI[Mission with the reason] --> PK[Precision@K by origin]
  end
  RK -- "chooses where to spend the quota" --> L
  M --> MI

The automatic layer runs by itself every month. The deep layer is only worth it on the codes the first one points to, because each one costs download quota.

4. What the data revealed

The figures below are for NCM 4009.31.00 (textile-reinforced rubber hose), the pilot.

5. Landed cost and domestic price ceiling

The calculation that became the core of the system:

net cost        = CIF + import duty + AFRMM (merchant marine fee) + customs fees
cash outlay     = net cost + IPI + PIS + Cofins + ICMS (gross-up)
domestic ceiling = net cost / ((1 − ICMS on the domestic sale) × (1 − PIS/Cofins credit))

Importers under the standard tax regime recover IPI, PIS, Cofins and import ICMS as credits. The fair comparison with a domestic purchase, which also generates credits, is the net cost. The ceiling is the invoice price (with ICMS, without IPI) below which buying in Brazil is cheaper than importing.

1 kg of 4009.31.00 in bulk (US$ 4.63, PTAX R$ 5.5146) R$
CIF (5.79% freight and 0.075% insurance, from Comex Stat) 27.03
Import duty (12.6%) 3.41
AFRMM and customs fees 0.92
Net cost 31.35
Cash outlay, with recoverable taxes 44.51
Domestic price ceiling 42.13

Since the manufacturer sells by the meter, not by the kilo, the weight per meter of each size, computed from the wall cross-section and calibrated against manufacturers’ data sheets, converts the ceiling: a 1/2” SAE 100R6 hose comes to R$ 9.56 per meter.

A product decision came from a conversation with the owner: the selling price floats and is not what matters. The product is the ceiling. The company’s own price became optional, and the system scaled to every NCM with no manual input.

6. How it is measured

7. Numbers

Measure Value
NCM codes with cost and ceiling 8,782 (US$ 294.6 bn imported in 12 months)
Comex Stat rows processed per load 6.75 million, in about 30 s
Official tax rates loaded 10,522 codes
Full ranking computation about 1.5 s
Importers in the pilot 868, 853 with tax ID
Captive market in the pilot 47%
From request to deploy about 1 day

8. Lessons

9. Next steps

  1. Measured use: 2 to 4 weeks of evaluated missions on the group’s product lines, plus monthly lists for two or three more codes chosen by the ranking.
  2. Proposal with numbers (shipped on 2026-11-10): landed cost, ceiling and margin in the import-substitution proposal. The e-mail is drafted by Claude using only the facts cleared for the customer; the ceiling, the margin and the licensed data never reach the model, and every number in the text is checked against the facts, at about US$ 0.03 per draft.
  3. Active alerts: notify when a new signal appears after the monthly load.
  4. Purchasing intelligence: price per kg by exporter, for the importer to negotiate and choose suppliers.
  5. Closed loop: record the commercial outcome and recalibrate the score with it.
  6. End price: bring prices paid in public tenders, for the three price layers (FOB, importer cost, end price).

10. Stack and code