{
  "openapi": "3.0.1",
  "info": {
    "title": "CNPJ Lead Scraper API - Find Brazilian Companies by CNAE",
    "description": "Search 55M+ Brazilian companies by CNAE segment, state and size. Get legal name, address, phone, email and QSA shareholders from the official CNPJ registry. Export to JSON, CSV or Excel, or call the Batch API. Pay only per result returned. CNAE list: https://brasildados.org/lista-cnaes/",
    "version": "1.12",
    "x-build-id": "8Xn3ffEKGVt70ibtb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/brasildados~cnpj-lead-scraper-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-brasildados-cnpj-lead-scraper-search",
        "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/brasildados~cnpj-lead-scraper-search/runs": {
      "post": {
        "operationId": "runs-sync-brasildados-cnpj-lead-scraper-search",
        "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/brasildados~cnpj-lead-scraper-search/run-sync": {
      "post": {
        "operationId": "run-sync-brasildados-cnpj-lead-scraper-search",
        "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": {
          "cnaes": {
            "title": "Economic activity codes (CNAE, 7 digits) / Códigos de atividade econômica (CNAE, 7 dígitos)",
            "type": "array",
            "description": "Optional IBGE CNAE subclasses (7 digits). Leave empty for a broad search, or use plain (`6201501`), IBGE mask (`6201-5/01`) or leading zeros (`0111301`). / Subclasses CNAE opcionais do IBGE (7 dígitos). Deixe vazio para uma busca ampla ou use código simples, máscara do IBGE ou zeros à esquerda. **Full list / Lista completa:** https://brasildados.org/lista-cnaes/",
            "items": {
              "type": "string"
            }
          },
          "municipios": {
            "title": "City IBGE codes / Códigos IBGE dos municípios",
            "type": "array",
            "description": "Optional 7-digit IBGE city codes. Look up the code of each city in the official IBGE table: https://www.ibge.gov.br/explica/codigos-dos-municipios.php . Example: São Paulo = 3550308, Campinas = 3509502. Leave empty to search all cities. / Códigos IBGE dos municípios, com 7 dígitos (opcional). Consulte o código de cada cidade na tabela oficial do IBGE: https://www.ibge.gov.br/explica/codigos-dos-municipios.php . Exemplo: São Paulo = 3550308, Campinas = 3509502. Deixe vazio para buscar em todas as cidades.",
            "items": {
              "type": "string",
              "pattern": "^[0-9]{7}$"
            }
          },
          "uf": {
            "title": "Brazilian state filters (UF) / Filtros de estado brasileiro (UF)",
            "type": "array",
            "description": "One or more Brazilian state codes used to filter results. Leave empty to search all states. / Um ou mais códigos de estados brasileiros para filtrar os resultados. Deixe vazio para pesquisar todos os estados.",
            "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": [
                "Acre (AC)",
                "Alagoas (AL)",
                "Amapá (AP)",
                "Amazonas (AM)",
                "Bahia (BA)",
                "Ceará (CE)",
                "Distrito Federal (DF)",
                "Espírito Santo (ES)",
                "Goiás (GO)",
                "Maranhão (MA)",
                "Mato Grosso (MT)",
                "Mato Grosso do Sul (MS)",
                "Minas Gerais (MG)",
                "Pará (PA)",
                "Paraíba (PB)",
                "Paraná (PR)",
                "Pernambuco (PE)",
                "Piauí (PI)",
                "Rio de Janeiro (RJ)",
                "Rio Grande do Norte (RN)",
                "Rio Grande do Sul (RS)",
                "Rondônia (RO)",
                "Roraima (RR)",
                "Santa Catarina (SC)",
                "São Paulo (SP)",
                "Sergipe (SE)",
                "Tocantins (TO)"
              ]
            }
          },
          "porte": {
            "title": "Company size / Porte da Empresa",
            "type": "array",
            "description": "Input JSON must use these codes: 01, 03, 05. They are the official registry size IDs. Leave empty to skip the size filter. / O JSON de entrada deve usar estes códigos: 01, 03, 05. São os identificadores oficiais de porte. Deixe vazio para não filtrar por porte.",
            "items": {
              "type": "string",
              "enum": [
                "01",
                "03",
                "05"
              ],
              "enumTitles": [
                "01 — Micro (ME): smallest legal size",
                "03 — Small (EPP): small company",
                "05 — Medium or large (not ME/EPP)"
              ]
            },
            "default": []
          },
          "situacaoCadastral": {
            "title": "Registration status / Situação cadastral",
            "enum": [
              "02",
              "01",
              "03",
              "04",
              "08",
              "all"
            ],
            "type": "string",
            "description": "Input JSON must use these codes: 02, 01, 03, 04, 08, or all. Code 02 means active and is recommended. / O JSON de entrada deve usar estes códigos: 02, 01, 03, 04, 08 ou all. O código 02 significa ativa e é o recomendado.",
            "default": "02"
          },
          "maxResults": {
            "title": "Maximum results / Máximo de resultados",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of companies to return (1-1,000). / Número máximo de empresas a retornar (1 a 1.000). Each company delivered to the Dataset is one billable result. / Cada empresa entregue no Dataset corresponde a um resultado cobrado.",
            "default": 250
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}