# Convert NF-e XML to an Excel spreadsheet by item

**Use case:** 

Paste NF-e XML and get one spreadsheet row per invoice item: invoice header, issuer, NCM, CFOP, quantity, unit price and ICMS, IPI, PIS and COFINS values. The prefilled XML is a fictitious sample invoice. Export the result to Excel, CSV or JSON.

## Input

```json
{
  "xmlTexts": [
    "<nfeProc xmlns=\"http://www.portalfiscal.inf.br/nfe\" versao=\"4.00\"><NFe><infNFe Id=\"NFe35261100000000000191550010000000011000000010\" versao=\"4.00\"><ide><mod>55</mod><serie>1</serie><nNF>1</nNF><dhEmi>2026-11-10T10:00:00-03:00</dhEmi><natOp>EXEMPLO FICTICIO - VENDA</natOp><tpNF>1</tpNF></ide><emit><CNPJ>00000000000191</CNPJ><xNome>EMPRESA EXEMPLO FICTICIA LTDA</xNome><enderEmit><xMun>SAO PAULO</xMun><UF>SP</UF></enderEmit></emit><dest><CNPJ>11111111000111</CNPJ><xNome>CLIENTE EXEMPLO FICTICIO SA</xNome><enderDest><UF>RJ</UF></enderDest></dest><det nItem=\"1\"><prod><cProd>A1</cProd><cEAN>SEM GTIN</cEAN><xProd>PRODUTO EXEMPLO</xProd><NCM>96081000</NCM><CFOP>6102</CFOP><uCom>UN</uCom><qCom>10.0000</qCom><vUnCom>2.50</vUnCom><vProd>25.00</vProd></prod><imposto><ICMS><ICMS00><CST>00</CST><vBC>25.00</vBC><pICMS>12.00</pICMS><vICMS>3.00</vICMS></ICMS00></ICMS></imposto></det><total><ICMSTot><vProd>25.00</vProd><vICMS>3.00</vICMS><vNF>25.00</vNF></ICMSTot></total></infNFe></NFe></nfeProc>"
  ],
  "rowPer": "item",
  "maskPersonalData": true
}
```

## Output

```json
{
  "number": {
    "label": "NF number"
  },
  "series": {
    "label": "Series"
  },
  "issuedAt": {
    "label": "Issued at"
  },
  "issuerName": {
    "label": "Issuer"
  },
  "issuerCnpj": {
    "label": "Issuer CNPJ"
  },
  "recipientName": {
    "label": "Recipient"
  },
  "itemNumber": {
    "label": "Item"
  },
  "productCode": {
    "label": "Code"
  },
  "description": {
    "label": "Description"
  },
  "ncm": {
    "label": "NCM"
  },
  "cfop": {
    "label": "CFOP"
  },
  "quantity": {
    "label": "Qty",
    "format": "number"
  },
  "unit": {
    "label": "Unit"
  },
  "unitPrice": {
    "label": "Unit price",
    "format": "number"
  },
  "itemTotal": {
    "label": "Item total",
    "format": "number"
  },
  "icmsValue": {
    "label": "ICMS",
    "format": "number"
  },
  "ipiValue": {
    "label": "IPI",
    "format": "number"
  },
  "pisValue": {
    "label": "PIS",
    "format": "number"
  },
  "cofinsValue": {
    "label": "COFINS",
    "format": "number"
  },
  "invoiceTotal": {
    "label": "Invoice total",
    "format": "number"
  },
  "accessKey": {
    "label": "Access key"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Brazil NF-e XML to Excel, CSV & JSON Converter Actor is ready to run with the inputs already set for "Convert NF-e XML to an Excel spreadsheet by item". [Sign up or log in](https://console.apify.com/create-task-from-example/pMIJwlLSXb7jFwbvm) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Convert NF-e XML to an Excel spreadsheet by item" task

The Brazil NF-e XML to Excel, CSV & JSON Converter Actor will start running based on the input automatically. You can also change all the input fields, like XML contents, one row per, and more, to match your specific use case.

### 3. Receive the "Convert NF-e XML to an Excel spreadsheet by item" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as NF number, series, issued at, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Convert NF-e XML to an Excel spreadsheet by item" task via API](https://apify.com/dados-abertos-br/nfe-planilha.md).

## About this Actor

This example demonstrates how to use [Brazil NF-e XML to Excel, CSV & JSON Converter](https://apify.com/dados-abertos-br/nfe-planilha.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/dados-abertos-br/nfe-planilha.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/dados-abertos-br/nfe-planilha.md

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`).
