{
  "openapi": "3.0.1",
  "info": {
    "title": "Brazil Company Finder (CNPJ Receita Federal)",
    "description": "Find active Brazilian companies by CNAE, state, city, size and Simples/MEI, or look up CNPJs in bulk. Official Receita Federal open data (CC BY). No partner names. PT/ES/EN.",
    "version": "0.1",
    "x-build-id": "nyy1qVUaf3vzfB4kZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tasavera~brazil-cnpj-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tasavera-brazil-cnpj-finder",
        "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/tasavera~brazil-cnpj-finder/runs": {
      "post": {
        "operationId": "runs-sync-tasavera-brazil-cnpj-finder",
        "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/tasavera~brazil-cnpj-finder/run-sync": {
      "post": {
        "operationId": "run-sync-tasavera-brazil-cnpj-finder",
        "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": {
          "modo": {
            "title": "Modo / Mode",
            "enum": [
              "buscar",
              "cnpj"
            ],
            "type": "string",
            "description": "Buscar: encontra empresas ativas por CNAE, estado, cidade e outros filtros. CNPJ: consulta uma lista de CNPJs (14 dígitos, com ou sem pontuação).",
            "default": "buscar"
          },
          "ufs": {
            "title": "Estados (UF) / States",
            "type": "array",
            "description": "Siglas, por exemplo SP, RJ, MG. Vazio = Brasil todo (mais lento).",
            "items": {
              "type": "string"
            }
          },
          "municipios": {
            "title": "Municípios / Cities",
            "type": "array",
            "description": "Nome da cidade, com ou sem acento. Por exemplo: Campinas, São Paulo, Belo Horizonte.",
            "items": {
              "type": "string"
            }
          },
          "cnaes": {
            "title": "CNAE (atividade) / Activity codes",
            "type": "array",
            "description": "Código CNAE completo (7 dígitos) ou prefixo (2 a 6 dígitos). Ex.: 5611201 restaurantes, 4930 transporte rodoviário de carga, 47 comércio varejista.",
            "items": {
              "type": "string"
            }
          },
          "incluirSecundarios": {
            "title": "Incluir CNAEs secundários / Include secondary activities",
            "type": "boolean",
            "description": "Também procura nos CNAEs secundários (lê mais dados, demora mais).",
            "default": false
          },
          "palavrasChave": {
            "title": "Palavras no nome / Name keywords",
            "type": "array",
            "description": "Opcional. Procura na razão social e no nome fantasia.",
            "items": {
              "type": "string"
            }
          },
          "portes": {
            "title": "Porte / Size",
            "type": "array",
            "description": "Opcional.",
            "items": {
              "type": "string",
              "enum": [
                "01",
                "03",
                "05",
                "00"
              ],
              "enumTitles": [
                "Microempresa (ME)",
                "Empresa de pequeno porte (EPP)",
                "Demais",
                "Não informado"
              ]
            }
          },
          "simples": {
            "title": "Simples Nacional",
            "enum": [
              "todos",
              "sim",
              "nao"
            ],
            "type": "string",
            "description": "Filtra pela opção pelo Simples Nacional.",
            "default": "todos"
          },
          "excluirMei": {
            "title": "Excluir MEI / Exclude MEI",
            "type": "boolean",
            "description": "MEIs são pessoas físicas: aparecem sem nome do titular, telefone ou e-mail.",
            "default": false
          },
          "somenteMatriz": {
            "title": "Somente matriz / Head offices only",
            "type": "boolean",
            "description": "Somente o estabelecimento matriz (sem filiais).",
            "default": false
          },
          "comTelefone": {
            "title": "Somente com telefone / Only with phone",
            "type": "boolean",
            "description": "Somente empresas com telefone publicado.",
            "default": false
          },
          "comEmail": {
            "title": "Somente com e-mail / Only with email",
            "type": "boolean",
            "description": "Somente empresas com e-mail publicado.",
            "default": false
          },
          "abertasDesde": {
            "title": "Abertas desde / Opened from",
            "type": "string",
            "description": "AAAA-MM-DD. Opcional."
          },
          "abertasAte": {
            "title": "Abertas até / Opened until",
            "type": "string",
            "description": "AAAA-MM-DD. Opcional."
          },
          "cnpjs": {
            "title": "CNPJs (modo CNPJ)",
            "type": "array",
            "description": "Somente no modo CNPJ. Até 10.000 por execução.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Máximo de empresas / Max companies",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Tope de empresas entregues (cada uma é um cobro).",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}