NCM API – Brazil Tax Code Lookup (NCM, CEST, CFOP, NBS, CNAE)
Pricing
from $1.00 / 1,000 lookup results
NCM API – Brazil Tax Code Lookup (NCM, CEST, CFOP, NBS, CNAE)
Look up official Brazilian tax codes in one call: NCM with hierarchy and linked CEST, CFOP, NBS, LC 116, CNAE 2.3, IBGE municipalities and IBS/CBS reform codes (CST, cClassTrib). Exact, prefix or accent-insensitive text search. JSON for ERPs and AI agents.
Pricing
from $1.00 / 1,000 lookup results
Rating
0.0
(0)
Developer
Brasil Data
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
19 days ago
Last modified
Categories
Features
Share
What does it do?
Look up and cross-reference the official Brazilian tax tables in a single call. Send a list of codes or free texts and get back each code's official description, its hierarchy, cross-references to the other tables and the source it came from. Also covers LC 116 service items, IBGE municipality codes and the IBS/CBS tax-reform codes (CST, cClassTrib).
Table (table) | What it is | Official source |
|---|---|---|
ncm | Mercosur goods nomenclature (8 digits) with section > chapter > heading > subheading > item | Portal Único Siscomex (Receita Federal / SECEX) |
cest | Tax-substitution codes (ICMS-ST) with the NCM codes listed for each one | CONFAZ, Convênio ICMS 142/2018 |
cfop | Fiscal operation codes, with the explanatory note for each code | CONFAZ, Annex II of Convênio s/nº of 1970 (Ajuste SINIEF 3/2024 plus later amendments) |
nbs | Brazilian services nomenclature (9 digits) | Receita Federal reform calculator, open data |
lc116 | Municipal service list (ISS) of Lei Complementar 116/2003 | Planalto, consolidated text of the law |
cnae | CNAE 2.3 economic activities, from section down to subclass | IBGE / CONCLA API |
municipality | IBGE municipality codes (7 digits) with state and region | IBGE Localidades API |
reform_class | IBS/CBS tax-reform CST and cClassTrib codes, with legal basis and reduction percentages | Receita Federal reform calculator, open data |
Who is it for?
AI agents filling in invoices (NF-e / NFS-e), ERP and e-commerce integrations, accounting tools, and developers who need reliable Brazilian code tables without scraping half a dozen government sites.
Why use it
- One call, many tables.
automode works out which table a code belongs to from its format.8471.30.12is an NCM code,5.102a CFOP,01.07an LC 116 subitem and3550308a municipality. - Cross-references nobody else joins.
- NCM to its linked CEST codes, most specific match first.
- CEST to the NCM codes it lists.
- CST to its cClassTrib codes.
- LC 116 item to its subitems.
- CNAE level to its child levels.
- Hierarchy included. An NCM result includes its section, chapter, heading and subheading, plus a readable
description_path, so a bare item called "-- Outros" still makes sense. - Validity handled. CEST entries that are revoked or not yet in force (for example, new wording that takes effect next month) are flagged in
record_statusasin_force,revokedorscheduled, withvalid_fromandvalid_todates. - Fast and cheap. The tables are bundled as a versioned snapshot inside the Actor, so a run does not depend on government sites being up. The example input finishes in a few seconds.
- Traceable. Every record carries
source_name,source_url,source_versionandretrieved_at.
Input
{"queries": ["8471.30.12", "5102", "01.07", "6201-5/01", "parafuso"],"table": "auto","search_mode": "auto","include_related": true,"language": "en","max_results_per_query": 10}
queries: codes, typed with or without punctuation, or free text. Text search ignores accents and case and matches word prefixes, soinformatica suportfinds "Suporte técnico em informática". For municipalities, a trailing state code narrows the search:campinas sp. Up to 1000 queries per run.table: one ofauto(all tables),ncm,cest,cfop,nbs,lc116,cnae,municipalityorreform_class. Inautomode the same digits can match several tables:5102returns CFOP 5.102 and NCM heading 51.02. Punctuation narrows the match (5.102matches only the CFOP), or settableto restrict the search.search_mode:auto(default): exact match for codes, text search for words.exact: the code itself.prefix: every code that starts with the query.8471withtable: ncmreturns all codes under heading 84.71.text: search in the official descriptions.
include_related: adds cross-references (defaulttrue).language: language of the status messages,enorpt. Official descriptions are always returned in Portuguese, exactly as published. No machine translation is applied.max_results_per_query: from 1 to 200, default 10.
Output (one dataset item per record)
{"query": "8471.30.12","status": "found","table": "ncm","code": "8471.30.12","description": "De peso inferior a 3,5 kg, com tela de área superior a 140 cm², mas inferior a 560 cm²","description_language": "pt-BR","level": "subitem","record_status": "in_force","valid_from": "2022-04-01","valid_to": null,"match_type": "exact","hierarchy": [{"table": "ncm", "level": "section", "code": "XVI", "description": null, "chapters": "84-85"},{"table": "ncm", "level": "chapter", "code": "84", "description": "Reatores nucleares, caldeiras, máquinas, ..."},{"table": "ncm", "level": "heading", "code": "84.71", "description": "Máquinas automáticas para processamento de dados ..."},{"table": "ncm", "level": "subheading_2", "code": "8471.30", "description": "- Máquinas automáticas ... portáteis ..."},{"table": "ncm", "level": "item", "code": "8471.30.1", "description": "Capazes de funcionar sem fonte externa de energia"}],"details": {"legal_act": "Res Gecex 272/2021", "description_path": "Máquinas automáticas ... > ... > De peso inferior a 3,5 kg ..."},"related": [{"table": "cest", "code": "21.028.00", "description": "Máquinas automáticas para processamento de dados, portáteis ...","relation": "cest_for_ncm", "record_status": "in_force", "matched_ncm": "8471.30"}],"source_name": "NCM - Nomenclatura Comum do Mercosul (Portal Único Siscomex, Receita Federal/SECEX)","source_version": "Resolução Gecex nº 926/2026 (Vigente em 25/10/2026)","source_url": "https://portalunico.siscomex.gov.br/classif/api/publico/nomenclatura/download/json?perfil=PUBLICO","retrieved_at": "2026-10-25T03:17:26+00:00","data_license": "Brazilian official act (Resolução Gecex) / federal open data","terms_note": "Official act / public-sector open data ..."}
When a query matches nothing, the Actor returns a free item so you know it was processed:
{"query": "9999.99.99", "status": "not_found", "code": null, "message": "No record found for this query in the selected table(s)."}
A query that does not fit the selected table's format gets status: "invalid_format" and a hint. For example, table: cfop with 51023 returns "CFOP codes have 4 digits...".
How much does it cost?
Pay per event. You pay only for records found; Apify platform compute is included in these prices.
| Event | Price | When |
|---|---|---|
apify-actor-start | US$ 0.00005 | once per run (per GB of memory; default 1 GB) |
lookup-result | US$ 0.001 per record returned | each item with status: "found" |
not_found and invalid_format items are never charged. With include_related: true the cross-references come inside the same item, at no extra cost. Examples:
- The prefilled example (3 queries, a few records): under US$ 0.01
- 1,000 records: about US$ 1
The run stops producing results as soon as the maximum charge per run that you set is reached. Apify's free plan includes monthly credit that covers small tests.
Integrations: API, n8n, Make, Zapier
- API: one HTTP call runs the lookup and returns the records as JSON:
POST https://api.apify.com/v2/acts/brasil-data~brazil-tax-code-lookup/run-sync-get-dataset-itemswith your Apify token in theAuthorization: Bearerheader and{"queries": ["8471.30.12"]}as the body. Runs usually finish in a few seconds, so the synchronous endpoint works well. - n8n: use the official Apify node, operation Run an Actor and get dataset, Actor
brasil-data/brazil-tax-code-lookup. Typical use: validate the NCM/CFOP of new products from a spreadsheet or an e-commerce webhook before issuing an invoice. - Make and Zapier: use the Apify app (Run an Actor, then Get dataset items).
Use with AI agents (MCP)
Every public Apify Actor is available as a tool through the Apify MCP server. Add https://mcp.apify.com?tools=brasil-data/brazil-tax-code-lookup to Claude, ChatGPT, Cursor or any MCP client. The agent sends {"queries": ["<code or description>"], "table": "auto"} and reads status, code, description, hierarchy and related. queries is the only required field. Prefer exact codes when you have them; use text search ("parafuso", "suporte informatica") to find candidates, then confirm by code. The output fields are stable, in English snake_case, and every record cites its official source.
Limitations (please read)
- It does not return tax rates. No IPI (TIPI), ICMS, PIS/COFINS or ISS rates. It returns codes, official descriptions, hierarchy and cross-references. The tax-reform
reform_classrecords do carry the reduction percentages published with each cClassTrib. - It does not classify products for you. Text search finds candidate codes by words in the official descriptions; choosing the right NCM for a product is still a human (or agent) decision.
- Data freshness. The data is a versioned snapshot built from the official sources (current snapshot: 25 Oct 2026), not a live query.
source_versionandretrieved_aton every item tell you which version you got. The snapshot is refreshed periodically (target: monthly), so a code changed by a very recent act may lag. - NCM to CEST links are mechanical. A CEST applies only when both the NCM code and the CEST description fit the product. Some CEST codes (for example, door-to-door sales in segment 28) list whole NCM chapters.
- NCM section titles are not included. Only the section's roman numeral and chapter range are returned, because no open, machine-readable official source for the titles was found.
- Hierarchy descriptions for NBS headings and the NBS ↔ LC 116 ↔ cClassTrib correlation come from the national NFS-e standard. They are present only when that optional dataset is bundled. Otherwise those fields are
nullor empty. - No NCM to cClassTrib table. No open table maps NCM codes to cClassTrib, so the Actor does not guess one. Use the official reform calculator to validate a specific NCM/cClassTrib pair.
- Descriptions are in Portuguese only, exactly as published. Status messages can be in English or Portuguese.
- Not tax advice. The official publication prevails in case of divergence.
Em português
API de NCM e tabelas fiscais. Consulta e cruza as tabelas fiscais oficiais brasileiras em uma chamada:
- NCM, com seção, capítulo e posição, e os CEST vinculados;
- CEST, do Convênio ICMS 142/2018;
- CFOP, do Anexo II do Convênio s/nº de 1970;
- NBS;
- lista de serviços da LC 116/2003;
- CNAE 2.3;
- municípios do IBGE;
- CST e cClassTrib do IBS/CBS.
Para quem: agentes de IA que preenchem NF-e/NFS-e, integrações de ERP e e-commerce, ferramentas contábeis e desenvolvedores que precisam das tabelas sem raspar vários sites do governo.
Como usar: envie {"queries": ["8471.30.12", "5.102", "parafuso"]}. Funciona com código exato (com ou sem pontuação), prefixo (8471 traz toda a posição 84.71) ou texto sem acento. A saída é um item por registro, com descrição oficial em português, hierarquia, referências cruzadas e a fonte (source_url, source_version, retrieved_at), como no exemplo acima.
Quanto custa: US$ 0,001 por registro encontrado, mais US$ 0,00005 por execução iniciada. 1.000 registros ≈ US$ 1. Consulta sem resultado ou com formato inválido não é cobrada.
Integração: API da Apify (run-sync-get-dataset-items, responde em segundos), nó oficial da Apify no n8n, app da Apify no Make e no Zapier, e MCP (https://mcp.apify.com?tools=brasil-data/brazil-tax-code-lookup) para Claude, ChatGPT e Cursor.
Limitações: não traz alíquotas (IPI/TIPI, ICMS, PIS/COFINS, ISS); não classifica o produto por você, só encontra códigos candidatos; os dados são um retrato versionado das fontes oficiais (atual: 25/10/2026), atualizado periodicamente, não uma consulta ao vivo; não existe tabela aberta de NCM para cClassTrib, então o Actor não inventa uma. Em caso de divergência, vale a publicação oficial. Isto não é consultoria tributária.