{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil CNPJ Scraper (Receita Federal Company Data & Leads)",
    "description": "Brazil CNPJ lookup (consulta CNPJ) and company search (empresas do Brasil) from the Receita Federal register: legal name, status, CNAE, address, phone, email, Simples/MEI, partners (QSA). Look up CNPJs in bulk or find leads by state, city, CNAE or size. Export to JSON, CSV or Excel, or via API.",
    "version": "1.0",
    "x-build-id": "55VdbCSrc8g4TZ1Dy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steadyscrape~brazil-cnpj-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steadyscrape-brazil-cnpj-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/steadyscrape~brazil-cnpj-scraper/runs": {
      "post": {
        "operationId": "runs-sync-steadyscrape-brazil-cnpj-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/steadyscrape~brazil-cnpj-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-steadyscrape-brazil-cnpj-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "cnpjs": {
            "title": "CNPJs to look up",
            "type": "array",
            "description": "One row per CNPJ, with the company's legal and trade names, status, opening date, legal nature, size, share capital, CNAE activities, address, phones, <b>email</b>, Simples Nacional / MEI and partners (QSA). Formatted or bare, numeric or the new alphanumeric CNPJ: <code>33.683.111/0002-80</code>, <code>00000000000191</code>, <code>12.ABC.345/01DE-35</code>. Check digits are verified: a CNPJ whose digits do not add up, or that is in no register, is a free row. When CNPJs are given, the search below is not run.",
            "items": {
              "type": "string",
              "pattern": "^\\s*([0-9A-Za-z]{2}[.\\s]?[0-9A-Za-z]{3}[.\\s]?[0-9A-Za-z]{3}[/\\s]?[0-9A-Za-z]{4}[-\\s]?\\d{2})?\\s*$"
            },
            "default": []
          },
          "datasetId": {
            "title": "Or take the CNPJs from a dataset",
            "type": "string",
            "description": "Pick the dataset of another run or an import (a CRM export, a spreadsheet) and every CNPJ in its field below is looked up. Only the dataset you pick here can be read."
          },
          "datasetField": {
            "title": "Dataset field with the CNPJ",
            "type": "string",
            "description": "The field of each dataset item that holds the CNPJ, as a dotted path for a nested one (<code>company.cnpj</code>). A number is read as a CNPJ whose leading zeros a spreadsheet dropped.",
            "default": "cnpj"
          },
          "states": {
            "title": "States (UF)",
            "type": "array",
            "description": "Search the register by state. Give at least one of states, municipalities, CNAE activities, legal natures or partners; the search runs only when no CNPJ is given above.",
            "items": {
              "type": "string",
              "enum": [
                "AC",
                "AL",
                "AP",
                "AM",
                "BA",
                "CE",
                "DF",
                "ES",
                "GO",
                "MA",
                "MT",
                "MS",
                "MG",
                "PA",
                "PB",
                "PR",
                "PE",
                "PI",
                "RJ",
                "RN",
                "RS",
                "RO",
                "RR",
                "SC",
                "SP",
                "SE",
                "TO"
              ],
              "enumTitles": [
                "AC Acre",
                "AL Alagoas",
                "AP Amapá",
                "AM Amazonas",
                "BA Bahia",
                "CE Ceará",
                "DF Distrito Federal",
                "ES Espírito Santo",
                "GO Goiás",
                "MA Maranhão",
                "MT Mato Grosso",
                "MS Mato Grosso do Sul",
                "MG Minas Gerais",
                "PA Pará",
                "PB Paraíba",
                "PR Paraná",
                "PE Pernambuco",
                "PI Piauí",
                "RJ Rio de Janeiro",
                "RN Rio Grande do Norte",
                "RS Rio Grande do Sul",
                "RO Rondônia",
                "RR Roraima",
                "SC Santa Catarina",
                "SP São Paulo",
                "SE Sergipe",
                "TO Tocantins"
              ]
            },
            "default": []
          },
          "municipalities": {
            "title": "Municipalities",
            "type": "array",
            "description": "Municipality names, case and accents aside, e.g. <code>São Paulo</code>, <code>Florianópolis</code>, or with the state for a name several states share, <code>Bom Jesus - PI</code>; or the 7-digit IBGE code (<code>3550308</code>). A name matches the municipalities so named in the states chosen above (all states when none is). A name that matches nothing is a free row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cnaes": {
            "title": "CNAE activities",
            "type": "array",
            "description": "CNAE codes or words of their description in Portuguese: <code>5611-2/01</code> (restaurants), the first digits of a group or class (<code>5611</code>, <code>4781</code>), or words like <code>restaurante</code>, <code>padaria</code>, <code>odontológica</code>, <code>advocacia</code>. An entry that names more than 120 subclasses is refused as too broad.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cnaeScope": {
            "title": "Match the CNAE as",
            "enum": [
              "primary",
              "any"
            ],
            "type": "string",
            "description": "The company's main activity only (CNAE fiscal), or its main or any secondary activity.",
            "default": "primary"
          },
          "legalNatures": {
            "title": "Legal natures",
            "type": "array",
            "description": "Keep companies of these legal natures (natureza jurídica), as the Receita codes them: 2062 Ltda, 2135 empresário individual (MEIs are mostly here), 2305 EIRELI, 2240 sociedade simples…",
            "items": {
              "type": "string",
              "enum": [
                "1015",
                "1023",
                "1031",
                "1040",
                "1058",
                "1066",
                "1074",
                "1082",
                "1104",
                "1112",
                "1120",
                "1139",
                "1147",
                "1155",
                "1163",
                "1171",
                "1180",
                "1198",
                "1210",
                "1228",
                "1236",
                "1244",
                "1252",
                "1260",
                "1279",
                "1287",
                "1295",
                "1309",
                "1317",
                "1325",
                "1333",
                "1341",
                "1350",
                "2011",
                "2038",
                "2046",
                "2054",
                "2062",
                "2070",
                "2089",
                "2097",
                "2100",
                "2127",
                "2135",
                "2143",
                "2151",
                "2160",
                "2178",
                "2194",
                "2216",
                "2224",
                "2232",
                "2240",
                "2259",
                "2267",
                "2275",
                "2283",
                "2291",
                "2305",
                "2313",
                "2321",
                "2330",
                "2348",
                "3034",
                "3069",
                "3077",
                "3085",
                "3107",
                "3115",
                "3131",
                "3204",
                "3212",
                "3220",
                "3239",
                "3247",
                "3255",
                "3263",
                "3271",
                "3280",
                "3298",
                "3301",
                "3310",
                "3328",
                "3999",
                "4014",
                "4090",
                "4120",
                "5010",
                "5029",
                "5037",
                "8885"
              ],
              "enumTitles": [
                "1015 Órgão Público do Poder Executivo Federal",
                "1023 Órgão Público do Poder Executivo Estadual ou do Distrito Federal",
                "1031 Órgão Público do Poder Executivo Municipal",
                "1040 Órgão Público do Poder Legislativo Federal",
                "1058 Órgão Público do Poder Legislativo Estadual ou do Distrito Federal",
                "1066 Órgão Público do Poder Legislativo Municipal",
                "1074 Órgão Público do Poder Judiciário Federal",
                "1082 Órgão Público do Poder Judiciário Estadual",
                "1104 Autarquia Federal",
                "1112 Autarquia Estadual ou do Distrito Federal",
                "1120 Autarquia Municipal",
                "1139 Fundação Pública de Direito Público Federal",
                "1147 Fundação Pública de Direito Público Estadual ou do Distrito Federal",
                "1155 Fundação Pública de Direito Público Municipal",
                "1163 Órgão Público Autônomo Federal",
                "1171 Órgão Público Autônomo Estadual ou do Distrito Federal",
                "1180 Órgão Público Autônomo Municipal",
                "1198 Comissão Polinacional",
                "1210 Consórcio Público de Direito Público (Associação Pública)",
                "1228 Consórcio Público de Direito Privado",
                "1236 Estado ou Distrito Federal",
                "1244 Município",
                "1252 Fundação Pública de Direito Privado Federal",
                "1260 Fundação Pública de Direito Privado Estadual ou do Distrito Federal",
                "1279 Fundação Pública de Direito Privado Municipal",
                "1287 Fundo Público da Administração Indireta Federal",
                "1295 Fundo Público da Administração Indireta Estadual ou do Distrito Federal",
                "1309 Fundo Público da Administração Indireta Municipal",
                "1317 Fundo Público da Administração Direta Federal",
                "1325 Fundo Público da Administração Direta Estadual ou do Distrito Federal",
                "1333 Fundo Público da Administração Direta Municipal",
                "1341 União",
                "1350 ENTIDADE PÚBLICA SOB REGIME ESPECIAL",
                "2011 Empresa Pública",
                "2038 Sociedade de Economia Mista",
                "2046 Sociedade Anônima Aberta",
                "2054 Sociedade Anônima Fechada",
                "2062 Sociedade Empresária Limitada",
                "2070 Sociedade Empresária em Nome Coletivo",
                "2089 Sociedade Empresária em Comandita Simples",
                "2097 Sociedade Empresária em Comandita por Ações",
                "2100 Sociedade Mercantil de Capital e Indústria",
                "2127 Sociedade em Conta de Participação",
                "2135 Empresário (Individual)",
                "2143 Cooperativa",
                "2151 Consórcio de Sociedades",
                "2160 Grupo de Sociedades",
                "2178 Estabelecimento, no Brasil, de Sociedade Estrangeira",
                "2194 Estabelecimento, no Brasil, de Empresa Binacional Argentino-Brasileira",
                "2216 Empresa Domiciliada no Exterior",
                "2224 Clube/Fundo de Investimento",
                "2232 Sociedade Simples Pura",
                "2240 Sociedade Simples Limitada",
                "2259 Sociedade Simples em Nome Coletivo",
                "2267 Sociedade Simples em Comandita Simples",
                "2275 Empresa Binacional",
                "2283 Consórcio de Empregadores",
                "2291 Consórcio Simples",
                "2305 Empresa Individual de Responsabilidade Limitada (de Natureza Empresária)",
                "2313 Empresa Individual de Responsabilidade Limitada (de Natureza Simples)",
                "2321 Sociedade Unipessoal de Advocacia",
                "2330 Cooperativas de Consumo",
                "2348 Empresa Simples de Inovação",
                "3034 Serviço Notarial e Registral (Cartório)",
                "3069 Fundação Privada",
                "3077 Serviço Social Autônomo",
                "3085 Condomínio Edilício",
                "3107 Comissão de Conciliação Prévia",
                "3115 Entidade de Mediação e Arbitragem",
                "3131 Entidade Sindical",
                "3204 Estabelecimento, no Brasil, de Fundação ou Associação Estrangeiras",
                "3212 Fundação ou Associação Domiciliada no Exterior",
                "3220 Organização Religiosa",
                "3239 Comunidade Indígena",
                "3247 Fundo Privado",
                "3255 Órgão de Direção Nacional de Partido Político",
                "3263 Órgão de Direção Regional de Partido Político",
                "3271 Órgão de Direção Local de Partido Político",
                "3280 Comitê Financeiro de Partido Político",
                "3298 Frente Plebiscitária ou Referendária",
                "3301 Organização Social (OS)",
                "3310 DEMAIS CONDOMÍNIOS",
                "3328 Plano de Benefícios de Previdência Complementar Fechada",
                "3999 Associação Privada",
                "4014 Empresa Individual Imobiliária",
                "4090 Candidato a Cargo Político Eletivo",
                "4120 Produtor Rural (Pessoa Física)",
                "5010 Organização Internacional",
                "5029 Representação Diplomática Estrangeira",
                "5037 Outras Instituições Extraterritoriais",
                "8885 Natureza Jurídica não informada"
              ]
            },
            "default": []
          },
          "partnerDocuments": {
            "title": "Partner's CPF or CNPJ",
            "type": "array",
            "description": "Companies where this person or company is a partner (QSA). A CPF is searched the way the register masks it: <code>123.456.789-09</code> or <code>***456789**</code>. A CPF or CNPJ whose check digits do not add up is a free row and is not searched. Add a state: Minha Receita warns a partner search alone tends to time out.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "registrationStatuses": {
            "title": "Registration status",
            "type": "array",
            "description": "Keep companies with this status (situação cadastral). Active only by default; empty keeps every status.",
            "items": {
              "type": "string",
              "enum": [
                "ATIVA",
                "BAIXADA",
                "INAPTA",
                "SUSPENSA",
                "NULA"
              ],
              "enumTitles": [
                "ATIVA (active)",
                "BAIXADA (closed)",
                "INAPTA (unfit)",
                "SUSPENSA (suspended)",
                "NULA (void)"
              ]
            },
            "default": [
              "ATIVA"
            ]
          },
          "establishmentType": {
            "title": "Head office or branch",
            "enum": [
              "any",
              "MATRIZ",
              "FILIAL"
            ],
            "type": "string",
            "description": "Every CNPJ is one establishment: the head office (matriz) or a branch (filial).",
            "default": "any"
          },
          "companySizes": {
            "title": "Company size",
            "type": "array",
            "description": "Keep companies of these sizes (porte) as the Receita records them.",
            "items": {
              "type": "string",
              "enum": [
                "MICRO EMPRESA",
                "EMPRESA DE PEQUENO PORTE",
                "DEMAIS"
              ],
              "enumTitles": [
                "Micro company (ME)",
                "Small company (EPP)",
                "Other (larger)"
              ]
            },
            "default": []
          },
          "openedFrom": {
            "title": "Opened on or after (YYYY-MM-DD)",
            "pattern": "^\\s*(\\d{4}-\\d{2}-\\d{2})?\\s*$",
            "type": "string",
            "description": "Keep companies that started activity on this day or later, e.g. <code>2025-01-01</code>. The search reads every page to find them: combine it with a municipality or a CNAE.",
            "default": ""
          },
          "openedInLastDays": {
            "title": "Opened in the last N days",
            "minimum": 0,
            "type": "integer",
            "description": "Keep companies opened in the last N days, counted from the run; 0 for no limit. New companies appear when Minha Receita loads the Receita's monthly release.",
            "default": 0
          },
          "simplesNacional": {
            "title": "Simples Nacional",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Keep companies that opted in to Simples Nacional, or those that did not.",
            "default": "any"
          },
          "mei": {
            "title": "MEI",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Keep micro-entrepreneurs (MEI), or exclude them.",
            "default": "any"
          },
          "requirePhone": {
            "title": "Only with a phone",
            "type": "boolean",
            "description": "Keep only companies with a phone number. The search's source, Minha Receita, withholds emails, and the address and phone of individual entrepreneurs, for privacy: look a company up by CNPJ to get its email.",
            "default": false
          },
          "nameKeywords": {
            "title": "Words in the name",
            "type": "array",
            "description": "Keep companies whose legal or trade name has any of these words, from the start of a word, case and accents aside: <code>sushi</code>, <code>pizzaria</code>, <code>clinica</code>.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new companies since the last run",
            "type": "boolean",
            "description": "Monitor mode for a search: deliver only the companies that did not match it at the previous run with the same filters. The first run reads the whole search and saves a free baseline; while Minha Receita holds the same monthly release a run reads nothing and charges nothing.",
            "default": false
          },
          "maxResults": {
            "title": "Max companies",
            "minimum": 0,
            "type": "integer",
            "description": "The most companies a search delivers; 0 for all. Lookups deliver every CNPJ given.",
            "default": 1000
          },
          "maxScanned": {
            "title": "Max establishments scanned",
            "minimum": 0,
            "type": "integer",
            "description": "The most establishments a search reads before stopping (it reads 1,024 a page, two seconds apart), so filters that keep few companies cannot read the whole register; 0 for no limit.",
            "default": 100000
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}