Export a company list to Excel or CSV
Once you have built a segment in CNPJAPI, you export the company list as Excel (XLSX) or CSV to work in your spreadsheet, CRM or BI tool. Export is a self-service feature in the portal, from Receita Federal's official data.
Feature overview: Segmented company lists.
Step by step
- In the portal (https://app.cnpjapi.com.br), build the segment under Segmentation (
/busca/segmentacao) and hit Segment to see the preview (how many companies and the distribution). How to build one: list by CNAE and list by city and state. - Click Export. Choose:
- Format: XLSX (Excel) or CSV.
- Scope: the whole segment (up to your plan's per-file row limit) or up to a number of rows you set (handy for a sample).
- Review the charge summary before generating: how many rows the file will have, how much comes from the plan allowance and how much from credits, if any. Nothing is truncated silently.
- Confirm. Generation is asynchronous: track progress under Exports (
/busca/exportacoes). - When it is ready, you get a notice; download the file (available for 7 days). Downloading again within the window does not charge you twice.
What the file contains
One row per company, with a header, carrying the fields from the official record: CNPJ, legal name, trade name, registration status, CNAE, legal nature, company size, full address, phone and e-mail (when present) and the Simples/MEI flag. Codes come with their description.
XLSX or CSV: which to choose
- XLSX (Excel): opens straight in Excel/LibreOffice, with values already formatted as text (preserves leading zeros in ZIP codes and codes). Best for manual spreadsheet work.
- CSV: a universal format, ideal for importing into a CRM, database or BI tool. When opening it in Excel, import as text so you do not lose leading zeros.
Pricing and quota
Export is charged per row: a monthly allowance included in the plan (Advanced 10,000/month, Business 50,000/month) plus add-on credits for extra volume, with no expiration. The preview is not charged per row - the charge applies only to the export. You track allowance, usage and credit balance in the portal.
Each file goes up to the per-plan limit (50,000 rows on Advanced, 100,000 on Business); a segment larger than the limit is generated up to that cap, so split it into smaller cuts (by state, city or CNAE) to take them all. Since the per-file limit can be larger than the monthly allowance, a big file may consume credits beyond the allowance - the portal shows the tally before generating.
Tips
- Calibrate in the preview before exporting: since the charge is per row, settle the filters first.
- Quick sample: use the "up to N rows" scope to check the format before pulling the whole segment.
- Re-imported and leading zeros vanished? Import the column as text (ZIP codes, codes and CNPJ have significant leading zeros).
Responsible use
The company registry is public, but how you use the list is your responsibility: when using contacts, comply with the LGPD and communication rules. The contacts are those from the official record (they may be missing or outdated), not a validated mailing. See the note in Segmented company lists.