# Brazil NCM / TIPI Lookup (`downright_blessing/brazil-ncm-tipi-lookup`) Actor

Lookup Brazil NCM / TIPI (Mercosur Common Nomenclature) codes and Portal Único public attributes from official downloadable JSON. Trade/customs classification without Siscomex Client credentials.

- **URL**: https://apify.com/downright\_blessing/brazil-ncm-tipi-lookup.md
- **Developed by:** [Joao Pedro Rosado](https://apify.com/downright_blessing) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 ncm rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Brazil NCM / TIPI Lookup

Lookup **NCM** codes — the **Mercosur nomenclature** (Nomenclatura Comum do Mercosul) used in Brazil — and optional public **Portal Único** NCM attributes from official downloadable JSON. Fast structured reference for trade, customs classification and product tax workflows. **No Siscomex Client secrets** and no importer login — public open data only.

TIPI (Tabela de Incidência do IPI) is published separately by Receita Federal (PDF/XLSX). This Actor focuses on the official Classif **NCM** table plus Portal Único public `atributo-ncm` attributes linked to each code.

**Store:** [brazil-ncm-tipi-lookup](https://apify.com/downright_blessing/brazil-ncm-tipi-lookup)

***

### What it does

1. Downloads the public NCM nomenclature JSON from Portal Único / Classif.
2. Optionally downloads the public NCM attributes ZIP and attaches `tipAttributes[]` per code.
3. Filters by NCM code list and/or Portuguese description keyword; caps with `maxItems`.

#### Official public sources

- NCM table: `https://portalunico.siscomex.gov.br/classif/api/publico/nomenclatura/download/json?perfil=PUBLICO`
- NCM attributes ZIP: `https://portalunico.siscomex.gov.br/cadatributos/api/atributo-ncm/download/json?perfil=PUBLICO`

### Who it's for

- Trade / customs teams classifying products for Brazil import/export
- ERP and tax engines that need NCM descriptions as JSON
- Marketplaces and catalog enrichment for Mercosur HS-style codes
- Agents that need **NCM TIPI**-adjacent reference without Siscomex credentials

### Input summary

| Field | Required | Description |
|---|---|---|
| `ncmCodes` | no | List of NCM codes (dots optional), e.g. `0901.11.10` |
| `keyword` | no | Case-insensitive substring on Portuguese description |
| `includeAttributes` | no | Attach Portal Único `tipAttributes[]` (default `true`) |
| `maxItems` | no | Hard Dataset cap (default 50) |

Provide codes and/or a keyword; empty inputs return a capped slice of the table.

### Output fields

One Dataset row per NCM:

`ncm`, `descriptionPt`, `descriptionEn` (null when not in source), `chapter`, `tipAttributes` (array), `sourceUrl`, `asOf`, `dataInicio`, `dataFim`, `ato`, `scrapedAt`.

### Pricing

**Pay-per-event** is already configured (Actor start + NCM rows). Attribute ZIP enrichment adds network/CPU; keep `maxItems` as the spend cap. See the Store pricing panel for current prices.

### Quick start (Apify Console)

1. Open [brazil-ncm-tipi-lookup](https://apify.com/downright_blessing/brazil-ncm-tipi-lookup) → **Start**.
2. Enter `ncmCodes` and/or a `keyword` (e.g. `café`).
3. Toggle `includeAttributes` as needed; set `maxItems`.
4. Run → export Dataset JSON/CSV.

```json
{
  "ncmCodes": ["0901.11.10", "8471.30.12"],
  "keyword": "café",
  "includeAttributes": true,
  "maxItems": 50
}
```

### Related Actors

- [Brazil PNCP Public Tenders Monitor](https://apify.com/downright_blessing/brazil-pncp-tenders-monitor)
- [Brazil PNCP Awarded Contracts](https://apify.com/downright_blessing/brazil-pncp-awarded-contracts)
- [Brazil CEIS/CNEP Sanctions Delta](https://apify.com/downright_blessing/brazil-ceis-cnep-sanctions-delta)
- [Brazil TCU Acórdãos Keyword Monitor](https://apify.com/downright_blessing/brazil-tcu-acordaos-keyword-monitor)

### Legal / data source

Official **Portal Único Siscomex** public Classif / Cadastro de Atributos downloads (`perfil=PUBLICO`). No Client ID/Secret, no DU-E/Duimp credentials. Do not scrape private Siscomex services with this Actor. Respect fair-use download frequency.

***

### Português (resumo)

Consulta a tabela **NCM** oficial do Classif/Portal Único e, opcionalmente, atributos públicos por NCM. **Não** usa Client ID/Secret Siscomex. Ideal para classificação aduaneira e enriquecimento de catálogo. **Pay-per-event** na Store.

# Actor input Schema

## `ncmCodes` (type: `array`):

Optional list of NCM codes (dots optional), e.g. 0901.11.10 or 09011110. Empty = scan by keyword or return a capped slice.

## `keyword` (type: `string`):

Case-insensitive substring match against NCM descriptionPt.

## `includeAttributes` (type: `boolean`):

When true, also download the public atributo-ncm ZIP and attach tipAttributes\[] per code.

## `maxItems` (type: `integer`):

Hard dataset row cap.

## Actor input object example

```json
{
  "ncmCodes": [],
  "keyword": "café",
  "includeAttributes": true,
  "maxItems": 50
}
```

# Actor output Schema

## `results` (type: `string`):

Default dataset items

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keyword": "café"
};

// Run the Actor and wait for it to finish
const run = await client.actor("downright_blessing/brazil-ncm-tipi-lookup").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "keyword": "café" }

# Run the Actor and wait for it to finish
run = client.actor("downright_blessing/brazil-ncm-tipi-lookup").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keyword": "café"
}' |
apify call downright_blessing/brazil-ncm-tipi-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,downright_blessing/brazil-ncm-tipi-lookup"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/PC4s00as8UWb8FYTr/builds/UdidCt5wa9JFSASZc/openapi.json
