Brazil NF-e XML to Excel, CSV & JSON Converter avatar

Brazil NF-e XML to Excel, CSV & JSON Converter

Pricing

from $5.00 / 1,000 results

Go to Apify Store
Brazil NF-e XML to Excel, CSV & JSON Converter

Brazil NF-e XML to Excel, CSV & JSON Converter

Convert Brazilian NF-e and NFC-e XML files (layout 4.00) into a spreadsheet: one row per item with invoice header, NCM, CFOP, quantities, prices and ICMS, IPI, PIS and COFINS. Export to Excel, CSV or JSON. Buyer CPF masked by default. Reads your XML only, no SEFAZ login.

Pricing

from $5.00 / 1,000 results

Rating

0.0

(0)

Developer

Dados Abertos BR

Dados Abertos BR

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Features

Limited permissions

Share

Brazil NF-e XML to Excel turns Brazilian electronic invoice XML files, NF-e (model 55) and NFC-e (model 65), layout 4.00, into a clean spreadsheet: one row per invoice item, with the invoice header repeated on each row, so filters and pivot tables work right away. Export to Excel, CSV or JSON. It only reads the XML you provide: no SEFAZ query, no digital certificate, no login.

Converte XML de NF-e e NFC-e em planilha Excel: uma linha por item, com NCM, CFOP e impostos.

What can you do with it?

  • Accounting and bookkeeping. Turn a month of invoice XML files into one spreadsheet for review.
  • Purchase analysis. Compare prices, quantities and suppliers across invoices.
  • Goods receiving. Check the items of an incoming invoice against the purchase order.
  • Tax review. See NCM, CFOP, ICMS, IPI, PIS and COFINS per item, side by side.
  • System integration. Feed invoice data into an ERP, a database or an AI agent as JSON.

What data does it return?

GroupFields
InvoiceaccessKey, model, series, number, issuedAt, operationNature, operationType, authorizationProtocol, authorizationStatus
IssuerissuerCnpj, issuerName, issuerTradeName, issuerState, issuerCity
RecipientrecipientCnpj, recipientCpf (masked by default), recipientName, recipientState
ItemitemNumber, productCode, ean (empty when "SEM GTIN"), description, ncm, cest, cfop, unit, quantity, unitPrice, itemTotal, itemDiscount
Taxes per itemicmsCst (CST or CSOSN), icmsBase, icmsRate, icmsValue, ipiValue, pisValue, cofinsValue
Invoice totalsinvoiceProductsTotal, invoiceDiscount, invoiceFreight, invoiceIcms, invoiceIpi, invoiceTotal
Controlsource (which file the row came from)

With rowPer set to nota, you get one row per invoice with the invoice, issuer, recipient and totals groups, plus itemCount.

How to convert NF-e XML to Excel

  1. Open the Actor and go to Input.
  2. Add your files: paste the XML contents in XML contents, or list links to the files in XML file URLs.
  3. Choose One row per: invoice item (best for spreadsheets) or invoice.
  4. Click Start. A run takes a few seconds.
  5. Open the Output tab, click Export and choose Excel, CSV or JSON.

The Actor comes with a fictitious sample invoice in the input, so you can click Start and see the result before using your own files.

How much does it cost?

Pay per result: US$ 5.00 per 1,000 result rows, plus a US$ 0.00005 start fee per run. Platform usage is not billed on top.

  • One row is one invoice item. An invoice with 12 items is 12 rows, about US$ 0.06.
  • 1,000 invoices with 10 items each are 10,000 rows, about US$ 50.
  • With rowPer set to nota, each invoice is one row, whatever the number of items.

Input

FieldWhat it doesDefault
xmlUrlsLinks to XML files (http or https, up to 5 MB each)empty
xmlTextsRaw XML contents, one string per invoicesample invoice
rowPeritem (one row per product line) or nota (one row per invoice)item
maskPersonalDataMask the CPF and hide the name when the recipient is a persontrue

Input examples

Files by link:

{
"xmlUrls": [
"https://example.com/invoices/35261100000000000191550010000012341000012345.xml",
"https://example.com/invoices/35261100000000000191550010000012351000012356.xml"
],
"rowPer": "item"
}

XML pasted as text, one row per invoice:

{
"xmlTexts": ["<nfeProc xmlns=\"http://www.portalfiscal.inf.br/nfe\" versao=\"4.00\">...</nfeProc>"],
"rowPer": "nota"
}

Output example

One row per item (shortened; the invoice here is fictitious):

{
"source": "xmlTexts[0]",
"accessKey": "35261100000000000191550010000000011000000010",
"model": "55",
"series": "1",
"number": "1",
"issuedAt": "2026-11-10T10:00:00-03:00",
"operationNature": "EXEMPLO FICTICIO - VENDA",
"operationType": "saída",
"issuerCnpj": "00000000000191",
"issuerName": "EMPRESA EXEMPLO FICTICIA LTDA",
"issuerState": "SP",
"recipientCnpj": "11111111000111",
"recipientName": "CLIENTE EXEMPLO FICTICIO SA",
"recipientState": "RJ",
"invoiceProductsTotal": 25.0,
"invoiceIcms": 3.0,
"invoiceTotal": 25.0,
"itemNumber": 1,
"productCode": "A1",
"ean": null,
"description": "PRODUTO EXEMPLO",
"ncm": "96081000",
"cfop": "6102",
"unit": "UN",
"quantity": 10.0,
"unitPrice": 2.5,
"itemTotal": 25.0,
"icmsCst": "00",
"icmsBase": 25.0,
"icmsRate": 12.0,
"icmsValue": 3.0
}

Privacy and security

  • Buyer data is masked by default. When the recipient is a person (CPF), the CPF comes as ***.456.789-** and the name is hidden. Company recipients (CNPJ) are kept as they are. Turn maskPersonalData off only if you have a legal basis to process the buyer's personal data.
  • Your files stay in your account. The Actor reads the XML, writes the rows to the dataset of your own run and sends nothing anywhere else.
  • Unsafe XML is refused. Files with DOCTYPE or ENTITY declarations are rejected, and each file is limited to 5 MB.

Errors

A bad file does not stop the run. Files that could not be read are listed in the ERRORS record of the run's key-value store, each with the reason, and the other files are converted normally.

Use it with the API, Python, JavaScript and MCP

Run it and get the rows in one HTTP call:

curl -X POST "https://api.apify.com/v2/acts/dados-abertos-br~nfe-planilha/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"xmlUrls": ["https://example.com/invoice.xml"], "rowPer": "item"}'

Python:

from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
xml = open("invoice.xml", encoding="utf-8").read()
run = client.actor("dados-abertos-br/nfe-planilha").call(run_input={"xmlTexts": [xml]})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
print(row["description"], row["quantity"], row["itemTotal"])

JavaScript:

import { readFileSync } from 'node:fs';
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const xml = readFileSync('invoice.xml', 'utf8');
const run = await client.actor('dados-abertos-br/nfe-planilha').call({ xmlTexts: [xml] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

AI agents can call this Actor as a tool through the Apify MCP server. The input and output are described by schemas, so an agent knows what to send and what comes back.

Limitations

  • It reads, it does not fetch. The Actor does not download invoices from SEFAZ by access key. You provide the XML.
  • NF-e and NFC-e only. CT-e, MDF-e, NFS-e and event files (cancellation, correction letter) are not supported and go to the error list.
  • Layout 4.00. The Actor was built for the current layout. Older layouts may come with empty fields.
  • No signature check. It does not validate the digital signature or the status of the invoice at SEFAZ. The authorization fields come from the XML itself, when present.
  • One file, one invoice. Batch files with several invoices in one XML are not split.
  • This Actor is independent. It is not affiliated with SEFAZ or the Receita Federal.

FAQ

Do I need a digital certificate? No. The Actor only reads XML files you already have.

Does it query SEFAZ? No. It does not connect to SEFAZ or to any other service.

Does it support NFC-e? Yes. Models 55 (NF-e) and 65 (NFC-e) are supported.

How do I get Excel instead of CSV? In the Output tab of the run, click Export and pick Excel. The same data is available as CSV, JSON and XML.

Why is the CPF masked? To protect the buyer's personal data by default. Turn maskPersonalData off if you have a legal basis to process it.

Can I process many files at once? Yes. Send several links in xmlUrls or several strings in xmlTexts in the same run.

What happens with an invalid XML? It is skipped and listed in the ERRORS record with the reason. The other files are converted.

Is my XML stored? The input and the result stay in the storage of your own Apify account, under your plan's retention rules. The Actor does not copy them anywhere else.

How do I get one row per invoice? Set rowPer to nota.

Which simple-tax fields are covered? For companies under Simples Nacional, icmsCst carries the CSOSN code.

Resumo e perguntas em português

Converte o XML de NF-e e de NFC-e (leiaute 4.00) em planilha: uma linha por item, com os dados da nota em cada linha, NCM, CFOP, quantidades, preços e impostos (ICMS, IPI, PIS e COFINS). Exporte em Excel, CSV ou JSON.

  • Precisa de certificado digital? Não. O robô só lê o XML que você envia.
  • Consulta a SEFAZ? Não.
  • E o CPF do comprador? Sai mascarado por padrão.
  • Quanto custa? US$ 5 por mil linhas. Uma nota com 12 itens são 12 linhas.
  • Dá para ter uma linha por nota? Sim: use rowPer igual a nota.

Your feedback

Found a problem or a missing field? Open an issue on the Issues tab of this Actor.